My Oracle Support Banner

TNSPING From a Remote Client Fails with TNS-12543: TNS:Destination Host Unreachable (Doc ID 1556918.1)

Last updated on MAY 21, 2019

Applies to:

Oracle Net Services - Version 11.2.0.3 to 19.3.0.0.0 [Release 11.2 to 18]
Information in this document applies to any platform.

Symptoms

Attempting to TNSPING or connect to a remote Listener or DB Server,
the following error occurs.

TNS-12543: TNS:destination host unreachable

Example:
TNSPING MY_TNS_ALIAS

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 24-MAY-2019 15:47:42
Copyright (c) 1997, 2011, Oracle.  All rights reserved.
Used parameter files:


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

The tnsnames.ora file is correctly configured.
The following test using TNSPING might also fail with the same error:

TNSPING "(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1521))"
TNS-12543: TNS:destination host unreachable

ping xx.xx.xx.xx
PING xx.xx.xx.xx (xx.xx.xx.xx) 56(84) bytes of data.
64 bytes from xx.xx.xx.xx: icmp_seq=1 ttl=63 time=0.671 ms

Strace shows that the tnsping failed with below errors

strace -o a.txt tnsping orcl

$cat a.txt

........

getsockopt(4, SOL_SOCKET, SO_SNDBUF, 0x7fff2b16c0fc, 0x7fff2b16c0f8) = -1 EBADF (Bad file descriptor)
getsockopt(4, SOL_SOCKET, SO_RCVBUF, 0x7fff2b16c0fc, 0x7fff2b16c0f8) = -1 EBADF (Bad file descriptor)
lseek(3, 39936, SEEK_SET)               = 39936
read(3, "\r\0\3650\0\0V\0\3660\0\0t\0\3670\0\0\217\0\3700\0\0\246\0\3710\0\0\277\0"..., 512) = 512
write(1, "TNS-12543: TNS:destination host "..., 44) = 44

 

It is likely that a telnet to the same HOST and PORT would hang:


# telnet your_host 1521
Trying...
^C#

Using the same tests with TNSPING on the database server will likely succeed:

tnsping MY_TNS_ALIAS

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 27-MAY-2013 15:21:06

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

Used parameter files:
/home/11.2.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = MY_SERVICE)))
OK (0 msec)

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.