关于TNS-12543: TNS:destination host unreachable的案例

今天在给几个库做映射的时候,用tnsping,有一个库老是有问题,在客户端配置
tnsping NFTTEST
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.19.198.51)(PORT = 1563))) (CONNECT_DATA = (SERVICE_NAME = NFTTEST)))
TNS-12543: TNS:destination host unreachable

但是能够Ping通
> ping 172.19.198.51
PING 172.19.198.51 (172.19.198.51) 56(84) bytes of data.
64 bytes from 172.19.198.51: icmp_seq=1 ttl=64 time=0.582 ms
64 bytes from 172.19.198.51: icmp_seq=2 ttl=64 time=0.429 ms
..
--- 172.19.198.51 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
...

尝试直连接,还是报了同样的错误。
>  sqlplus n1/n1@172.19.198.51:1563/NFTTEST

SQL*Plus: Release 11.2.0.2.0 Production on Tue Apr 8 13:54:23 2014

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

ERROR:
ORA-12543: TNS:destination host unreachable

初步怀疑是tnsnames.ora里面的配置信息有问题,可能有格式化之类的问题。
然后重新coyp,改成主机名。把NFTTEST编辑成一行,怎么试都是不行。

然后我在服务器端尝试,竟然一点问题都没有,正常的登录,listener也是正常的。

我比较了服务端,客户端的 /etc/hosts里面的Ip配置,都是一样的。

在服务端重启了listener,再次尝试,没有问题,但是在客户端还是有问题。
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.19.198.51)(PORT=1563)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1563)))
Services Summary...
Service "NFTTEST" has 1 instance(s).
  Instance "NFTTEST", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

> tnsping NFTTEST

TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 08-APR-2014 10:27:45

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

Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dbusgsnft4)(PORT = 1563))) (CONNECT_DATA = (SERVICE_NAME = NFTTEST)))
OK (0 msec)
然后在服务端用sqlplus连接都是没有问题的。客户端还是不行。

为了查看更详细的信息,在服务器端尝试一下strace.
munmap(0x2b57e9832000, 4096)            = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
fcntl(4, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
connect(4, {sa_family=AF_INET, sin_port=htons(1563), sin_addr=inet_addr("172.19.198.51")}, 16) = -1 E INPROGRESS (Operation now in progress)
times({tms_utime=0, tms_stime=1, tms_cutime=0, tms_cstime=0}) = 2174636906
mmap(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b57e9a62000
poll([{fd=4, events=POLLOUT}], 1, 60000) = 1 ([{fd=4, revents=POLLOUT}])
getsockopt(4, SOL_SOCKET, SO_ERROR, [519270883345301504], [4]) = 0
fcntl(4, F_GETFL)                       = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl(4, F_SETFL, O_RDWR)               = 0
getsockname(4, {sa_family=AF_INET, sin_port=htons(31292), sin_addr=inet_addr("172.19.198.51")}, [549755813904]) = 0
getsockopt(4, SOL_SOCKET, SO_SNDBUF, [8458000068614604252], [4]) = 0
getsockopt(4, SOL_SOCKET, SO_RCVBUF, [8458000068614641056], [4]) = 0
setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
rt_sigaction(SIGPIPE, {0x1, ~[ILL ABRT BUS FPE SEGV USR2 XCPU XFSZ SYS RTMIN RT_1], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x325400ebe0}, {SIG_DFL, [], 0}, 8) = 0
write(4, "\0W\0\0\1\0\0\0\1:\1,\0\0 \0\377\377\177\10\0\0\1\0\0\35\0:\0\0\0\0"..., 87) = 87
read(4, "\0I\0\0\4\0\0\0\"\0\0=(DESCRIPTION=(TMP=)("..., 8208) = 73
setsockopt(4, SOL_SOCKET, SO_SNDTIMEO, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
setsockopt(4, SOL_SOCKET, SO_RCVTIMEO, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
close(4)                                = 0
lseek(3, 27136, SEEK_SET)               = 27136
read(3, "\16\0\335\t\0\0\\\0\336\t\0\0\214\0\255\r\0\0\270\0\256\r\0\0\272\0\257\r\0\0\366\0"..., 512) = 512
write(1, "OK (10 msec)\n", 13)          = 13
munmap(0x2b57e9790000, 135168)          = 0
munmap(0x2b57e976f000, 135168)          = 0
munmap(0x2b57e974e000, 135168)          = 0
munmap(0x2b57e972d000, 135168)          = 0
munmap(0x2b57e97b1000, 528384)          = 0
munmap(0x2b57e9a62000, 528384)          = 0
munmap(0x2b57e9622000, 1090528)         = 0
close(3)                                = 0
exit_group(0)                           = ?

然后在客户端试一下
connect(4, {sa_family=AF_INET, sin_port=htons(1563), sin_addr=inet_addr("172.19.198.51")}, 16) = -1 EINPROGRESS (Operation now in progress)
times({tms_utime=0, tms_stime=1, tms_cutime=0, tms_cstime=0}) = 1799838785
mmap(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b3e1ce2e000
poll([{fd=4, events=POLLOUT}], 1, 60000) = 1 ([{fd=4, revents=POLLERR|POLLHUP}])
getsockopt(4, SOL_SOCKET, SO_ERROR, [519270883345301617], [4]) = 0
close(4)                                = 0
getsockopt(4, SOL_SOCKET, SO_SNDBUF, 0x7fff4451cd1c, 0x7fff4451cd18) = -1 EBADF (Bad file descriptor)
getsockopt(4, SOL_SOCKET, SO_RCVBUF, 0x7fff4451cd1c, 0x7fff4451cd18) = -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
munmap(0x2b3e1cb5d000, 135168)          = 0
munmap(0x2b3e1cb3c000, 135168)          = 0
munmap(0x2b3e1cb1b000, 135168)          = 0
munmap(0x2b3e1cafa000, 135168)          = 0
munmap(0x2b3e1cb7e000, 528384)          = 0
munmap(0x2b3e1ce2e000, 528384)          = 0
munmap(0x2b3e1c9ef000, 1090528)         = 0
close(3)                                = 0
exit_group(1)                           = ?

这样一来问题看似比较明显了,很可能是防火墙或者是其他的网络设置的问题,
发给客户的时候,客户还让我反复验证一下是不是tnsnames.ora。sqlnet.ora的问题,最后还是然他们再检查一下,结果还真有问题,防火墙对于那个端口有限制,重新分配了一下,问题就解决了。

当然,对于这个问题,MOS上有一篇相关的文档说明,可以参考一下。
(Doc ID 1556918.1)

时间: 2024-10-24 16:51:54

关于TNS-12543: TNS:destination host unreachable的案例的相关文章

【MOS】TNSPING TNS-12543: TNS:destination host unreachable (文档 ID 1556918.1)

In this Document Symptoms Cause Solution APPLIES TO: Oracle Net Services - Version 11.2.0.3 and laterInformation in this document applies to any platform. SYMPTOMS When attempting to tnsping a remote server,  the following error occurs. ERROR -------

icmp的报文,Destination Host Unreachable

icmp的报文,Destination Host Unreachable的意思如下: http://www.corenetworkz.com/2009/05/destination-host-unreachable-reason-and.html   The error message "Destination Host Unreachable " tells that the ping request from our computer cannot find the route t

destination host unreachable 问题解决

ping www.baidu.com 出现:destination host unreachable 使用:arp -a 查看网关的mac地址是否正常解析             services.msc  进入服务控制板 找到 IPsec Internet 协议安全(IPSec)支持网络级别的对等身份验证.数据原始身份验证.数据完整性.数据机密性(加密)以及重播保护.此服务强制执行通过 IP 安全策略管理单元或命令行工具 "netsh ipsec" 创建的 IPSec 策略.停止此服

tcp/ip-ubuntu ping虚拟机中的centos显示host unreachable

问题描述 ubuntu ping虚拟机中的centos显示host unreachable 宿主机ubuntu用wifi上网,给eth0设置ip为10.12.70.1,子网掩码为255.255.255.0.虚拟机centos的eth2为桥接模式,ip为10.12.70.2,netmask为255.255.255.0.不论从哪边ping另一边,都是显示host unreachable 解决方案 虚拟网卡状态有没有启动 解决方案二: http://my.oschina.net/kevinvane/b

TNS - 12516 TNS : 解决

报错 TNS - 12516 TNS : listener could not find instance with matching protocol stack   根据官方的文档说是processes和sessions参数设置的问题.已经达到了最大值.索引监听拒绝连接,这个时候监听例程是blocked的,确实如此如下: 服务 "libaodb" 包含 1 个例程.   例程 "libaodb", 状态 READY, 包含此服务的 1 个处理程序...    

What is SCAN in Oracle 11g R2 RAC

What is SCAN in Oracle 11g R2 RAC Single client access name (SCAN) is meant to facilitate single name for all Oracle clients to connect to the cluster database, irrespective of number of nodes and node location. Until now, we have to keep adding mult

记一次离奇的TNS-12545 TNS-12560 TNS-00515

      最近reportDB监听无法随系统自启动,现象比较怪异.因为该服务器上的另一个实例的监听可以正常启动,这个不能自启动实例的监听手动启动又是正常的.因此记下这次离奇暂未找到原因的故障.   1.故障现象 Starting CRON daemondone Oracle 10g auto start/stop Startup "USMTHLY" listener. LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 08-J

DNS 引起经典RAC故障

DNS 引起经典RAC故障 作者:吴伟龙(PrudentWoo) 一.环境介绍: 这是一套四年前部署的RAC系统,之前运行一直很好,没有出过问题,平时基本处于无人管的状态. OS:Redhat EnterPrise Linux 5.8x86_x64 DB:Oracle DatabaseEnterPrise  11.2.0.4 GI:Oracle Grid Infrastructure11.2.0.4 二.问题描述:          昨天临近下班接到现场人员故障请求,描述为数据库无法连接,报OR

使用 SQLNET.EXPIRE_TIME 清除僵死连接

    数据库连接的客户端异常断开后,其占有的相应并没有被释放,如从v$session视图中依旧可以看到对应的session处于inactive,且对应的服务器进程也没有释放,导致资源长时间地被占用,对于这种情形开该如何处理呢?SQLNET.EXPIRE_TIME对于这个问题我们提供了解决方案,专门用于清理那些异常断开的情形,如网络异常中断,客户端异常掉电,异常重启等.本文描述了设置SQLNET.EXPIRE_TIME参数以及演示死连接以及资源被释放的情形.   1.理解SQLNET.EXPIR