TNS-12535: TNS:operation timed out、TNS-00505: Operation timed out
参考:http://www.cnblogs.com/Richardzhu/articles/2836466.html
ALERT LOG 示例如下
***********************************************************************
Fatal NI connect error 12170.
VERSION INFORMATION:
TNS for Linux: Version 11.2.0.4.0 - Production
Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production
Time: 03-DEC-2017 22:37:05
Tracing not turned on.
Tns error struct:
ns main err code: 12535
TNS-12535: TNS:operation timed out
ns secondary err code: 12606
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.0.2.1)(PORT=63781))
WARNING: inbound connection timed out (ORA-3136)
***********************************************************************
参考官方说明关于该警告的说明:
Note:465043.1
The "WARING:inbound connection timed out (ORA-3136)" in the alert log indicates that the client was not able to complete it's authentication within the period of time specified by parameter SQLNET.INBOUND_CONNECT_TIMEOUT.
You may also witness ORA-12170 without timeout error on the database sqlnet.log file.This entry would also have the client address which failed to get authenticated.Some applications or JDBC thin driver applications may not have these details.
可能的原因:
1、网络攻击,例如:半开连接攻击
Server gets a connection request from a malcious client which is not supposed to connect to the database,in which case the error thrown is the correct behavior.You can get the client address for which the error was thrown via sqlnet log file.
2、Client在default 60秒内没有完成认证
The server receives a valid client connection request but the client tabkes a long time to authenticate more than the default 60 seconds.
3、DB负载太高
The DB server is heavily loaded due to which it cannot finish the client logon within the timeout specified.
WANGING:inbound connection timed out (ORA-3136)
解决办法:
a.验证db server端,本地连接是否成功(listener是否可用)
b.验证本地连接是否延迟(本地网络是否高效可用)
c.验证数据库性能(db server是否高负载)
d.告警日志是否在之前报过ORA-600或ORA-7445
e.检查是否有client反复尝试登录密码(这是目前最有可能的原因)
f.关闭此功能(将2参数设置为0,设置方法参照步骤5)也可将2参数设置为适当值。
修改参数办法:
其实这个参数跟监听的一个参数有关:SQLNET.INBOUND_CONNECT_TIMEOUT
这个参数从9i开始引入,指定了客户端连接服务器并且提供认证信息的超时时间,如果超过这个时间客户端没有提供正确的认证信息,服务器会自动中止连接请求,同时会记录试图连接的IP地址和ORA-12170:TNS:Connect timeout occurred错误。
这个参数的引入,主要是防止DoS攻击,恶意攻击者可以通过不停的开启大量连接请求,占用服务器的连接资源,使得服务器无法提供有效服务。在10.2.0.1起,该参数默认设置为60秒。
但是,这个参数的引入也导致了一些相关的Bug。比如:
Bug 5594769 - REMOTE SESSION DROPPED WHEN LOCAL SESSION SHARED AND INBOUND_CONNECT_TIMEOUT SET
Bug 5249163 - CONNECTS REFUSED BY TNSLSNR EVERY 49 DAYS FOR INBOUND_CONNEC_TIMEOUT SECONDS
该参数可以通过设置为0来禁用,在服务端:
1)、设置sqlnet.ora文件:SQLNET.INBOUND_CONNECT_TIMEOUT=0;
2)、设置listener.ora文件:INBOUND_CONNECT_TIMEOUT_listenername=0;
3)、然后reload或者重启监听。
说明:这是由于连接超时所产生的问题,在10.2.0.1.0版本中sqlnet.inbound_connect_timeout参数默认为60秒,即如果连接时间超过60秒则提示超时,而在其他版本中这两个参数默认为0,即无限制。
在sqlnet.ora和listener.ora中添加内容后,reload listener即可;
----查看inbound_connect_timeout参数已经修改成功,值为0-------------------
LSNRCTL> show inbound_connect_timeout
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29519108/viewspace-2148223/
,如需转载,请注明出处,否则将追究法律责任。