1 2 Previous Next 16 Replies Latest reply: Mar 9, 2013 9:04 AM by 972355 RSS

    TNS-03505: Failed to resolve name

    972355
      Good Morning to all ;

      I am getting error when executing tnsping command;


      *$ tnsping orclprod*

      TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:05:02

      Copyright (c) 1997, 2005, Oracle. All rights reserved.

      Used parameter files:

      TNS-03505: Failed to resolve name



      Listener.ora  file


      # listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
      # Generated by Oracle configuration tools.

      LISTENER_ORCL =
      (DESCRIPTION_LIST =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = linuxserver)(PORT = 1521))
      )
      )
      SID_LIST_LISTENER_ORCL =
      (SID_LIST =
      (SID_DESC =
      (SID_NAME = orcltest)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (GLOBAL_DBNAME = MYDB.TEST.ORCLTEST.COM)
      )
      (SID_DESC =
      (SID_NAME = orclprod)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (GLOBAL_DBNAME = MYDB.PROD.ORCLPROD.COM)
      )
      )

      ==========================================

      TNSNAMES.ora  file

      # tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
      # Generated by Oracle configuration tools.

      ORCLMYTEST =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST= LINUXSERVER)(PORT= 1521))
      )
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MYDB.TEST.ORCLTEST.COM)
      )
      )
      ORCLMYPROD =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST= LINUXSERVER)(PORT= 1521))
      )
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MYDB.PROD.ORCLPROD.COM)
      )
      )


      Thanks in advance ..
        • 1. Re: TNS-03505: Failed to resolve name
          sb92075
          969352 wrote:
          Good Morning to all ;

          I am getting error when executing tnsping command;


          *$ tnsping orclprod*

          TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:05:02

          Copyright (c) 1997, 2005, Oracle. All rights reserved.

          Used parameter files:

          TNS-03505: Failed to resolve name



          Listener.ora  file


          # listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
          # Generated by Oracle configuration tools.

          LISTENER_ORCL =
          (DESCRIPTION_LIST =
          (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = linuxserver)(PORT = 1521))
          )
          )
          SID_LIST_LISTENER_ORCL =
          (SID_LIST =
          (SID_DESC =
          (SID_NAME = orcltest)
          (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
          (GLOBAL_DBNAME = MYDB.TEST.ORCLTEST.COM)
          )
          (SID_DESC =
          (SID_NAME = orclprod)
          (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
          (GLOBAL_DBNAME = MYDB.PROD.ORCLPROD.COM)
          )
          )

          ==========================================

          TNSNAMES.ora  file

          # tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
          # Generated by Oracle configuration tools.

          ORCLMYTEST =
          (DESCRIPTION =
          (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST= LINUXSERVER)(PORT= 1521))
          )
          (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = MYDB.TEST.ORCLTEST.COM)
          )
          )
          ORCLMYPROD =
          (DESCRIPTION =
          (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST= LINUXSERVER)(PORT= 1521))
          )
          (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = MYDB.PROD.ORCLPROD.COM)
          )
          )


          Thanks in advance ..
          It is unnecessary to have non-standard listener name and having multiple listener

          Do as below instead

          TNSPING ORCLMYPROD
          • 2. Re: TNS-03505: Failed to resolve name
            972355
            From  orclprod

            SQL> select name from v$database;

            NAME

            ORCLPROD

            SQL> select * from global_name;

            GLOBAL_NAME

            MYDB.PROD.ORCLPROD.COM

            From orcltest

            SQL> select name from v$database;

            NAME

            ORCLTEST

            SQL> select * from global_name;

            GLOBAL_NAME

            MYDB.TEST.ORCLTEST.COM
            • 3. Re: TNS-03505: Failed to resolve name
              sb92075
              969352 wrote:
              From  orclprod

              SQL> select name from v$database;

              NAME

              ORCLPROD

              SQL> select * from global_name;

              GLOBAL_NAME

              MYDB.PROD.ORCLPROD.COM

              From orcltest

              SQL> select name from v$database;

              NAME

              ORCLTEST

              SQL> select * from global_name;

              GLOBAL_NAME

              MYDB.TEST.ORCLTEST.COM
              the TNS alias does NOT have to match or even be related to the database name.
              • 4. Re: TNS-03505: Failed to resolve name
                972355
                It is unnecessary to have non-standard listener name and having multiple listener

                Do as below instead

                TNSPING ORCLMYPROD

                I am Getting  ERROR

                $ TNSPING ORCLPROD
                bash: TNSPING: command not found

                [oracle@linuxserver ~]$ TNSPING ORCLMYPROD
                bash: TNSPING: command not found
                • 5. Re: TNS-03505: Failed to resolve name
                  972355
                  Thanks sb.

                  the TNS alias does NOT have to match or even be related to the database name.

                  i don't understand clearly . May i know what's the exact error ?
                  • 6. Re: TNS-03505: Failed to resolve name
                    sb92075
                    969352 wrote:
                    It is unnecessary to have non-standard listener name and having multiple listener

                    Do as below instead

                    TNSPING ORCLMYPROD

                    I am Getting  ERROR

                    $ TNSPING ORCLPROD
                    bash: TNSPING: command not found

                    [oracle@linuxserver ~]$ TNSPING ORCLMYPROD
                    bash: TNSPING: command not found
                    tnsping must be lower case.
                    I apologize for that.

                    tnsping ORCLMYPROD

                    post results from above
                    • 7. Re: TNS-03505: Failed to resolve name
                      972355
                      I have only one listener. I checked with netca ulilty.

                      unnecessary to have non-standard listener name

                      Can i change listener name ?
                      • 8. Re: TNS-03505: Failed to resolve name
                        sb92075
                        969352 wrote:
                        I have only one listener. I checked with netca ulilty.

                        unnecessary to have non-standard listener name

                        Can i change listener name ?
                        yes, but I have easy solution.

                        lsnrctl stop
                        mv listener.ora listener.ora.sav
                        lsntcrl start
                        # wait 60+ seconds
                        lsnrctl status
                        lsnrctl service

                        COPY the results from above then PASTE all back here
                        • 9. Re: TNS-03505: Failed to resolve name
                          972355
                          tnsping must be lower case.

                          I apologize for that.

                          No need. I got many answers from you and OTN members.

                          [oracle@linuxserver ~]$ tnsping orclmyprod

                          TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:28:12
                          Copyright (c) 1997, 2005, Oracle. All rights reserved.
                          Used parameter files:

                          Used TNSNAMES adapter to resolve the alias
                          Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST= LINUXSERVER)(PORT= 1521))) (CONNECT_DATA = (SERVER = DEDICATED)
                          (SERVICE_NAME = MYDB.PROD.ORCLPROD.COM))) OK (0 msec)

                          Thanks sb ;
                          • 10. Re: TNS-03505: Failed to resolve name
                            972355
                            Thanks sb.

                            COPY the results from above then PASTE all back here

                            - Here is expected output.


                            *$ lsnrctl stop*

                            LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:35:06

                            Copyright (c) 1991, 2005, Oracle. All rights reserved.

                            Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                            The command completed successfully

                            *[oracle@linuxserver admin]$ mv listener.ora listener.ora.sav*

                            [oracle@linuxserver admin]$ ls -l
                            total 16
                            -rw-r--r-- 1 oracle oinstall 633 Mar 9 08:26 listener.ora.sav

                            [oracle@linuxserver admin]$ lsnrctl start # wait 60+ seconds

                            LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:40:23

                            Copyright (c) 1991, 2005, Oracle. All rights reserved.

                            TNS-01106: Listener using listener name LISTENER has already been started
                            [oracle@linuxserver admin]$ lsnrctl stop

                            LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:40:30

                            Copyright (c) 1991, 2005, Oracle. All rights reserved.

                            Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                            The command completed successfully
                            [oracle@linuxserver admin]$ lsnrctl start # wait 60+ seconds

                            LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:40:38

                            Copyright (c) 1991, 2005, Oracle. All rights reserved.

                            Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

                            TNSLSNR for Linux: Version 10.2.0.1.0 - Production
                            Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
                            Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linuxserver)(PORT=1521)))

                            Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                            STATUS of the LISTENER
                            ------------------------
                            Alias LISTENER
                            Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
                            Start Date 09-MAR-2013 08:40:39
                            Uptime 0 days 0 hr. 0 min. 0 sec
                            Trace Level off
                            Security ON: Local OS Authentication
                            SNMP OFF
                            Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
                            Listening Endpoints Summary...
                            (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linuxserver)(PORT=1521)))
                            The listener supports no services
                            The command completed successfully

                            *[oracle@linuxserver admin]$ lsnrctl status*

                            LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:41:53

                            Copyright (c) 1991, 2005, Oracle. All rights reserved.

                            Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                            STATUS of the LISTENER
                            ------------------------
                            Alias LISTENER
                            Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
                            Start Date 09-MAR-2013 08:40:39
                            Uptime 0 days 0 hr. 1 min. 14 sec
                            Trace Level off
                            Security ON: Local OS Authentication
                            SNMP OFF
                            Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
                            Listening Endpoints Summary...
                            (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linuxserver)(PORT=1521)))
                            Services Summary...
                            Service "orclprod" has 1 instance(s).
                            Instance "orclprod", status READY, has 1 handler(s) for this service...
                            Service "orclprodXDB" has 1 instance(s).
                            Instance "orclprod", status READY, has 1 handler(s) for this service...
                            Service "orclprod_XPT" has 1 instance(s).
                            Instance "orclprod", status READY, has 1 handler(s) for this service...
                            Service "orcltest" has 1 instance(s).
                            Instance "orcltest", status READY, has 1 handler(s) for this service...
                            Service "orcltestXDB" has 1 instance(s).
                            Instance "orcltest", status READY, has 1 handler(s) for this service...
                            Service "orcltest_XPT" has 1 instance(s).
                            Instance "orcltest", status READY, has 1 handler(s) for this service...
                            The command completed successfully

                            *$ lsnrctl service*

                            LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 09-MAR-2013 08:42:32

                            Copyright (c) 1991, 2005, Oracle. All rights reserved.

                            Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
                            Services Summary...
                            Service "orclprod" has 1 instance(s).
                            Instance "orclprod", status READY, has 1 handler(s) for this service...
                            Handler(s):
                            "DEDICATED" established:0 refused:0 state:ready
                            LOCAL SERVER
                            Service "orclprodXDB" has 1 instance(s).
                            Instance "orclprod", status READY, has 1 handler(s) for this service...
                            Handler(s):
                            "D000" established:0 refused:0 current:0 max:1022 state:ready
                            DISPATCHER <machine: linuxserver, pid: 5538>
                            (ADDRESS=(PROTOCOL=tcp)(HOST=linuxserver)(PORT=32828))
                            Service "orclprod_XPT" has 1 instance(s).
                            Instance "orclprod", status READY, has 1 handler(s) for this service...
                            Handler(s):
                            "DEDICATED" established:0 refused:0 state:ready
                            LOCAL SERVER
                            Service "orcltest" has 1 instance(s).
                            Instance "orcltest", status READY, has 1 handler(s) for this service...
                            Handler(s):
                            "DEDICATED" established:0 refused:0 state:ready
                            LOCAL SERVER
                            Service "orcltestXDB" has 1 instance(s).
                            Instance "orcltest", status READY, has 1 handler(s) for this service...
                            Handler(s):
                            "D000" established:0 refused:0 current:0 max:1022 state:ready
                            DISPATCHER <machine: linuxserver, pid: 5459>
                            (ADDRESS=(PROTOCOL=tcp)(HOST=linuxserver)(PORT=32823))
                            Service "orcltest_XPT" has 1 instance(s).
                            Instance "orcltest", status READY, has 1 handler(s) for this service...
                            Handler(s):
                            "DEDICATED" established:0 refused:0 state:ready
                            LOCAL SERVER
                            The command completed successfully
                            • 11. Re: TNS-03505: Failed to resolve name
                              972355
                              My doubt is

                              PLEASE CLARIFY ; I am bit confused here ..

                              when executing tnsping command , should i use TNS ALIAS name  or  ORACLE_SID name ?

                              usually we are using oracle sid name only.


                              thanks ..
                              • 12. Re: TNS-03505: Failed to resolve name
                                972355
                                From this document link : http://docs.oracle.com/cd/B19306_01/network.102/b14212/connect.htm#sthref1535

                                I got answer  tnsping <net sercice_name> i.e.  tns alias name.

                                IF above statement is wrong , please reply me .

                                Thanks ..
                                • 13. Re: TNS-03505: Failed to resolve name
                                  sb92075
                                  a tnsnames.ora entry can exist as below

                                  ORCLMYPROD, MYDB, FUBAR =
                                  (DESCRIPTION =
                                  (ADDRESS_LIST =
                                  (ADDRESS = (PROTOCOL = TCP)(HOST= LINUXSERVER)(PORT= 1521))
                                  )
                                  (CONNECT_DATA =
                                  (SERVER = DEDICATED)
                                  (SERVICE_NAME = MYDB.PROD.ORCLPROD.COM)
                                  )
                                  )

                                  below are all TNS Alias
                                  ORCLMYPROD, MYDB, FUBAR =
                                  tnsping ORCLMYPROD
                                  tnsping MYDB
                                  tnsping FUBAR

                                  all 3 commands will succeed if the entry as show above
                                  if the TNS alias matches the ORACLE_SID, then all is OK
                                  • 14. Re: TNS-03505: Failed to resolve name
                                    972355
                                    If the TNS alias matches the ORACLE_SID, then all is OK.

                                    In my case , i mentioned uniq names. So i should use net sevice_name from tnsnames.ora

                                    In my env training session : always using same name  so i  got confused. (sid_name , tns_alias_name , global_name)

                                    Thank you very much sb;
                                    1 2 Previous Next