近日,在查看数据库告警日志时都发现有连续报以下错误信息:

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: 04-5-2022 16:35:48
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12535

TNS-12535: TNS: 操作超时
    ns secondary err code: 12560
    nt main err code: 505

TNS-00505: 操作超时
    nt secondary err code: 110
    nt OS err code: 0
  Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.46.72)(PORT=50113))
2022-05-04 16:48:26.687000 +08:00

该报错信息不会对数据库产生影响,但是alert日志增长很快,如果不注意,会导致磁盘空间不够用;另外查找错误也比较不友善。
为了规避这个问题,通过查找相关的官方资料,找到了相关的原因:

官方文档:
   These time out related messages are mostly informational in nature.  The messages indicate the specified client connection (identified by the 'Client address:' details) has experienced a time out. The 'nt secondary err code' identifies the underlying network transport, such as (TCP/IP) timeout limits after a client has abnormally terminated the database connection.
   The 'nt secondary err code' translates to underlying network transport timeouts for the following Operating Systems:


  For the Solaris system: nt secondary err code: 145:
     ETIMEDOUT 145 /* Connection timed out */
  For the Linux operating system: nt secondary err code: 110
     ETIMEDOUT 110 Connection timed out
  For the HP-UX system: nt secondary err code: 238:
     ETIMEDOUT 238 /* Connection timed out */
  For AIX: nt secondary err code: 78:
     ETIMEDOUT 78 /* Connection timed out */
  For Windows based platforms: nt secondary err code: 60         (which translates to Winsock Error: 10060)

  Description:  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
  The reason the messages are written to the alert log is related to the use of the new 11g Automatic Diagnostic Repository (ADR) feature being enabled by default.  See (Doc ID 454927.1).

根据描述来讲有两方面原因:
1、由于被连接方在一段时间后没有正确响应;
2、由于连接的主机没有响应而建立的连接失败,连接尝试失败。
将消息写入警报日志的原因与默认启用的新的11g自动诊断存储库(ADR)特性有关。见(Doc ID 454927.1)。

解决方法:
设置Oracle Net的配置参数使它的诊断追踪信息不再写入到告警日志文件中,需要修改两个地方:

1. 在服务端的sqlnet.ora文件中增加一行
        DIAG_ADR_ENABLED=OFF
2. 在服务端的listener.ora中增加一行(其中listenername替换为你自己的监听器名称)
       DIAG_ADR_ENABLED_<listenername>=OFF
3. 使用lsnrctl命令使以上配置生效
       lsnrctl reload;(业务不会中断,最好使用lsnrctl restart确保参数生效)
       或者
       lsnrclt restart;(业务会中断)
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐