Oracle dblink and ORA-12154.

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered

Hi,

I have a dblink defined with a TNS alias in an Oracle VDB on AIX. The dblink needs to lookup the TNS entry in a tnsnames.ora file, which it can not find. Returns ORA-12154.

The issue is probably caused by the VDB being started with no proper TNS_ADMIN set and no tnsnames.ora file in the OracleHome.

Where shall the environment variable TNS_ADMIN be set?


Thanks
Henrik
Photo of Henrik Bjørn Nielsen

Posted 5 months ago

  • 0
  • 1
Photo of Gary Hallam

Gary Hallam, Official Rep

  • 2,134 Points 2k badge 2x thumb
Hi Henrik,
Usually parameters can be placed in a custom parameter file when you provision the VDB.  You can either use a template or apply a name value pair.



I've never used the tns_admin parameter, nor tested this.

Regards,
Gary

Hi Gary,

Thanks for your reply, sounds pretty much like what I need. I dont have access to the admin console, but will need my outsourcing partner to set this up.

Will get back with my findings later on.

regards,
Henrik
It Works just like you suggested, thanks..
regards,
Henrik
Photo of Gary Hallam

Gary Hallam, Official Rep

  • 2,134 Points 2k badge 2x thumb
Official Response
I think Henrik you will need to set the tns_admin as a global environment variable on the target server, rather than as an oracle parameter.  If indeed this is what is causing your issue.  Perhaps raise a support case for this if you are still having problems.
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 4,862 Points 4k badge 2x thumb
Hi Henrik,

Tow points to outline in your case.

1/ you have to have the tns string defined inside a tnsnames.ora file on the way target host.

2/ oracle looks by default for tnsnames.ora at $lthe level of $ORACLE_HOME/network/admin unless you specify another location using TNS_ADMIN variable.

Regards,

Mouhssine