TNS-12535 TNS-00505

2024-01-22 12:58
文章标签 tns 12535 00505

本文主要是介绍TNS-12535 TNS-00505,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

转自------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

这篇关于TNS-12535 TNS-00505的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/633039

相关文章

plsql远程访问数据库 解决ora-12541:TNS:无监听程序最佳方案

很奇怪我只是 在本机局域网ip 不固定 ,现在把所有的ip 都固定了,一直报这个错,百度无解,都是错的 不可行的,还是我打开的方式有问题??????昨晚搞到我又把本机装的 oracle 给卸载完了 !!!又装虚拟机,虚拟机又装oracle 配了配了。。。。。。。。。。。 刚刚终于搞定了,跑起来了  !!!!!!!能连接了。 来一张连接图 plsql远程访问数据库 解决ora-1254

oracle错误-ORA-12519, TNS:no appropriate service handler found

错误重现: java连接oracle数据库,更新表的字段,当更新到2000条左右时就报错(每次报错时更新的条数不定,但是不会太少),重新运行程序后还是会报错导致更新停止。 报错信息: Could not get JDBC Connection; nested exception is java.sql.SQLException: Listener refused the connect

ORA-12519: TNS: 没有找到适用的服务的解决方法

数据库异常日志ORA-12519: TNS: 没有找到适用的服务的解决方法 1、问题描述 数据库监控日志报警,数据库抛出ORA-12519异常   2、问题分析 ora-12519异常为超过数据库最大进程数,sql:select value from v$parameter where name = 'processes'查看数据库最大进程数,值为:1000,sql:select co

ora-12541: TNS:监听程序当前无法识别连接描述符中请求的服务

在监听文件里(C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN里的listener.ora) 把下段代码放到(SID_LIST =  )列表里 加上 (SID_DESC =       (SID_NAME = orcl)       (ORACLE_HOME = C:\app\Administrator\p

System.Data.OracleClient.OracleException:“ORA-12571: TNS: 包写入程序失败

System.Data.OracleClient.OracleException:“ORA-12571: TNS: 包写入程序失败 解决方法: 首先%oracle_home%/network/admin下的sqlnet.ora文件,把SQLNET.AUTHENTICATION_SERVICES = (NTS)加个 # 注释掉就好了

oracle 12170:tns:连接超时

1.开始----程序-----oracle------配置和移植工具-----Net Manager----本地----服务命名---orcl把右下角地址里的主机名改成192.168.1.100;2.修改监听程序---同样把右边下面的主机名改成192.168.1.100 。 1.cmd---services.msc----以Oracle开头TNListener结尾的服务启动它 2.

ORA-12541:TNS:没有监听器

"ORA-12541: TNS: 没有监听器" 是 Oracle 数据库连接时可能遇到的错误。这个错误通常表示客户端尝试连接到的数据库监听器未在目标主机上运行或未配置正确。解决这个问题的方法通常涉及以下步骤: 1.确保监听器在运行 确保数据库服务器上的 Oracle 监听器服务正在运行。可以使用以下命令检查监听器状态:  lsnrctl status  如果监听器未运行,请使用以下命令启动

ORA-12162: TNS:net service name is incorrectly specified

今天有个测试人员来找我,说由于公司停电导致服务器关机,需要重起项目。 我远程连接后发现oracle数据库没有启动。 首先切换oracle用户: su oracle  接着启动oracle监听: lsnrctl start 接着sqlplus 登录账户 出现 ORA-12162: TNS:net service name is incorrectly specified 检查.or

访问oracle报错:ORA-12516:TNS:listener could not find available handler with matching protocol stack

测试数据交换时,连接oracle报错 百度解决方法:https://www.cnblogs.com/kerrycode/p/3725813.html 命令行登录报错,再次找解决方法:https://blog.51cto.com/lee90/1788124 提示内存不足,在找解决方法:https://www.cnblogs.com/halberd-lee/p/11645260.html

ora-12154 TNS 无法处理服务名

百度查了好多,网上也有好多,试了试都不行。 我这个最终解决方案是重新安装了一下。 首先,把电脑里有关的环境变量全部删除掉。 重新安装oracle、plsql。 安装时注意,安装路径不要有中文、括号之类的。 C:\Program Files\PLSQL Developer  这个路径可以。 C:\Program Files (x86)\PLSQL Developer 这个路径有问题。