oracle 可能是什么问题:ping 工作正常,但 tnsping 间歇性工作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/570840/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What could be wrong: ping works fine but tnsping works intermittently
提问by George Mauer
We have oracle 10g running on windows server 2003. A machine which runs an application using that database has as of a few weeks ago suddenly started having connectivity problems. Today we ran the automatic updates for windows server and the problem has only gotten worse. I realize this isn't enough information for anyone to diagnose the problem but perhaps you can get me pointed in the right direction with the following more specific scenario:
我们在 windows server 2003 上运行了 oracle 10g。几周前,一台运行使用该数据库的应用程序的机器突然开始出现连接问题。今天我们运行了 windows server 的自动更新,问题变得更糟了。我意识到这对于任何人来说都不足以诊断问题,但也许您可以通过以下更具体的场景让我指出正确的方向:
From this machine we can ping the server with absolutely no problem and, being physically close and on an intranet the return is very fast.
从这台机器上,我们可以毫无问题地 ping 服务器,而且由于物理上很近并且在内部网上,返回速度非常快。
However, when we run tnsping I have seen 3 different results within a few minutes of each other.
但是,当我们运行 tnsping 时,我在几分钟内看到了 3 个不同的结果。
- tnsping returns just fine and in a reasonable amount of time
- tnsping returns but only after a real long time (several seconds)
- tnsping results in an ora-12560 protocol adapter error
- tnsping 在合理的时间内返回得很好
- tnsping 返回但仅在很长时间(几秒钟)之后
- tnsping 导致 ora-12560 协议适配器错误
At the same time I can tnsping the server from my machine with no problem.
同时,我可以毫无问题地从我的机器 tnsping 服务器。
Can anyone point me in the right direction?
任何人都可以指出我正确的方向吗?
回答by DCookie
To help eliminate DNS issues from the equation, specify the host's IP address in the TNSNAMES.ora file for your connection instead of a hostname. Are you using DHCP?
为了帮助消除等式中的 DNS 问题,请在 TNSNAMES.ora 文件中为您的连接指定主机的 IP 地址,而不是主机名。你在使用 DHCP 吗?
Have you eliminated hardware as the problem - have you tried a different NIC?
您是否已排除硬件问题?您是否尝试过不同的 NIC?
回答by Jens Schauder
I'd try to check the following:
我会尝试检查以下内容:
- do traceroute from the app server and from your machine check for anything abnormal
- check tnsping from various other machine and try to identify a pattern
- try a tcp/ip sniffer to see what is going on at both ends of the connection
- get oracle support involved
- 从应用程序服务器和您的机器上执行 traceroute 检查是否有任何异常
- 检查来自其他各种机器的 tnsping 并尝试识别模式
- 尝试使用 tcp/ip 嗅探器查看连接两端的情况
- 获得 Oracle 支持
回答by Jens Schauder
Before calling Oracle, I would create a trace file for a Fail case.
在调用 Oracle 之前,我将为失败案例创建一个跟踪文件。
TNSPING.TRACE_LEVEL
TNSPING.TRACE_LEVEL
Purpose
目的
Use the parameter TNSPING.TRACE_LEVEL to turn TNSPING utility tracing on, at a specific level, or off.
使用参数 TNSPING.TRACE_LEVEL 在特定级别打开或关闭 TNSPING 实用程序跟踪。
Default
默认
off
离开
Values * off: for no trace output * user: for user trace information * admin: for administration trace information * support: for Oracle Support Services trace information
值 * off:用于无跟踪输出 * user:用于用户跟踪信息 * admin:用于管理跟踪信息 * support:用于 Oracle 支持服务跟踪信息
Example
例子
TNSPING.TRACE_LEVEL=admin
TNSPING.TRACE_LEVEL=管理员
回答by MichaelN
Before involving oracle in this issue, get some help from your network administrator for the following test. First enable verbose logging on the database in the listener. Enable logging on the client via sqlnet. Go to the machine that is having trouble with tnsping, have the network administrator run a network tool to trace tcp packets from there. Perform the tnsping and see if what packet are being sent, what dns lookup are being made, what route is being taken. On the database see if the listener actually receives a ping from the client. If not then see where along the network to the database the problem is. Is it nameserver resolution? Is it a bad network cable, bad switch port, etc. Your network admin is your best friend for this problem. Do the same test via sqlplus with a simple connection and see what the client is logging.
在这个问题涉及oracle之前,请向您的网络管理员寻求帮助以进行以下测试。首先在侦听器中的数据库上启用详细日志记录。通过 sqlnet 在客户端上启用日志记录。转到有 tnsping 问题的机器,让网络管理员运行网络工具从那里跟踪 tcp 数据包。执行 tnsping 并查看是否正在发送什么数据包,正在进行什么 dns 查找,正在采用什么路由。在数据库上查看侦听器是否实际收到来自客户端的 ping。如果不是,则查看沿网络到数据库的哪个位置出现问题。它是名称服务器解析吗?是不是网线坏了,交换机端口坏了等等。你的网络管理员是解决这个问题的最好的朋友。使用简单的连接通过 sqlplus 执行相同的测试,并查看客户端正在记录的内容。
回答by Roqetman
If the server doesn't have a domain-name setup at a dns server, then add it's ip address and name to the host file on the server; this (the server not being able to find itself in dns) has been known to cause tns timeouts.
如果服务器没有在dns服务器上设置域名,则将其ip地址和名称添加到服务器上的主机文件中;众所周知,这(服务器无法在 dns 中找到自己)会导致 tns 超时。
回答by kmkaplan
Make sure there is no other machine on the network with the same IP address. A method would be unplug your machine from the network and see if you can still ping it. If you can then this is the problem.
确保网络上没有其他机器具有相同的 IP 地址。一种方法是将您的机器从网络上拔下,看看您是否仍然可以ping通它。如果可以,那么这就是问题所在。