1 Reply Latest reply: Sep 12, 2012 6:36 AM by Prabodh RSS

    TNS-12560: TNS:protocol adapter error

    961622
      Hi,

      Having problem with tns.

      i have installed Oracle 10g on RHEL5 & configured listener & tns on both machines.. both are working RHEL individually.. if we trying to communicate with first system (Database) by using tns. getting error. for your reference herewith furnished the my entire procedure , pls help me... to fix the problem... i am facing this problem since 3weeks.

      TNS-12560: TNS:protocol adapter error

      First system ip : 192.168.1.40
      database name : pratapdb
      O/S : RHEL 5
      Listener name : NAGI
      tns name : suman

      second system ip : 192.168.1.60
      O/S RHEL 5
      Listener name : LISTENER1
      tns : DBA1 (ip 192.168.1.60)
      tns : DBA2 (ip 192.168.1.40)

      DBA2 getting tns error.



      login as: root
      root@192.168.1.40's password:
      Last login: Fri Jan 1 13:47:07 2010
      [root@dba ~]# su - oracle
      [oracle@dba ~]$ cd /d1/app/oracle/product/10.2.0/dba/network/admin/
      [oracle@dba admin]$ ls
      listener.ora samples shrept.lst sqlnet.ora tnsnames.ora
      [oracle@dba admin]$ vi listener.ora
      --------------------------------------
      SID_LIST_NAGI =
      (SID_LIST =
      (SID_DESC =
      (SID_NAME = pratapdb)
      (ORACLE_HOME = /d1/app/oracle/product/10.2.0/dba)
      (PROGRAM = extproc)
      )
      )

      NAGI =
      (DESCRIPTION_LIST =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.40)(PORT = 1522))
      )
      )

      -------------------------
      [oracle@dba admin]$ lsnrctl start NAGI

      LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 01-JAN-2010 13:57:52

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

      Starting /d1/app/oracle/product/10.2.0/dba/bin/tnslsnr: please wait...

      TNSLSNR for Linux: Version 10.2.0.1.0 - Production
      System parameter file is /d1/app/oracle/product/10.2.0/dba/network/admin/listener. ora
      Log messages written to /d1/app/oracle/product/10.2.0/dba/network/log/nagi.log
      Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
      Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.40)(PORT=1522)))

      Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
      STATUS of the LISTENER
      ------------------------
      Alias NAGI
      Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
      Start Date 01-JAN-2010 13:57:54
      Uptime 0 days 0 hr. 0 min. 0 sec
      Trace Level off
      Security ON: Local OS Authentication
      SNMP OFF
      Listener Parameter File /d1/app/oracle/product/10.2.0/dba/network/admin/listener .ora
      Listener Log File /d1/app/oracle/product/10.2.0/dba/network/log/nagi.log
      Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.40)(PORT=1522)))
      Services Summary...
      Service "pratapdb" has 1 instance(s).
      Instance "pratapdb", status UNKNOWN, has 1 handler(s) for this service...
      The command completed successfully
      [oracle@dba admin]$vi tnsnames.ora
      ------------------
      SUMAN =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.40)(PORT = 1522))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pratapdb)
      )
      )

      EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      )
      (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
      )
      )

      ------------
      [oracle@dba admin]$ tnsping suman

      TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 01-JAN-2010 14:00:22

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

      Used parameter files:
      /d1/app/oracle/product/10.2.0/dba/network/admin/sqlnet.ora


      Used TNSNAMES adapter to resolve the alias
      Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.40)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pratapdb)))
      OK (10 msec)

      ---------------------


      SECOND MACHINE.


      login as: root
      root@192.168.1.60's password:
      Last login: Fri Jan 1 14:12:21 2010
      [root@dba ~]# su - oracle
      [oracle@dba ~]$ cd /d1/app/oracle/product/10.2.0/dba/network/admin/
      [oracle@dba admin]$ ls
      listener.ora samples shrept.lst sqlnet.ora tnsnames.ora
      [oracle@dba admin]$ vi tnsnames.ora
      [oracle@dba admin]$


      DBA2 =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.40)(PORT = 1522))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = pratapdb)
      )
      )

      EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
      (ADDRESS_LIST =

      )
      (CONNECT_DATA =
      (SID = PRATAPDB)
      (PRESENTATION = RO)
      )
      )

      ----------------

      [oracle@dba admin]$ tnsping DBA2

      TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 01-JAN-2010 14:19:38

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

      Used parameter files:
      /d1/app/oracle/product/10.2.0/dba/network/admin/sqlnet.ora


      Used TNSNAMES adapter to resolve the alias
      Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.40)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = pratapdb)))
      TNS-12560: TNS:protocol adapter error

      [oracle@dba admin]$ ls
      listener.ora samples shrept.lst sqlnet.ora tnsnames.ora
      [oracle@dba admin]$ vi listener.ora

      ------


      SID_LIST_LISTENER1 =
      (SID_LIST =
      (SID_DESC =
      (SID_NAME = pratapdb)
      (ORACLE_HOME = /d1/app/oracle/product/10.2.0/dba)
      (PROGRAM = extproc)
      )
      )

      LISTENER1 =
      (DESCRIPTION_LIST =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.60)(PORT = 1524))
      )
      )

      ------------


      [oracle@dba admin]$ lsnrctl start LISTENER1

      LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 01-JAN-2010 14:21:01

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

      Starting /d1/app/oracle/product/10.2.0/dba/bin/tnslsnr: please wait...

      TNSLSNR for Linux: Version 10.2.0.1.0 - Production
      System parameter file is /d1/app/oracle/product/10.2.0/dba/network/admin/listene r.ora
      Log messages written to /d1/app/oracle/product/10.2.0/dba/network/log/listener1. log
      Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
      Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.60)(PORT=1524) ))

      Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
      STATUS of the LISTENER
      ------------------------
      Alias LISTENER1
      Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
      Start Date 01-JAN-2010 14:21:03
      Uptime 0 days 0 hr. 0 min. 0 sec
      Trace Level off
      Security ON: Local OS Authentication
      SNMP OFF
      Listener Parameter File /d1/app/oracle/product/10.2.0/dba/network/admin/listen er.ora
      Listener Log File /d1/app/oracle/product/10.2.0/dba/network/log/listener 1.log
      Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.60)(PORT=1524)))
      Services Summary...
      Service "pratapdb" has 1 instance(s).
      Instance "pratapdb", status UNKNOWN, has 1 handler(s) for this service...
      The command completed successfully
      [oracle@dba admin]$


      ----
      DBA1 =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.60)(PORT = 1524))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = pratapdb)
      )
      )

      EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
      (ADDRESS_LIST =

      )
      (CONNECT_DATA =
      (SID = PRATAPDB)
      (PRESENTATION = RO)
      )
      )
      ---------------



      [oracle@dba admin]$ tnsping DBA1

      TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 01-JAN-2010 14:22:43

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

      Used parameter files:
      /d1/app/oracle/product/10.2.0/dba/network/admin/sqlnet.ora


      Used TNSNAMES adapter to resolve the alias
      Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.60)(PORT = 1524)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = pratapdb)))
      OK (0 msec)
      [oracle@dba admin]$

      ------------- Both System Having communication------------

      login as: root
      root@192.168.1.60's password:
      Last login: Fri Jan 1 14:17:49 2010 from 192.168.1.31
      [root@dba ~]# ping 192.168.1.40
      PING 192.168.1.40 (192.168.1.40) 56(84) bytes of data.
      64 bytes from 192.168.1.40: icmp_seq=1 ttl=64 time=0.228 ms
      64 bytes from 192.168.1.40: icmp_seq=2 ttl=64 time=0.288 ms
      64 bytes from 192.168.1.40: icmp_seq=3 ttl=64 time=0.163 ms
      64 bytes from 192.168.1.40: icmp_seq=4 ttl=64 time=0.206 ms
      64 bytes from 192.168.1.40: icmp_seq=5 ttl=64 time=0.179 ms

      --- 192.168.1.40 ping statistics ---
      5 packets transmitted, 5 received, 0% packet loss, time 4000ms
      rtt min/avg/max/mdev = 0.163/0.212/0.288/0.047 ms