[20171120]关于INBOUND_CONNECT_TIMEOUT设置.txt

--//上午翻看以前我的发的帖子,发现链接:http://www.itpub.net/thread-2066758-1-1.html
--//今天再仔细看了一下,注意看了一下别人的回复,才发现一些细节问题,原始链接:
--//http://www.cnblogs.com/kerrycode/p/5224483.html

关于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命令查看,如下所示:

--//下午我仔细看,才发现我以前的测试错误在那里.我以为2个都可以通过telnet ip port的方式测试出来.理解错误.^_^ .
--//实际上文档已经明确说明,看文档还是不够认真,理解还是不够透彻.
--//测试SQLNET.INBOUND_CONNECT_TIMEOUT,需要网络连接,出现超时才会报错.

1.测试环境:
SCOTT@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.测试一:
--//首先不做任何设置(缺省设置)
--//session 3:
$ ps -ef  | grep oracleboo[k]
--//当前没有任何通过网络连接到数据库.
--//打开几个会话:
--//session 1:
$ tail -f alert*.log

--//session 2:
$ cd /u01/app/oracle/product/11.2.0.4/dbhome_1/network/log
--//注意:监听listener.log的目录位置,我在监听配置中加入DIAG_ADR_ENABLED_LISTENER=OFF.
$ tail -f sqlnet.log listener.log

$ date;sqlplus scott/xxxxx@book
Mon Nov 20 16:30:37 CST 2017
SQL*Plus: Release 11.2.0.4.0 Production on Mon Nov 20 16:30:38 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
--//不做任何操作,等60秒....

--//session 3:
$ ps -ef  | grep oracleboo[k]
oracle   56566     1  0 16:34 ?        00:00:00 oraclebook (LOCAL=NO)
--//可以发现服务端开启1个进程.

$ tail -f alert*.log
Mon Nov 20 16:31:38 2017
WARNING: inbound connection timed out (ORA-3136)

$ tail -f sqlnet.log listener.log
==> sqlnet.log <==
***********************************************************************
Fatal NI connect error 12170.

VERSION INFORMATION:
        TNS for Linux: Version 11.2.0.4.0 - Production
        Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production
  Time: 20-NOV-2017 16:31:38
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12535
    TNS-12535: TNS:operation timed out
    ns secondary err code: 12606
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0
  Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.78)(PORT=42714))

--//listener.log没有相关输出.
--//注意看时间,相减就是60秒.

$ ps -ef  | grep oracleboo[k]
--//没有输出.说明进程已经over.
--//也就是在网络连接错误超时的情况下,oracle要通过SQLNET.INBOUND_CONNECT_TIMEOUT参数确定超时认证时间.
--//如果通过telnet(注client ip:192.168.100.40 ) 连接测试:
# date;time telnet 192.168.100.78 1521
Mon Nov 20 16:44:12 CST 2017
Trying 192.168.100.78...
Connected to gxqyydg4 (192.168.100.78).
Escape character is '^]'.

--//session 3:
$ ps -ef  | grep oracleboo[k]
--//可以发现根本没有相关进程.

# lsof -P -n -i | grep 192.168.100.40
tnslsnr   56702  oracle   15u  IPv4 37111676      0t0  TCP 192.168.100.78:1521->192.168.100.40:40923 (ESTABLISHED)

# ps -ef | grep 5670[2]
oracle   56702     1  0 Nov20 ?        00:00:01 /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/tnslsnr LISTENER -inherit
--//进程号对于监听进程.

# date;time telnet 192.168.100.78 1521
Tue Nov 21 08:41:12 CST 2017
Trying 192.168.100.78...
Connected to gxqyydg4 (192.168.100.78).
Escape character is '^]'.
Connection closed by foreign host.
real    1m0.106s
user    0m0.001s
sys     0m0.001s

--//你可以发现在服务器还没有开启服务器进程,仅仅存在一个网络连接.而这个时候实际上监听配置inbound_connect_timeout_监听器名起作
--//用.只不过缺省设置是60秒.
--//而前面sqlplus scott/xxxxx@book,既打开网络连接,有开启服务端进程.2者测试就很容易理解了.
--//理解这些,后面的测试就很容易理解.

--//session 2:
$ tail -f sqlnet.log listener.log
==> listener.log <==
21-NOV-2017 08:39:22 * service_update * book * 0
21-NOV-2017 08:42:12 * <unknown connect data> * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.40)(PORT=40923)) * 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

--//注意看下划线内容,sid=<unknown sid>,<unknown connect data>,端口号PORT=40923也能对上.
--//sqlnet.log没有相关输出.

--//也就是在监听配置listener.ora中的inbound_connect_timeout_监听器名是用户连接监听时的超时限制.
--//                sqlnet.ora中SQLNET.INBOUND_CONNECT_TIMEOUT是等待用户认证超时的时间(注已经通过网络连接).

--//继续做一个测试说明问题(注:使用本地连接.不做任何操作)
$ date;sqlplus scott/xxxxx
Mon Nov 20 17:07:08 CST 2017
SQL*Plus: Release 11.2.0.4.0 Production on Mon Nov 20 17:07:08 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:

$ ps -ef  | grep oracleboo[k]
oracle   61056 61055  0 08:45 ?        00:00:00 oraclebook (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

# lsof -P -n -i | grep 6105[56]
--//注意前面的连接不同,没有通过网络连接.

$ sleep 60
$ ps -ef  | grep oracleboo[k]                                                              |
oracle   61056 61055  0 08:45 ?        00:00:00 oraclebook (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

--//你可以发现这样的进程不会kill掉.也就是不通过网络这个参数不会生效.
--//理解以上测试就明白,实际上2个参数对应是不同的设置,一个针对监听,一个针对用户认证.

3.测试二:
--//修改sqlnet.ora加入:
SQLNET.INBOUND_CONNECT_TIMEOUT=30

--//修改listener.ora加入,并且重启监听:
INBOUND_CONNECT_TIMEOUT_LISTENER=10

$ lsnrctl stop ;sleep 1;lsnrctl start

# date;time telnet 192.168.100.78 1521
Tue Nov 21 08:52:52 CST 2017
Trying 192.168.100.78...
Connected to gxqyydg4 (192.168.100.78).
Escape character is '^]'.
Connection closed by foreign host.

real    0m10.015s
user    0m0.002s
sys     0m0.000s
--//使用telnet测试,测试是listener.ora设置参数INBOUND_CONNECT_TIMEOUT_LISTENER=10.

$ date;sqlplus scott/xxxxx@book
Tue Nov 21 08:54:29 CST 2017
SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 21 08:54:29 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:

--//alter.log输出:
==> sqlnet.log <==
Tue Nov 21 08:54:59 2017
WARNING: inbound connection timed out (ORA-3136)

--//sqlnet.log输出:
==> sqlnet.log <==
***********************************************************************
Fatal NI connect error 12170.

VERSION INFORMATION:
        TNS for Linux: Version 11.2.0.4.0 - Production
        Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production
  Time: 21-NOV-2017 08:54:59
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12535
    TNS-12535: TNS:operation timed out
    ns secondary err code: 12606
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0
  Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.78)(PORT=54593))

--//时间相减就是30秒.说明这样测试网络连接的用户认证.
--//其它可以参考链接测试http://www.cnblogs.com/kerrycode/p/5224483.html,不再重复了.

总结:
我主要犯了一个概念上错误,认为这个参数INBOUND_CONNECT_TIMEOUT设置针对的超时认证是一样的东西,实际上2者存在不同.
一个表示等待用户认证超时的时间,一个表示等待用户连接请求超时的时间.
讲的通俗一点,一个针对监听,一个针对用户认证(网络连接已经确立).
另外一个文档看别人的文档还是跟认真一点,这样的错误就能很快发现.总之自己还是存在一些概念的混淆混乱...
我不知道还有什么方法认证这些参数测试!!

[20171120]关于INBOUND_CONNECT_TIMEOUT设置.txt的更多相关文章

  1. [20190507]sga_target=0注意修改_kghdsidx_count设置.txt

    [20190507]sga_target=0注意修改_kghdsidx_count设置.txt --//昨天遇到一例视图定义太复杂导致长时间分析sql语句出现library cache lock等待事 ...

  2. Windows设置.txt文件默认打开程序

    一.配置某个程序默认打开哪些类型的文件(以firefox为例) 依次打开”控制面板\程序\默认程序“,点击”设置默认程序“ 在右侧列表找到firefox,选中 以firefox为例,”将此程序设置为默 ...

  3. web 界面设计---js设置txt值

    <head><meta http-equiv="Content-Type" content="text/html; charset=gb2312&quo ...

  4. notepad++设置默认打开txt文件失效的解决方法

    1.系统环境 win10企业版,64位系统 2.初步设置 设置txt默认为notepad++打开,菜单:设置->首选项->文件关联 选择对应的文件扩展,点击"关闭"按钮 ...

  5. IIS6.0禁止用户下载txt文件

    服务器win2003+IIS6.0,在IIS上限制下载.txt文件,方法比较简单,在IIS的应用程序扩展名映射中为资源扩展名指定一个错误的可执行文件即可. 打开记事本,直接将空内容保存为C:\WIND ...

  6. 什么是A记录/CNAME记录/MX记录/TXT记录

    答: A 记录(Address)是用来指定主机名(或域名)对应的IP地址记录.当你输入域名的时候给你引导向设置在DNS的A记录所对应的服务器. CNAME记录 ( Canonical Name )是一 ...

  7. DNS详解: A记录,子域名,CNAME别名,PTR,MX,TXT,SRV,TTL

    DNS DNS,Domain Name System或者Domain Name Service(域名系统或者域名服务).域名系统为Internet上的主机分配域名地址和IP地址.由于网络中的计算机都必 ...

  8. 1.selenium实战之从txt文档读取配置信息并执行登录

    前置条件: 1.本机已搭建ECShop3.0网站 2.在脚本目录创建了user.txt文本如下: 目的:实现从txt中读取配置文件信息,本实战中,包含url地址.用户名.密码,然后进行ESChop的登 ...

  9. Oracle Listener

    一.监听器功能 1)监听客户端请求:监听器作为独立进程运行在数据库服务器上,监听特定网络端口(默认1521)服务请求. 2)为客户端请求分配oracle Server Process:监听器不直接处理 ...

随机推荐

  1. Liferay7 BPM门户开发之25: Liferay7应用程序配置(APPLICATION CONFIGURATION)

    首先有几个概念需要明确.1.第一个概念是这里的应用程序配置不是写XML之类的配置文件,是类似字典的类型化配置这意味着应用程序配置不只是一个字符串键值对的列表.值还可以有类型,如整数列表,字符串列表,一 ...

  2. centos7使用lldb调试netcore应用转储dump文件

    centos7下安装lldb,dotnet netcore 进程生成转储文件,并使用lldb进行分析 随着netcore应用在linux上部署的应用越来越多,碰到cpu 100%,内存暴涨的情况也一直 ...

  3. python 变量进阶(理解)

    变量进阶(理解) 目标 变量的引用 可变和不可变类型 局部变量和全局变量 01. 变量的引用 变量 和 数据 都是保存在 内存 中的 在 Python 中 函数 的 参数传递 以及 返回值 都是靠 引 ...

  4. shiro测试常见错误

    org.apache.shiro.authc.IncorrectCredentialsException: Submitted credentials for token [org.apache.sh ...

  5. spring cloud+.net core搭建微服务架构:Api网关(三)

    前言 国庆假期,一直没有时间更新. 根据群里面的同学的提问,强烈推荐大家先熟悉下spring cloud.文章下面有纯洁大神的spring cloud系列. 上一章最后说了,因为服务是不对外暴露的,所 ...

  6. Retrofit2+Rxjava2的用法

    近几年,Retrofit犹如燎原之火搬席卷了整个Android界.要是不懂Retrofit,简直不好意思出门... 由于近几个项目都没用到Retrofit,无奈只能业余时间自己撸一下,写的不好的地方, ...

  7. ES启动报错之引导检测失败

    [--16T18::,][ERROR][o.e.b.Bootstrap ] [node-] node validation exception [] bootstrap checks failed [ ...

  8. AD预测论文研读系列1

    A Deep Learning Model to Predict a Diagnosis of Alzheimer Disease by Using 18F-FDG PET of the Brain ...

  9. 记录解决phpStudy报出403Forbidden问题的方法

    本人输入ip地址+目录去访问PHPTutorial/WWW目录下的某个文件,发生了没有权限访问的问题,导了一个下午,终于解决……不忘在此做个记录 1. 打开phpStudy,点击按键“其他选项菜单”= ...

  10. MyBatis从入门到放弃二:传参

    前言 我们在mapper.xml写sql,如果都是一个参数,则直接配置parameterType,那实际业务开发过程中多个参数如何处理呢? 从MyBatis API中发现selectOne和selec ...