在查看alert日志的时候发现:

  1. 1 ***********************************************************************
  2. 2
  3. 3 Fatal NI connect error 12170.
  4. 4
  5. 5 VERSION INFORMATION:
  6. 6 TNS for Linux: Version 11.2.0.1.0 - Production
  7. 7 Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production
  8. 8 TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production
  9. 9 Time: 27-DEC-2012 16:17:46
  10. 10 Tracing not turned on.
  11. 11 Tns error struct:
  12. 12 ns main err code: 12535
  13. 13
  14. 14 TNS-12535: TNS:operation timed out
  15. 15 ns secondary err code: 12560
  16. 16 nt main err code: 505
  17. 17
  18. 18 TNS-00505: Operation timed out
  19. 19 nt secondary err code: 110
  20. 20 nt OS err code: 0
  21. 21 Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=xxx.xxx.xxx.xxx)(PORT=xxxx))
  22. 22 Thu Dec 27 16:46:44 2012
  23. 23
  24. 24
  25. 25 ***********************************************************************

参考官方说明关于该警告的说明:

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)

解决问题:

其实这个参数跟监听的一个参数有关: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,即无限制。

具体操作例子:

  1. ----因为之前修改了很多次参数,一直没成功,这次就索性把监听给停掉了----------------
    1 [oracle@cnbpi admin]$ lsnrctl stop
  2. 2
  3. 3 LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 27-DEC-2012 22:40:24
  4. 4
  5. 5 Copyright (c) 1991, 2009, Oracle. All rights reserved.
  6. 6
  7. 7 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxx)(PORT=xxxx)))
  8. 8 The command completed successfully
  9. ----在sqlnet.ora文件中添加SQLNET.INBOUND_CONNECT_TIMEOUT = 0----------
    9 [oracle@cnbpi admin]$ vi sqlnet.ora
  10. 10 # sqlnet.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora
  11. 11 # Generated by Oracle configuration tools.
  12. 12
  13. 13 NAMES.DIRECTORY_PATH= (TNSNAMES)
  14. 14 SQLNET.INBOUND_CONNECT_TIMEOUT = 0
  15. 15
  16. ----在listener.ora文件添加INBOUND_CONNECT_TIMEOUT_listener=0------------
    16 [oracle@cnbpi admin]$ vi listener.ora
  17. 17
  18. 18 # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
  19. 19 # Generated by Oracle configuration tools.
  20. 20
  21. 21 LISTENER =
  22. 22 (DESCRIPTION_LIST =
  23. 23 (DESCRIPTION =
  24. 24 (ADDRESS = (PROTOCOL = TCP)(HOST = cnbpi)(PORT = xxxx))
  25. 25 # (CONNECT_TIMEOUT_LISTENER = 3600) -------该参数在测试中不起作用
  26. 26 )
  27. 27 )
  28. 28 INBOUND_CONNECT_TIMEOUT_listener=0
  29. 29
  30. 30 [oracle@cnbpi admin]$ lsnrctl
  31. 31
  32. 32 LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 27-DEC-2012 22:42:14
  33. 33
  34. 34 Copyright (c) 1991, 2009, Oracle. All rights reserved.
  35. 35
  36. 36 Welcome to LSNRCTL, type "help" for information.
  37. 37
  38. -----因为监听已经停止,所以查不出inbound_connect_timeout参数是否修改成功----------------
    38 LSNRCTL> show inbound_connect_timeout
  39. 39 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cnbpi)(PORT=1521)))
  40. 40 TNS-12541: TNS:no listener
  41. 41 TNS-12560: TNS:protocol adapter error
  42. 42 TNS-00511: No listener
  43. 43 Linux Error: 111: Connection refused
  44. 44 LSNRCTL> set inbound_connect_timeout 0
  45. 45 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cnbpi)(PORT=1521)))
  46. 46 TNS-12541: TNS:no listener
  47. 47 TNS-12560: TNS:protocol adapter error
  48. 48 TNS-00511: No listener
  49. 49 Linux Error: 111: Connection refused
  50. ----启动监听-----------------------------------
    50 LSNRCTL> start
  51. 51 Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
  52. 52
  53. 53 TNSLSNR for Linux: Version 11.2.0.1.0 - Production
  54. 54 System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
  55. 55 Log messages written to /u01/app/oracle/diag/tnslsnr/cnbpi/listener/alert/log.xml
  56. 56 Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cnbpi)(PORT=xxxx)))
  57. 57
  58. 58 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cnbpi)(PORT=xxxx)))
  59. 59 STATUS of the LISTENER
  60. 60 ------------------------
  61. 61 Alias LISTENER
  62. 62 Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
  63. 63 Start Date 27-DEC-2012 22:42:37
  64. 64 Uptime 0 days 0 hr. 0 min. 0 sec
  65. 65 Trace Level off
  66. 66 Security ON: Local OS Authentication
  67. 67 SNMP OFF
  68. 68 Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
  69. 69 Listener Log File /u01/app/oracle/diag/tnslsnr/cnbpi/listener/alert/log.xml
  70. 70 Listening Endpoints Summary...
  71. 71 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cnbpi)(PORT=xxxx)))
  72. 72 The listener supports no services
  73. 73 The command completed successfully
  74. ----查看inbound_connect_timeout参数已经修改成功,值为0-------------------
    74 LSNRCTL> show inbound_connect_timeout
  75. 75 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxx)(PORT=xxxx)))
  76. 76 LISTENER parameter "inbound_connect_timeout" set to 0
  77. 77 The command completed successfully
    -----因为之前在修改中可能是参数设置不对,所以一直没成功,所以用了这种最笨的方法使监听停掉以后再修改,其实只需修改了参数以后再reload一下就可以了。

参考文档:

http://www.cnblogs.com/diyunpeng/archive/2010/11/12.html

http://wenku.baidu.com/view/190df4aad1f34693daef3ee6.html

TNS-12535: TNS:operation timed out、TNS-00505: Operation timed out的更多相关文章

  1. ssh启动报错:org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect

    ssh项目启动报错: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection t ...

  2. ORA-12546: TNS: 权限被拒绝(ORA - 12546 TNS: Permission Denied)

    这个问题上网一查大都是说权限之类的问题,本人在经过第二次折腾之后发现,其实是自己的Oracle客户端工具在破解过程中被自己用防火墙禁止访问网络了,自己还在另一篇博文里记录过,竟然忘光了,BS一下自己! ...

  3. 一组相关联的问题:“sudo: unable to resolve host ###: Connection timed out”、软件启动速度超慢、IPv6无法使用

    造冰箱的大熊猫@cnblogs 2018/9/15 近日陆续发现计算机出现几个问题,最终发现这些问题实际上是由同一个原因导致的 问题1:无法使用IPv6 问题2:无论是启动Emacs GUI还是在命令 ...

  4. 连接超时(connect timed out)和读取超时(Read timed out)

    设置连接超时和读取超时方法: RequestConfig config=RequestConfig.custom() .setConnectTimeout(10000) // 设置连接超时时间 10秒 ...

  5. JSON方式提交文档时SOLR报:AtomicUpdateDocumentMerger Unknown operation for the an atomic update, operation ignored

    文档是数组转成的json 原数组: array( 0 =>3, 1 =>3, 2 =>4, 3 =>5, 4 =>5, 5 =>6) 用array_unique去掉 ...

  6. 客户端ARPG角色行为模型

    [概述] 对于玩家自身而言, 场景中的角色分两种:自己,别的生物(包括别的玩家,monster, npc等).而生物本身是一个集合{属性数据(状态), 行为(动作表现)}. 站在玩家自身的角度来看, ...

  7. TNS-12535: TNS:operation timed out案例解析

    一数据库突然连接不上,在自己电脑上使用SQL Developer也连接不上.立即使用SecureCRT连接上了这台服务器,从下面几个方面检查. 1:检查了数据库的状态是否正常 $ sqlplus / ...

  8. oracle 11G创建表空间、用户、配置监听和TNS

    最近总在安装各种版本的oralce数据库做测试,11G,32位的,64位的,12C的,每次都折腾表空间,用户.tns啥的,这里记录下,再也不用现用现百度找了 一.创建表空间.用户  在plsql工具中 ...

  9. TNS-12502: TNS:listener received no CONNECT_DATA from client

    检查我们的一台ORACLE数据库的监听日志发现有不少TNS-12502错误信息.如下所示 TNS-12502: TNS:listener received no CONNECT_DATA from c ...

随机推荐

  1. append 注意事项

    >>> t1 = [, ] >>> t2 = t1.append() >>> t1 [, , ] >>> t2 None

  2. PHP自定义XML类实现数组到XML文件的转换

    这两天在公司写和各应用商店应用内搜索的接口,大致就像百度应用内搜索这样的东西,具体可以点下面的链接查看. 百度应用内搜索 有的应用商店需要JSON格式的数据,所以我只需要用下面的语句就可以返回对方服务 ...

  3. JAVA消息 JMS 很重要

    首先大致讲一下,java 消息模块 消息,个人理解分为两种:1.同步消息(RPC调用) 2.异步消息(本篇讲解部分) 一.同步消息java提供了多种方案: 最新比较常用的方式就是spring Http ...

  4. Android之第三方平台实现QQ登录和QQ分享

    目前大多数APP都包含了第三方平台的登录,特别是QQ和微信,这篇博客主要讲的是如何实现QQ第三方平台实现QQ登录和分享功能,功能包含: 登录授权登录获取用户信息(昵称,头像,地址等) QQ分享给好友 ...

  5. UVA-140 Bandwidth (回溯+剪枝)

    题目大意:求一个使带宽最小的排列和最小带宽.带宽是指一个字母到其相邻字母的距离最大值. 题目分析:在递归生成全排列的过程中剪枝,剪枝方案还是两个.一.当前解不如最优解优时,减去:二.预测的理想解不必最 ...

  6. div固定顶部和底部

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. javascript垃圾收集

    javascript具有自动垃圾收集机制,也就是说,执行环境会负责管理代码执行过程中使用的内存.而在C和C++之类的语言中,开发人员的一项基本任务就是手工跟踪内存的使用情况 ,这是造成许多问题的一个根 ...

  8. Hello World模式

    http://www.rabbitmq.com/getstarted.html https://github.com/rabbitmq/rabbitmq-tutorials 环境搭建 这里使用grad ...

  9. elasticsearch搜索引擎学习1

    用elasticsearch-river-jdbc同步数据到elasticsearch 用elasticsearch-river-jdbc同步数据到elasticsearch 1 插件安装  插件的g ...

  10. (转)RESTful API 设计最佳实践

    原文:http://www.oschina.net/translate/best-practices-for-a-pragmatic-restful-api 数据模型已经稳定,接下来你可能需要为web ...