关于ORA-12543: TNS:destination host unreachable的案例(37天)

今天在给几个库做映射的时候,用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)

原文发布于微信公众号 - 杨建荣的学习笔记(jianrong-notes)

原文发表时间:2014-04-09

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏zaking's

RFC2616-HTTP1.1-Methods(方法规定部分—单词注释版)

1105
来自专栏xingoo, 一个梦想做发明家的程序员

MFC 随机矩形

问题描述:   简单地使用随即的尺寸和颜色不停的绘制一系列的图像。 一种古老的方式:   设置一个向窗口函数发送WM_TIMER消息的windows计时器。  ...

1885
来自专栏Petrichor的专栏

tree指令

1102
来自专栏智能计算时代

Microservices Ecosystem Transit Map

…we assembled a map of the ecosystem to help guide practitioners, vendors, inves...

3314
来自专栏黑白安全

来做个Google Hack吗?

storemanager/contents/item.php?page_code=

1005
来自专栏杨建荣的学习笔记

listener.ora,tnsnames.ora中一个空格的威力

最近几天被网络监听配置搞得焦头烂额,有时候配置没问题,有时候就出莫名其妙的问题,今天专门花时间总结了一下,希望对大家有所帮助。 listener.ora,tns...

3609
来自专栏Golang语言社区

Golang生产级可靠UDP库

kcp-go is a Production-Grade Reliable-UDP library for golang.

2582
来自专栏高性能服务器开发

(三) 服务器端的程序架构介绍2

下面我们以pc端登录为例来具体看一个数据包在服务器端各个服务之间走过的流程: 步骤1:login_server初始化侦听socket,设置新连接到来的回调函数。...

3744
来自专栏码匠的流水账

聊聊lettuce的指标监控

lettuce-core-5.0.4.RELEASE-sources.jar!/io/lettuce/core/event/metrics/DefaultCom...

1412
来自专栏Alan's Lab

[From Nand to Tetris] 第8章 虚拟机项目 python 实现

为防闲逛至此的看官不知所云: From Nand to Tetris 是一个在线课程,目标是指导学生从 Nand 逻辑门开始从头到尾完成一整套计算机系统。

462

扫码关注云+社区