9 Replies Latest reply: Oct 12, 2012 4:28 AM by Sebastian Solbach -Dba Community-Oracle RSS

    TNSnames.ora file not being found

    Azmat
      Hi,

      I am unable to locate the tnsnames.ora file in the default directory on my oracle database. Is there any command either at OS level or oracle level which can show me where the tnsnames.ora file is residing.

      OS Being used = SunOS megatonn4 5.10 Generic_142909-17 sun4u sparc SUNW,SPARC-Enterprise

      Oracle_HOME = /mt4u01/app/oracle/product/10.2.0/Db_1/network/admin/

      I can see the SAMPLE tnsnames.ora file but am unable to locate the tnsnames.ora file.

      Thanks in advance!
        • 1. Re: TNSnames.ora file not being found
          dataseven
          hi,

          try this

          lsnrctl status

          STATUS of the LISTENER
          ------------------------
          Alias LISTENER
          Version TNSLSNR for HPUX: Version 10.2.0.4.0 - Production
          Start Date 04-SEP-2012 13:28:20
          Uptime 36 days 1 hr. 36 min. 16 sec
          Trace Level off
          Security ON: Local OS Authentication
          SNMP OFF
          Listener Parameter File /home/app/oracle/product/10.2.0/network/admin/listener.ora
          Listener Log File /home/app/oracle/product/10.2.0/network/log/listener.log
          Listening Endpoints Summary...


          you can find listener .ora file path.could you see this path is included the tnsnames.ora or not?

          regards,
          • 2. Re: TNSnames.ora file not being found
            Azmat
            Thanks!

            I cant see the Listener Path thing :(

            though the listen log file does exist.
            • 3. Re: TNSnames.ora file not being found
              dataseven
              hi,

              try this

              lsnrctl status

              STATUS of the LISTENER
              ------------------------
              Alias LISTENER
              Version TNSLSNR for HPUX: Version 10.2.0.4.0 - Production
              Start Date 04-SEP-2012 13:28:20
              Uptime 36 days 1 hr. 36 min. 16 sec
              Trace Level off
              Security ON: Local OS Authentication
              SNMP OFF
              Listener Parameter File /home/app/oracle/product/10.2.0/network/admin/listener.ora
              Listener Log File /home/app/oracle/product/10.2.0/network/log/listener.log
              Listening Endpoints Summary...


              you can find listener .ora file path.could you see this path is included the tnsnames.ora or not?

              regards,
              • 4. Re: TNSnames.ora file not being found
                Azmat
                As replied earlier i am unable to see the path parameter :

                LSNRCTL> status
                Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                STATUS of the LISTENER
                ------------------------
                Alias LISTENER
                Version TNSLSNR for Solaris: Version 10.2.0.5.0 - Production
                Start Date 29-FEB-2012 09:44:49
                Uptime 224 days 3 hr. 41 min. 7 sec
                Trace Level off
                Security ON: Local OS Authentication
                SNMP OFF
                Listener Log File /mt4u01/app/oracle/product/10.2.0/Db_1/network/log/listener.log
                Listening Endpoints Summary...
                • 5. Re: TNSnames.ora file not being found
                  dataseven
                  hi,

                  is the tnsnames in the /mt4u01/app/oracle/product/10.2.0/Db_1/network/admin?
                  if it is not, try this

                  cd $ORACLE_HOME
                  find . -name "tnsnames.ora"

                  regards,
                  • 6. Re: TNSnames.ora file not being found
                    Azmat
                    Thanks but this is all i am getting :

                    bash-3.00$ find . -name "tnsnames.ora"
                    ./network/admin/samples/tnsnames.ora


                    Its just showing the tnsnames.ora residing in the samples directory not the one containing all our settings !
                    • 7. Re: TNSnames.ora file not being found
                      Sebastian Solbach -Dba Community-Oracle
                      Hi Azmat,

                      this could be 2 things:

                      a.) You do not have a tnsnames.ora at all. Which would not be much of an issue at the server side. However for clients to connect with an TNS Alias it may be needed.
                      If you only use Easy Connect or LDAP Name resolution, you don't need a TNSNAMES.ora as well. So maybe you don't have one.

                      b.) You have a tnsnames.ora but have placed it elsewhere. In this case the environment variable TNS_ADMIN would have been defined.

                      Regards
                      Sebastian
                      • 8. Re: TNSnames.ora file not being found
                        Azmat
                        Can you let me know how to go about it as according to my experience the TNS_ADMIN is as follows :

                        TNS_ADMIN=$ORACLE HOME/network/admin


                        and thus i am unable to find the file.
                        • 9. Re: TNSnames.ora file not being found
                          Sebastian Solbach -Dba Community-Oracle
                          There must not be a default tnsnames.ora (there is none for example in the GI infrastructure), just in the DBHome.
                          You can create it with netca for example.

                          Regards
                          Sebastian