监听相关报错:TNS-12535: TNS:operation timed out、TNS-00505: Operation timed out、ORA-609

2023-10-30 16:59

本文主要是介绍监听相关报错:TNS-12535: TNS:operation timed out、TNS-00505: Operation timed out、ORA-609,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1 问题

数据库在巡检的时候发现alert日志里出现监听相关的报错

  • rac1
Tue Sep 03 10:19:48 2019***********************************************************************Fatal NI connect error 12170.VERSION INFORMATION:TNS for Linux: Version 11.2.0.4.0 - ProductionOracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.4.0 - ProductionTCP/IP NT Protocol Adapter for Linux: Version 11.2.0.4.0 - ProductionTime: 03-SEP-2019 10:19:48Tracing not turned on.Tns error struct:ns main err code: 12535TNS-12535: TNS:operation timed outns secondary err code: 12560nt main err code: 505TNS-00505: Operation timed outnt secondary err code: 110nt OS err code: 0Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.201.111)(PORT=49310))
  • rac2
Tue Sep 03 16:47:06 2019***********************************************************************Fatal NI connect error 12547, connecting to:
(LOCAL=NO)VERSION INFORMATION:TNS for Linux: Version 11.2.0.4.0 - ProductionOracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.4.0 - ProductionTCP/IP NT Protocol Adapter for Linux: Version 11.2.0.4.0 - ProductionTime: 03-SEP-2019 16:47:06Tracing not turned on.Tns error struct:ns main err code: 12547TNS-12547: TNS:lost contactns secondary err code: 12560nt main err code: 0nt secondary err code: 0nt OS err code: 0
opiodr aborting process unknown ospid (175308) as a result of ORA-609

数据库的ALERT日志中常会见到ORA-609ORA-3136/ORA-609TNS-12537 and TNS-12547 or TNS-12170TNS-12535等相关错误

2 原因排查与解决

2.1 RAC1的TNS-12535TNS-00505 错误原因

参考官方说明关于该警告的说明:

   Note:465043.1The "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.

可能的原因:

  • 网络攻击,例如:半开连接攻击
    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.
  • 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.
  • 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)

2.2 解决办法

1.查找问题时间段的alert日志和监听日志,其位置分别是$ORACLE__BASE/diag/rdbms/db_name/$ORACLE_SID/trace/$ORACLE__BASE/diag/tnslsnr/hostname/listener/trace/

2.如果alert日志显示如上报错,但listener日志显示正常,那么说明确实是数据库以外的问题,监听正常,就是网络方面的原因了。可能就是client暂时没有连接。
除非大批量客户端或所有的客户端都连不上,才用排查监听、网络或防火墙权限等问题。
出现这个报错,是会两个节点上都有的。

3.如果监听日志显示了其他报错,那么再根据报错找到相应的解决办法。

  • 这跟监听的一个参数有关:SQLNET.INBOUND_CONNECT_TIMEOUT
    这个参数从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来禁用,在服务端:
    1)、设置sqlnet.ora文件:SQLNET.INBOUND_CONNECT_TIMEOUT=0;
    2)、设置listener.ora文件:INBOUND_CONNECT_TIMEOUT_listenername=0;
    3)、然后reload或者重启监听。
    说明:这是由于连接超时所产生的问题,在10.2.0.1.0版本中sqlnet.inbound_connect_timeout参数默认为60秒,即如果连接时间超过60秒则提示超时,而在其他版本中这两个参数默认为0,即无限制。
  • 在这里插入图片描述

2.3 RAC2的ORA-609错误原因

参考官方说明关于该警告的说明:

ORA-609 means  "could not attach to incoming connection" so the database process was 'aborted' (closed) because it couldn't attach to the incoming connection passed to it by the listener.
The reason for this is found in the sqlnet error stack, in our case is:TNS-12537: TNS:connection closed.
Basically the dedicated process didn't have a client connection anymore to work with.

此报错类似通知:ORACLE因为ORA-609关闭或者叫中止了一个到数据库的专有连接–ospid (28725)。
ORA-609错误原因是:无法与进入的连接进行联系,所以无法将此连接转入监听器,所以数据库的process中止此进程。
此时报错TNS-12537: TNS:connection closed,根本原因为客户端连接不正常。

客户端通过监听器连接ORACLE数据库的过程:

  1. Client initiates a connection to the database so it connects to the listener
  2. Listener starts (fork) a dedicated database process that will receive this connection (session)
  3. After this dedicated process is started, the listener passes the connection from the client to this process
  4. The server process takes the connection from the listener to continue the handshake with the client
  5. Server process and client exchange information required for establishing a session (ASO, Two Task Common, User logon)
  6. Session is opened
    简单说就是:
    1.客户端连接到监听器
    2.监听派生fork一个子进程,交转化为专有服务器进程dedicated database process
    3.第2步完成后,监听将客户端的连接转入此专有进程dedicated process
    4.服务器进程收到从监听来的连接信息后,需要继续与客户端的连接进行handshake
    5.服务器进程与客户端进程交换建立会话需要的信息,如用户名、密码等
    6.以上OK后,SESSION OPEN。

出现这个问题时,就是在介于3、4步时客户端连接关闭,dedicated database process与客户端通信时发现客户端关闭了。

生产环境遇上这个报错一般是ISIS那边发新版本,数据库监听状态正常,巡检工具能正常询价,能连上就没事
他们有时候发版本,会把web之类的重启,就会出现这种报错

如果在月报体现,就是“就说明该报错由ISIS发布版本导致的就行”(这种记录看心情)

监听正常,就是网络方面原因了
网上的解决办法就是可以不记录追踪信息,所以记录着忽略就行
除非大批量客户端或所有的客户端都连不上,才用排查监听、网络或防火墙权限等问题
出现这个报错,是会两个节点上都有的

这篇关于监听相关报错:TNS-12535: TNS:operation timed out、TNS-00505: Operation timed out、ORA-609的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



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

相关文章

Springboot配置文件相关语法及读取方式详解

《Springboot配置文件相关语法及读取方式详解》本文主要介绍了SpringBoot中的两种配置文件形式,即.properties文件和.yml/.yaml文件,详细讲解了这两种文件的语法和读取方... 目录配置文件的形式语法1、key-value形式2、数组形式读取方式1、通过@value注解2、通过

Springboot请求和响应相关注解及使用场景分析

《Springboot请求和响应相关注解及使用场景分析》本文介绍了SpringBoot中用于处理HTTP请求和构建HTTP响应的常用注解,包括@RequestMapping、@RequestParam... 目录1. 请求处理注解@RequestMapping@GetMapping, @PostMappin

解决idea启动项目报错java: OutOfMemoryError: insufficient memory

《解决idea启动项目报错java:OutOfMemoryError:insufficientmemory》:本文主要介绍解决idea启动项目报错java:OutOfMemoryError... 目录原因:解决:总结 原因:在Java中遇到OutOfMemoryError: insufficient me

idea突然报错Malformed \uxxxx encoding问题及解决

《idea突然报错Malformeduxxxxencoding问题及解决》Maven项目在切换Git分支时报错,提示project元素为描述符根元素,解决方法:删除Maven仓库中的resolv... 目www.chinasem.cn录问题解决方式总结问题idea 上的 maven China编程项目突然报错,是

vue监听属性watch的用法及使用场景详解

《vue监听属性watch的用法及使用场景详解》watch是vue中常用的监听器,它主要用于侦听数据的变化,在数据发生变化的时候执行一些操作,:本文主要介绍vue监听属性watch的用法及使用场景... 目录1. 监听属性 watch2. 常规用法3. 监听对象和route变化4. 使用场景附Watch 的

linux查找java项目日志查找报错信息方式

《linux查找java项目日志查找报错信息方式》日志查找定位步骤:进入项目,用tail-f实时跟踪日志,tail-n1000查看末尾1000行,grep搜索关键词或时间,vim内精准查找并高亮定位,... 目录日志查找定位在当前文件里找到报错消息总结日志查找定位1.cd 进入项目2.正常日志 和错误日

解决升级JDK报错:module java.base does not“opens java.lang.reflect“to unnamed module问题

《解决升级JDK报错:modulejava.basedoesnot“opensjava.lang.reflect“tounnamedmodule问题》SpringBoot启动错误源于Jav... 目录问题描述原因分析解决方案总结问题描述启动sprintboot时报以下错误原因分析编程异js常是由Ja

解决Nginx启动报错Job for nginx.service failed because the control process exited with error code问题

《解决Nginx启动报错Jobfornginx.servicefailedbecausethecontrolprocessexitedwitherrorcode问题》Nginx启... 目录一、报错如下二、解决原因三、解决方式总结一、报错如下Job for nginx.service failed bec

Java报错:org.springframework.beans.factory.BeanCreationException的五种解决方法

《Java报错:org.springframework.beans.factory.BeanCreationException的五种解决方法》本文解析Spring框架中BeanCreationExce... 目录引言一、问题描述1.1 报错示例假设我们有一个简单的Java类,代表一个用户信息的实体类:然后,

解决若依微服务框架启动报错的问题

《解决若依微服务框架启动报错的问题》Invalidboundstatement错误通常由MyBatis映射文件未正确加载或Nacos配置未读取导致,需检查XML的namespace与方法ID是否匹配,... 目录ruoyi-system模块报错报错详情nacos文件目录总结ruoyi-systnGLNYpe