Sunday, April 14, 2019

How to resolve "TNS-12547: TNS:lost contact TNS-12560: TNS:protocol adapter error TNS-00517: Lost contact" | Karan Rajpoot

         TNS-12547: TNS:lost contact TNS-12560: TNS:protocol adapter error TNS-00517: Lost contact

Error: - "TNS-12547: TNS: lost contact TNS-12560: TNS: protocol adapter error TNS-00517: Lost contact"


Cause: - This error occurs when loopback entries have been missed in the /etc/hosts file.


Solution: - To resolve this error you need to put the loopback entries in the /etc/hosts file.


Example: - 

[oracle@prod bin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-APR-2019 22:08:16

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

Starting /u02/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u02/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u02/app/oracle/diag/tnslsnr/prod/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod.radical.com)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod.radical.com)(PORT=1521)))
TNS-12547: TNS: lost contact
 TNS-12560: TNS: protocol adapter error
  TNS-00517: Lost contact
   Linux Error: 104: Connection reset by peer


Note: - To resolve the issue need to put the below loopback entries in the /etc/hosts file.


127.0.0.1    prod.localdomain prod localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


After making the changes, Now you can restart your listener.


[oracle@prod ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-APR-2019 22:11:05

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

Starting /u02/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u02/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u02/app/oracle/diag/tnslsnr/prod/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod.radical.com)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod.radical.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                14-APR-2019 22:11:05
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u02/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u02/app/oracle/diag/tnslsnr/prod/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod.radical.com)(PORT=1521)))
Services Summary...
Service "dr" has 1 instance(s).
  Instance "dr", status UNKNOWN, has 1 handler(s) for this service...
Service "prod" has 1 instance(s).
  Instance "prod", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


Cheers!!




No comments:

Post a Comment