TNS-12535 TNS-00505

news/2024/11/24 5:02:22/

转自------http://blog.csdn.net/mchdba/article/details/43234831



一:分析,参考官方说明关于该警告的说明:

  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.

这个oracle dba处于局域网,来自网络攻击的可能也被排除了。


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.


    去check是否默认的60秒:
[oracle@localhost ~]$ lsnrctl 


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JAN-2015 16:26:25

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> show inbound_connect_timeout
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
LISTENER parameter "inbound_connect_timeout" set to 60
The command completed successfully
LSNRCTL> 

看到inbound_connect_timeout是60秒,有可能是由于Client在默认60秒内没有完成认证这个原因引起的。


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)
[oracle@localhost admin]$ w
18:24:09 up 88 days, 17:36,  6 users,  load average: 0.60, 0.88, 1.21
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/3    xxx.1xx.120.238  Tue11    1:55m  0.29s  0.04s -bash
root     pts/4    xxx.1xx.120.238  Tue11    0.00s  0.18s  0.00s w
root     pts/7    xxx.1xx.120.238  Tue14    6:51m  0.28s  0.20s rlwrap sqlplus / as sysdba
root     pts/6    xxx.1xx.120.238  15:49    2:34m  0.00s  0.00s -bash
[oracle@localhost admin]$ 
线上db负载很低,w下来不到1,所以排除这种情况。


二:开始设置inbound_connect_timeout的值


1,查看inbound_connect_timeout的值

[oracle@localhost ~]$ lsnrctl 


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JAN-2015 16:26:25


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Welcome to LSNRCTL, type "help" for information.


LSNRCTL> show inbound_connect_timeout
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
LISTENER parameter "inbound_connect_timeout" set to 60
The command completed successfully
LSNRCTL> 


大概有3种办法来操作:
  1)、设置sqlnet.ora文件:SQLNET.INBOUND_CONNECT_TIMEOUT=0;
  2)、设置listener.ora文件:INBOUND_CONNECT_TIMEOUT_listenername=0;
  3)、然后reload或者重启监听。


2,在线临时重新设置值
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> 
LSNRCTL> 
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> 


3,永久性在listener.ora设置
[oracle@powerlong4 admin]$ vim listener.ora 
INBOUND_CONNECT_TIMEOUT_listener=0
[oracle@powerlong4 admin]$ 
[oracle@powerlong4 admin]$ 
[oracle@powerlong4 admin]$ lsnrctl stop


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JAN-2015 16:40:33


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
[oracle@powerlong4 admin]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JAN-2015 16:40:37


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Starting /oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /oracle/app/oracle/diag/tnslsnr/powerlong4/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=powerlong4)(PORT=1521)))


Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                28-JAN-2015 16:40:37
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/powerlong4/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=powerlong4)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@powerlong4 admin]$ lsnrctl 


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JAN-2015 16:40:41


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Welcome to LSNRCTL, type "help" for information.


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> exit
[oracle@powerlong4 admin]$ vim listener.ora 
[oracle@powerlong4 admin]$ vim listener.ora 
[oracle@powerlong4 admin]$ 
[oracle@powerlong4 admin]$ lsnrctl stop


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JAN-2015 16:41:38


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
^[[AThe command completed successfully
[oracle@powerlong4 admin]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JAN-2015 16:41:46


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Starting /oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /oracle/app/oracle/diag/tnslsnr/powerlong4/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=powerlong4)(PORT=1521)))


Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                28-JAN-2015 16:41:46
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/powerlong4/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=powerlong4)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@powerlong4 admin]$ lsnrctl 


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JAN-2015 16:41:49


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Welcome to LSNRCTL, type "help" for information.


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> 
LSNRCTL> exit
[oracle@powerlong4 admin]$ 

PS:这里使用lsnrctl stop|start会断掉当前oracle里的所有客户端连接,也可以使用lsnrctl reload来加载

       后续:设置为0之后再没有出现过类似的报警信息,不过设置inbound_connect_timeout为0,是有隐患的。因为这个参数从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也是存在被攻击的隐患,设置为60秒太长了,所以最后权衡了下,我将inbound_connect_timeout设置成了8秒。


    参考文章地址:http://www.cnblogs.com/future2012lg/p/3739752.html

http://www.ppmy.cn/news/741471.html

相关文章

GNS3 2.1.3出来了,还有配套 的GNS3 VM 2.1.3

GNS2.1.3GNS3已经到2.1.3版了,比起之前的版本扩展很多了,最近下了几个网络模拟器,感觉还是用新版的好 啊。感觉gns3和eveN G差不多,webiou已经不开发了,当然了各有所用吧。一般的用足够了,下载点IOU的镜像。…

GNS3使用简介

文章目录 GNS3打开GNS3配置通用设置IOS routers设置 GNS3打开 配置完成后进入主界面。 GNS3配置 通用设置 通过点击Edit->Preferences打开设置界面。 如上图,为通用设置,My projects和My binary images分别是我的工程和路由IOS的默认保存路径。 C…

SGM3005 简介

概述 SGM3005是双通道,低导通电阻,低电压,双向,单刀双掷(SPDT)CMOS 模拟开关设计用于1.8V至5.5V单电源供电。 目标应用包括受益于低RON(0.5Ω)和快速开关速度(tON 50n…

【Oracle11g】

查询端口命令:netstat -a Oracle数据库服务器由两部分组成 ① 实例:理解为对象,看不见的 ② 数据库:理解为类,看得见的,在安装目录下找到oradata文件夹下的子文件夹下,*.DBF二进制文件 客户…

Oracle11g的网络配置

1)oracle11g网络连接的方式。 2)oracle11g中进行网络配置的主要文件。 3)oracle11g的静态注册、动态注册的含义和相互转换的方式,以及何时必须使用静态注册。 4)netca和net manager的使用。 Oracle安装后,服…

Oracle 11g 透明网关

项目开发中,需要调用SQLServer2008中某张表,如果用ETL工具,感觉没有必要,就想通过透明网关,创建dblink链接去读取数据。 第一步:下载透明网关文件win32_11gR2_gateways,并安装,安装…

G003-181-01

文章目录 引言 一、 项目需求提案计划书1.1 所提案的项目系统1.2 系统可能的问题分析1.3 系统的使用目标分析1.4 系统业务过程分析1.5 系统使用环境 二、 项目需求萃取分析书2.1 确定项目关键涉众2.1.1 涉众评估2.1.2 涉众描述2.1.3 涉众参与策略制定 2.2 用户需求萃取2.2.1 展…

G003-186-07

目录 一、博客系统提案计划书1.引言1.1 概述1.2 背景1.1 博客系统开发的必要性1.4开发目标1.5产品范围 二、项目需求萃取分析书2.1 应用背景2.2 问题域2.3 涉众2.4 项目前景与范围2.5 业务2.6 系统环境2.7 用户需求获取2.8 项目数据 三、项目需求分析规格书3.1 引言3.2 项目概述…