ORA-3136 timeout 解决之道

本文介绍了解决Oracle数据库中ORA-3136及TNS-12535错误的方法,包括调整listener.ora文件中的inbound_connect_timeout参数和sqlnet.ora文件中的SQLNET.INBOUND_CONNECT_TIMEOUT设置。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WARNING: inbound connection timed out (ORA-3136)
    nt OS err code: 0
    nt main err code: 0
WARNING: inbound connection timed out (ORA-3136)
WARNING: inbound connection timed out (ORA-3136)WARNING: inbound connection timed out (ORA-3136)
  Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.101.xx)(PORT=60776))
    nt secondary err code: 0
WARNING: inbound connection timed out (ORA-3136)
    nt OS err code: 0
TNS-12535: TNS:operation timed out
TNS-12535: TNS:operation timed out
  Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.101.xx)(PORT=60755))
TNS-12535: TNS:operation timed out
TNS-12535: TNS:operation timed out
TNS-12535: TNS:operation timed out
TNS-12535: TNS:operation timed out
    ns secondary err code: 12606
    ns secondary err code: 12606
WARNING: inbound connection timed out (ORA-3136)
    ns secondary err code: 12606
    ns secondary err code: 12606
    ns secondary err code: 12606
    ns secondary err code: 12606

Tue Jul 18 23:09:22 2006
WARNING: inbound connection timed out (ORA-3136)
Tue Jul 18 23:09:23 2006
WARNING: inbound connection timed out (ORA-3136)
Tue Jul 18 23:09:25 2006
WARNING: inbound connection timed out (ORA-3136)
Tue Jul 18 23:09:30 2006
WARNING: inbound connection timed out (ORA-3136)
Tue Jul 18 23:12:15 2006
WARNING: inbound connection timed out (ORA-3136)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

这是和网络连接相关的一个错误,Metalink上给出了如下的解决方案:

1.set INBOUND_CONNECT_TIMEOUT_<listenername>=0 in listener.ora
2. set SQLNET.INBOUND_CONNECT_TIMEOUT = 0 in sqlnet.ora of server.
3. stop and start both listener and database.
4. Now try to connect to DB and observe the behaviour

详细的解决:

修改listener的inbound_connect_timeout参数的方法
方法一:
[bglbj1][oracle][/home/oracle]>lsnrctl
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 01-SEP-2009 16:28:06
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:
start              stop               status            
services           version            reload            
save_config        trace              spawn             
change_password    quit               exit              
set*               show*             
LSNRCTL> show
The following operations are available after show
An asterisk (*) denotes a modifier or extended command:
rawmode                    displaymode               
rules                      trc_file                  
trc_directory              trc_level                 
log_file                   log_directory             
log_status                 current_listener          
inbound_connect_timeout    startup_waittime          
snmp_visible               save_config_on_stop       
dynamic_registration      
LSNRCTL> set
The following operations are available after set
An asterisk (*) denotes a modifier or extended command:
password                   rawmode                   
displaymode                trc_file                  
trc_directory              trc_level                 
log_file                   log_directory             
log_status                 current_listener          
inbound_connect_timeout    startup_waittime          
save_config_on_stop        dynamic_registration      
LSNRCTL>
LSNRCTL> show inbound_connect_timeout
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
LISTENER parameter "inbound_connect_timeout" set to 60
The command completed successfully

LSNRCTL> set inbound_connect_timeout 0
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
LISTENER parameter "inbound_connect_timeout" set to 0
The command completed successfully

LSNRCTL> show inbound_connect_timeout
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
LISTENER parameter "inbound_connect_timeout" set to 0
The command completed successfully

LSNRCTL> set save_config_on_stop on  #表示修改参数永久生效,否则只是临时生效,下次重启监听又还原为原来的值了
LSNRCTL> exit

方法二:
修改listener.ora文件,加入: INBOUND_CONNECT_TIMEOUT_LISTENER_NAME=0
问题解决

修改后依然是启动不了数据库,但在依然启动不了数据库连sqlplus环境都进不去,我查看来最新一个udump 下的

trc文件,其中有Dumping diagnostic information for LCK0:
OS pid = 422264
loadavg : 0.23 0.25 0.26
swap info: free_mem = 17.67M rsv = 128.00M
           alloc = 12067.13M avail = 32768.00M swap_free = 20700.87M
       F S      UID    PID   PPID   C PRI NI ADDR    SZ    WCHAN    STIME    TTY  TIME CMD
  240001 A   oracle 422264      1   0  60 20 a0b36400 106964            Feb 10      -  1:47 ora_lck0_rzywk2
open: The file access permissions do not allow the specified action.
Warning: executed in non-root mode
procstack cannot verify that /unix matches the running kernel.
Kernel symbols might not be validated.
422264: ora_lck0_rzywk2
0x00000001000fc898  sskgpwwait(??, ??, ??, ??, ??) + 0x38
0x00000001000f9e7c  skgpwwait(??, ??, ??, ??, ??) + 0xbc
0x000000010011e42c  kslges(??, ??, ??, ??, ??) + 0x54c
0x000000010012225c  kslgetl(??, ??, ??, ??) + 0x33c
0x00000001049f0998  ksfglt(??, ??, ??, ??, ??) + 0x198
0x00000001045d1b84  kqlmbfre() + 0x144
0x00000001045d61c4  kqlmba(??, ??) + 0x24
0x000000010015efa8  ksbcti(??, ??, ??) + 0x3c8
0x0000000100169f1c  ksbabs(??) + 0x3fc
0x00000001019b5e18  kclabs(??) + 0xd8
0x0000000100166dd4  ksbrdp() + 0x4b4
0x000000010430c93c  opirip(??, ??, ??) + 0x3fc
0x0000000102d9ae38  opidrv(??, ??, ??) + 0x458
0x000000010370b950  sou2o(??, ??, ??, ??) + 0x90
0x0000000100000870  opimai_real(??, ??) + 0x150
0x00000001000006d8  main(??, ??) + 0x98
0x0000000100000368  __start() + 0x98
*** 2011-02-12 05:20:09.050
*** 2011-02-12 05:20:19.051
Waited for detached process: LCK0 for 310 seconds:
*** 2011-02-12 05:20:19.051
Dumping diagnostic information for LCK0:
OS pid = 422264
loadavg : 0.36 0.27 0.27
swap info: free_mem = 32.64M rsv = 128.00M
           alloc = 12072.14M avail = 32768.00M swap_free = 20695.86M
       F S      UID    PID   PPID   C PRI NI ADDR    SZ    WCHAN    STIME    TTY  TIME CMD
  240001 A   oracle 422264      1   0  60 20 a0b36400 106964            Feb 10      -  1:47 ora_lck0_rzywk2
open: The file access permissions do not allow the specified action.
Warning: executed in non-root mode
procstack cannot verify that /unix matches the running kernel.
Kernel symbols might not be validated.

<think> 嗯,用户这次是专门来查询ORA-3136错误的解决方案啊。从ta引用的四份材料来看,应该是个Oracle DBA或者运维人员,正在处理生产环境中的连接超时问题。用户特意强调了“不是真正需求”,说明ta需要的是经过整合的、可直接操作的解决方案。 翻看之前对话历史,系统要求用$...$格式标注数学公式,不过这次问题纯粹是Oracle错误代码解析,基本用不到数学符号。倒是要注意把引用标记[^n]自然地融入解答中。 用户引用的四份材料很有价值: 1)Metalink指出三大主因:恶意连接、认证超时、服务器过载 2)补充说明要检查本地连接和网络延迟 3)提到客户端会收到不同错误代码 4)虽然提到ORA-445但和当前问题关联不大 用户可能真正着急的是:生产环境正在不断报错,需要立刻止损。所以要把解决方案按优先级排序: - 先给临时解决措施(调整超时参数) - 再给根本解决路径(性能分析) - 最后给出诊断工具链(日志检查顺序) 特别注意引用[2]提到的排查链条:本地连接→网络延迟→数据库性能→关键错误。这个思路要整合到解决方案里,形成递进式排查步骤。另外客户端错误代码(ORA-12547/12637)的对应关系也要说明,用户可能在排查时遇到。 最后考虑用户可能需要预防措施,补充监控建议。不过引用里没提RAC环境,这点暂时保留。如果用户后续追问再展开为好。 </think> 基于引用内容,ORA-3136错误("WARNING: inbound connection timed out")主要发生在客户端连接数据库时认证超时。以下是原因分析与解决方案整理: --- ### **错误原因** 1. **恶意连接攻击** 非授权客户端尝试连接数据库,服务器主动终止连接[^1]。 2. **认证过程超时** - 默认认证超时时间为 **60秒** - 可能原因: - 网络延迟过高(如跨地域连接)[^2] - 客户端身份验证信息复杂(如LDAP集成) - 数据库性能严重下降(CPU/IO资源耗尽)[^1][^2] 3. **数据库服务器高负载** - 资源竞争导致无法及时处理连接请求 - 常见诱因: - 低效SQL语句或长时间运行的事务[^1] - 系统级错误(如ORA-600、ORA-7445)[^2] --- ### **解决方案** #### **1. 紧急缓解措施(临时方案)** ```sql -- 修改sqlnet.ora参数(需重启监听) SQLNET.INBOUND_CONNECT_TIMEOUT = 120 -- 单位:秒(建议阶梯式增加) INBOUND_CONNECT_TIMEOUT_<listener_name> = 120 -- 指定监听器名称[^2] ``` > **注意**:此操作仅延长超时阈值,需同步排查根本原因。 #### **2. 根因分析与修复** - **检查网络延迟** -数据库服务器执行 `tnsping <客户端IP>` 或 `ping` 测试[^2] - 若延迟>100ms,需协同网络团队优化路由。 - **验证本地连接速度** ```bash sqlplus / as sysdba # 本地连接测试响应时间[^2] ``` - 若本地连接慢 → 检查数据库实例状态(`top`、`vmstat`) - **分析数据库负载** - 生成报错时段的AWR报告: ```sql exec dbms_workload_repository.create_snapshot(); ``` - 重点关注: - `LOAD PROFILE` 中的硬解析/事务数 - `Top 5 Timed Events`(等待事件) - 高CPU消耗的SQL(`SQL ordered by CPU Time`)[^1] - **检查关键错误日志** - 排查 `alert_<SID>.log` 中的 **ORA-600**、**ORA-7445** 等致命错误[^2] - 检查 `sqlnet.log` 定位触发ORA-3136的客户端IP[^1][^3] #### **3. 安全加固(针对恶意连接)** - 配置防火墙规则,限制访问源IP - 启用数据库访问控制列表(ACL) - 监控无效连接尝试频率 --- ### **关键诊断文件** | 文件类型 | 路径示例 | 关键信息 | |-------------------|-----------------------------|--------------------------| | `sqlnet.log` | `$ORACLE_BASE/diag/rdbms/...` | 触发错误的客户端IP [^1][^3] | | `alert_<SID>.log` | `$ORACLE_BASE/diag/rdbms/...` | ORA-600/ORA-7445等错误 [^2] | | AWR报告 | `@?/rdbms/admin/awrrpt.sql` | 数据库负载峰值详情 [^1] | --- ### **补充说明** - 客户端表现:连接超时后可能返回 **ORA-12547**(连接中断)或 **ORA-12637**(数据包接收失败)[^3] - **ORA-445(共享内存冲突)** 与此错误无关,多为ASLR(地址空间随机化)引起[^4],需单独处理。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值