Sunday 3 June 2018

TNS-12543: TNS:destination host unreachable - tnsping failing for remote database


This document describes the solution for "TNS-12543: TNS:destination host unreachable"

This is the most common known issue we face when we do tnsping for remote database.

Issue Details:

[oracle@server2 admin]$ tnsping gold

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 03-JUN-2018 20:07:01

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

Used parameter files:
/u01/app/oracle/product/12.1.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.110)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = GOLD.apps.com)))
TNS-12543: TNS:destination host unreachable


Findings and Solution:

Find whether both the hosts are reachable each other

From Server1:

[oracle@server1 admin]$ ping server2
PING server2.apps.com (192.168.1.120) 56(84) bytes of data.
64 bytes from server2.apps.com (192.168.1.120): icmp_seq=1 ttl=64 time=0.468 ms
64 bytes from server2.apps.com (192.168.1.120): icmp_seq=2 ttl=64 time=0.857 ms
64 bytes from server2.apps.com (192.168.1.120): icmp_seq=3 ttl=64 time=0.432 ms
64 bytes from server2.apps.com (192.168.1.120): icmp_seq=4 ttl=64 time=0.575 ms
^C
--- server2.apps.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3505ms
rtt min/avg/max/mdev = 0.432/0.583/0.857/0.166 ms


From Sever2:

[oracle@server2 admin]$ ping server1
PING server1.apps.com (192.168.1.110) 56(84) bytes of data.
64 bytes from server1.apps.com (192.168.1.110): icmp_seq=1 ttl=64 time=0.331 ms
64 bytes from server1.apps.com (192.168.1.110): icmp_seq=2 ttl=64 time=0.702 ms
64 bytes from server1.apps.com (192.168.1.110): icmp_seq=3 ttl=64 time=0.768 ms
64 bytes from server1.apps.com (192.168.1.110): icmp_seq=4 ttl=64 time=0.786 ms
64 bytes from server1.apps.com (192.168.1.110): icmp_seq=5 ttl=64 time=0.896 ms
^C
--- server1.apps.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4023ms
rtt min/avg/max/mdev = 0.331/0.696/0.896/0.195 ms


We need to disable firewall setting(IP tables) if the servers are reachable each other. 

[root@server1 ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]

Note: We need to stop IP tables in both the servers.

Successfully able to do tnsping after disable firewall.

[oracle@server2 admin]$ tnsping gold

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 03-JUN-2018 21:42:29

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

Used parameter files:
/u01/app/oracle/product/12.1.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.110)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = GOLD.apps.com)))
OK (10 msec)




Thanks for your patience to view this post...........









No comments:

Post a Comment