INBOUND_CONNECT_TIMEOUT与SQLNET.INBOUND_CONNECT_TIMEOUT小结
关于sqlnet.ora的参数SQLNET.INBOUND_CONNECT_TIMEOUT,它表示等待用户认证超时的时间,单位是秒,缺省值是60秒,如果用户认证超时了,服务器日志alert.log显示出错信息"WARNING: inbound connection timed out (ORA-3136)",sqlnet.log里面出现TNS-12535: TNS:operation timed out错误信息。
关于listener.ora的参数inbound_connect_timeout_监听器名,它表示等待用户连接请求超时的时间,单位是秒,缺省值是60秒,如果连接请求超时了,监听器日志listener.log显示出错信息"TNS-12525: TNS:listener has not received client's request in time allowed"。
其中sqlnet.ora里面的参数为SQLNET.INBOUND_CONNECT_TIMEOUT, listener.ora里面的参数设置为INBOUND_CONNECT_TIMEOUT_listener_name ,其中根据监听名字来替换listener_name。官方文档关于两者的介绍如下所示:
SQLNET.INBOUND_CONNECT_TIMEOUT parameter in sqlnet.ora on the database server
Specify the time, in seconds, for a client to connect with the database server and provide the necessary authentication information. If the client fails to establish a connection and complete authentication in the time specified, then the database server terminates the connection. In addition, the database server logs the IP address of the client and an ORA-12170: TNS:Connect timeout occurred error message to the sqlnet.log file. The client receives either an ORA-12547: TNS:lost contact or an ORA-12637: Packet receive failed error message.
INBOUND_CONNECT_TIMEOUT_listener_name in listener.ora
Specify the time, in seconds, for the client to complete its connect request to the listener after the network connection had been established.
If the listener does not receive the client request in the time specified, then it terminates the connection. In addition, the listener logs the IP address of the client and an ORA-12525: TNS:listener has not received client’s request in time allowed error message to the listener.log file
查看inbound_connect_timeout值
1:查看SQLNET.INBOUND_CONNECT_TIMEOUT的设置值,一般进入$ORACLE_HOME/network/admin下,查看sqlnet.ora参数文件即可。
2:查看监听INBOUND_CONNECT_TIMEOUT参数,可以查看listener.ora参数文件。但是有时候,例如默认情况,参数文件里面没有设置这个参数,或是有些动态监听没有配置listener.ora,那么可以使用lsnrctl命令查看,如下所示:
- 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> show inbound_connect_timeout
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
- LISTENER parameter "inbound_connect_timeout" set to 60
- The command completed successfully
- LSNRCTL>
设置SQLNET.INBOUND_CONNECT_TIMEOUT值
我们首先设置SQLNET.INBOUND_CONNECT_TIMEOUT为30秒,这个参数修改后立即生效,不需要做任何其它操作。
- [oracle@DB-Server admin]$ vi sqlnet.ora
- # sqlnet.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora
- # Generated by Oracle configuration tools.
- NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
- SQLNET.INBOUND_CONNECT_TIMEOUT=30
- C:\Users>sqlplus /@mytest
- SQL*Plus: Release 11.2.0.1.0 Production on 星期日 2月 28 10:57:09 2016
- Copyright (c) 1982, 2010, Oracle. All rights reserved.
- ERROR:
- ORA-01017: invalid username/password; logon denied
- 请输入用户名:
当30秒后,此时,在sqlnet.log里面就能看到新增了一条关于TNS-12535的错误记录,其中10.20.34.14是我客户端的IP地址。
告警日志里面你会看到WARNING: inbound connection timed out (ORA-3136)错误。有意思的是,监听日志里面你不会看到任何错误信息。(可以用了对比这两个参数的区别)
设置INBOUND_CONNECT_TIMEOUT_listener_name的值
这个参数可以通过lsnrctl命令设置,如下所示,当然最简单的还是设置listener.ora参数文件。这个参数也是立即生效,不需要重启监听。
- LSNRCTL> show inbound_connect_timeout
- NL-00853: undefined show command "inbound_connect—meout". Try "help show"
- LSNRCTL> show inbound_connect_timeout
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
- LISTENER parameter "inbound_connect_timeout" set to 60
- The command completed successfully
- LSNRCTL> set inbound_connect_timeout 20
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
- LISTENER parameter "inbound_connect_timeout" set to 20
- The command completed successfully
- LSNRCTL> show inbound_connect_timeout
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
- LISTENER parameter "inbound_connect_timeout" set to 20
- The command completed successfully
- LSNRCTL>
此时我们用telnet来模拟用户连接请求超时的时间,如下所示,当超过20秒,就会自动退出
- [root@test ~]# time telnet 192.168.9.124 1521
- Trying 192.168.9.124...
- Connected to 192.168.9.124 (192.168.9.124).
- Escape character is '^]'.
- Connection closed by foreign host.
- real 0m20.019s
- user 0m0.001s
- sys 0m0.003s
此时在listener.log里面,你就能看到TNS-12525的错误,如下所示
- 28-FEB-2016 11:32:20 * <unknown connect data> * (ADDRESS=(PROTOCOL=tcp)(HOST=10.20.34.14)(PORT=38051)) * establish * <unknown sid> * 12525
- TNS-12525: TNS:listener has not received client's request in time allowed
- TNS-12535: TNS:operation timed out
- TNS-12606: TNS: Application timeout occurred
注意:set inbound_connect_timeout只对当前环境生效,如果重启监听服务,则会失效,如下所示
- LSNRCTL> set inbound_connect_timeout 18
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
- LISTENER parameter "inbound_connect_timeout" set to 18
- The command completed successfully
- LSNRCTL> reload
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
- The command completed successfully
- LSNRCTL> show inbound_connect_timeout
- Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
- LISTENER parameter "inbound_connect_timeout" set to 60
- The command completed successfully
此时需要使用命令set save_config_on_stop on保存配置信息,使其永远生效。但是我测试发现,动态监听也无法使用set save_config_on_stop on保存配置信息,需要修改配置文件(注意,修改listener.ora,需要重启监听使之生效)。如下所示
关于两者之间的关系,一般INBOUND_CONNECT_TIMEOUT_listener_name的值应该低于SQLNET.INBOUND_CONNECT_TIMEOUT的值,官方文档介绍如下,
When specifying values for these parameters, consider the following
recommendations:
Set both parameters to an initial low value.
Set the value of the INBOUND_CONNECT_TIMEOUT_listener_name parameter to a lower value than the SQLNET.INBOUND_CONNECT_TIMEOUT parameter.
For example, you can set INBOUND_CONNECT_TIMEOUT_listener_name to 2 seconds and INBOUND_CONNECT_TIMEOUT parameter to 3 seconds. If clients are unable to complete connections within the specified time due to system or network delays that are normal for the particular environment, then increment the time as needed.
INBOUND_CONNECT_TIMEOUT与SQLNET.INBOUND_CONNECT_TIMEOUT小结的更多相关文章
- [20171120]关于INBOUND_CONNECT_TIMEOUT设置.txt
[20171120]关于INBOUND_CONNECT_TIMEOUT设置.txt --//上午翻看以前我的发的帖子,发现链接:http://www.itpub.net/thread-2066758- ...
- Oracle sqlnet.ora配置
Oracle sqlnet.ora配置 sqlnet.ora的作用(官网指出的) www.2cto.com 1.限制客户端访问(如指定客户端域为不允许访问) 2.指定命名方法(local nami ...
- [转帖] SQLNET.ORA的处理.
被一个客户端连接远程数据库阻塞超时的问题困扰了好久,最后终于找到了答案 https://blog.csdn.net/herobox/article/details/16985097 Oracle ...
- [转帖]sqlnet.ora常用参数
sqlnet.ora常用参数 注﹕在修改sqlnet.ora文件之后重新启动监听﹐修改才能生效﹗﹗﹗ oracle网络设置主要包括三个文件,sqlnet.ora\ lisnter.ora\ tnsna ...
- sqlnet.ora的作用
sqlnet.ora的作用 1.限制客户端访问(如指定客户端域为不允许访问) 2.指定命名方法(local naming,directory nameing...)的优先级 3.启用日志及跟踪(log ...
- Oracle的sqlnet.ora文件配置
DBA对这个文件一定不会陌生,大家了解最多的也一定是sqlnet.ora用来决定oracle怎么解析一个连接中出现的字符串,例如: sqlplus sys/oracle@orcl 那么这个orcl怎么 ...
- Oracle 通过sqlnet.ora文件控制对Oracle数据库的访问
一.通过sqlnet.ora文件控制对Oracle数据库的访问 出于数据安全考虑,对Oracle数据库的IP做一些限制,只有固定的IP才能访问.修改$JAVA_HOME/NETWORK/ADMIN/s ...
- 11gR2数据库日志报错:Fatal NI connect error 12170、
11gR2数据库日志报错:Fatal NI connect error 12170.TNS-12535.TNS-00505 [问题点数:100分,结帖人MarkIII] 不显示 ...
- 一次处理ORA-07445的历险记(转)
ORA-07445通常是Oracle调用操作系统的资源出错时出现的[@more@] 事前没有任何征兆,下午5点左右某个关键应用的17台oracle数据库上的数据库实例陆续宕机,赶紧查看alert_lo ...
随机推荐
- 框架Hibernate笔记系列 基础Session
标题:框架Hibernate笔记 资料地址: 1. www.icoolxue.com 孔浩 1.背景简介 Hibenate是JBoss公司的产品.它是数据持久化的框架.Usually,我们使用JDBC ...
- 【FOL】第二周
一直在忙其他事情,停了好久了.终于又可以开始做点东西了. 这周主要工作: 1.整理客户端代码,加入网络模块:fol.client.net. 2.写了个简单的版本服务端程序. 3.初步完成了自动更新功能 ...
- PHP内核探索之变量(3)- hash table
在PHP中,除了zval, 另一个比较重要的数据结构非hash table莫属,例如我们最常见的数组,在底层便是hash table.除了数组,在线程安全(TSRM).GC.资源管理.Global变量 ...
- ReportingServies——SQLServer报表开发综合实例
如果我们安装了sqlserver2008 R2,将会自动安装一个报表开发工具 不要以为此报表开发工具只适合于sqlserver2008,其实在sqlserver2012中也是支持的,事实上我现在项目中 ...
- webapi的返回类型,webapi返回图片
1.0 首先是返回常用的系统类型,当然这些返回方式不常用到.如:int,string,list,array等.这些类型直接返回即可. public List<string> Get() { ...
- GJM : FlatBuffers 与 protobuf 性能比较 [转载 ]
原帖地址:http://blog.csdn.net/menggucaoyuan/article/details/34409433 原作者:企鹅 menggucaoyuan 未经原作者同意不允许转载 ...
- 数据库热备之SQLServer的数据库镜像实施笔记
/ 最初在为公司设计SQLServer数据库镜像的时候,首先考虑的是高可用性(三台计算机,一台见证服务器,一台做主数据库,一台做镜像) 在虚拟机环境下部署成功,一切都是那么的完美.故障转移3秒之内就可 ...
- 20款风格独特的搜索框 PSD 设计素材免费下载
搜索框是网站中的最常用的组件一直,但有时候,搜索框因为设计不够新颖容易被访客忽视.通过提高一个搜索框的外观设计,最终对整体的网页设计带来好的变化.这份列表将是一个很好的资源,尤其是对设计师.希望你会喜 ...
- 未来的 Web:九个不可思议的 WebGL 应用试验
WebGL 技术允许把 JavaScript 和 OpenGL ES 2.0 结合在一起,通过增加 OpenGL ES 2.0 的一个 JavaScript 绑定,WebGL 可以为 HTML5 Ca ...
- Skytte:一款令人印象深刻的 HTML5 射击游戏
Skytte 是一款浏览器里的 2D 射击游戏.使用 Canvas 元素和大量的 JavaScript 代码实现.Skytte 是用我们的开源和现代的前端技术创造的.经典,快节奏的横向滚动射击游戏,探 ...