1 Reply Latest reply on Feb 26, 2014 9:19 AM by Vandana B -Oracle

    How to configure single tnsnames.ora file for RAC

    sidneys

      A question I keep running into is this:

      In several 11Gr2 RAC databases, I would like to have just one tnsnames.ora file, and I would like to place this under the Grid Home Network Admin.  I would prefer not having to maintain multiple copies of tnsnames.ora for each instance and each node as well.  I find that if I have TNS_ADMIN set to this location, that for most functions this works fine, but when developers use DB LINKS in views, procedures or queries from SQL Developer and in some cases from the Oracle Scheduler, it doesn't work and they get an ORA-12154.  I can resolve this by putting the tnsnames.ora file in the default location for each instance and database ($ORACLE_HOME/network/admin) but I would prefer not to handle it this way.  Is there another solution that will work in all cases to have a single tnsnames.ora for each node in the RAC cluster?

      Thanks!

      Sandra

        • 1. Re: How to configure single tnsnames.ora file for RAC
          Vandana B -Oracle

          Hello Sandra,

           

          What you need to do is update the TNS_ADMIN attribute as follows

           

          srvctl setenv instance -d mydb -i mydb1 -T "TNS_ADMIN=/etc"

          srvctl start instance -d mydb -i mydb1

           

          This is because svrctl needs to pull any external environment variables from OCR and if the tnsnames.ora used in creating the DBLink is not in the usual location, the Database must be told where it is by srvctl or else an ORA-12154 error will occur. See Note:733567.1 "Setting Environment Variables Through Srvctl" for further details.

           

          Regards,

          Vandana - Oracle