硬件说明:

操作系统版本:ORACLE LINUX 6.3  64位

数据库版本:11.2.0.3   64位

问题说明:

在检查数据库的alert日志的时候,发现大量的12170和TNS-12535的错误;

Fatal NI connect error 12170.

VERSION INFORMATION:

TNS for Linux: Version 11.2.0.3.0 - Production

Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production

TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production

Time: 06-APR-2014 10:46:14

Tracing not turned on.

Tns error struct:

ns main err code: 12535

TNS-12535: TNS:operation timed out

ns secondary err code: 12560

nt main err code: 505

TNS-00505: Operation timed out

nt secondary err code: 110

nt OS err code: 0

Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=110.80.1.83)(PORT=50226))

Sun Apr 06 10:46:24 2014

问题解决:

在metalink平台上面查找,该症状和文档 ID (1628949.1)描述的症状完全一样,根据文档的内容整理如下:

1、出现问题的版本

Oracle Net Services - Version 11.2.0.3 to 12.1.0.1 [Release 11.2 to 12.1]Information in this document applies to any platform.

2、出现错误的症状或报错格式如下:

Fatal NI connect error 12170.VERSION INFORMATION:TNS for 64-bit Windows: Version 11.2.0.3.0 - ProductionOracle Bequeath NT Protocol Adapter for 64-bit Windows: Version 11.2.0.3.0 - ProductionWindows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 11.2.0.3.0 - ProductionTime: 22-FEB-2014 12:45:09Tracing 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: 60nt OS err code: 0***Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=121.23.142.141)(PORT=45679))

The PORT field here is the ephemeral port assigned to the client for this connection. This does not correspond to the listener port.

3、问题的原因

The alert.log message indicates that a connection was terminated AFTER it was established to the instance. In this case, it was terminated 2 hours and 3 minutes after the listener handed the connection to the database.

This would indicate an issue with a firewall where a maximum idle time setting is in place.

The connection would not necessarily be "idle". This issue can arise during a long running query or when using JDBC Thin connection pooling. If there is no data 'on the wire' for lengthy

periods of time for any reason, the firewall might terminate the connection.

4、解决方法:

The following parameter, set at the **RDBMS_HOME/network/admin/sqlnet.ora, can resolve this kind of problem. DCD or SQLNET.EXPIRE_TIME can mimic data transmission between the server and the client during long periods of idle time. SQLNET.EXPIRE_TIME=n Where <n> is a non-zero value set in minutes.

进入ORACLE_HOME/network/admin目录下,添加sqlnet.ora文件,增加一行SQLNET.EXPIRE_TIME=10

5、补充说明SQLNET.EXPIRE_TIME

Purpose

To specify a time interval, in minutes, to send a check to verify that client/server connections are active. The following usage notes apply to this parameter:

  • Setting a value greater than 0 ensures that connections are not left open indefinitely, due to an abnormal client termination.
  • If the probe finds a terminated connection, or a connection that is no longer in use, then it returns an error, causing the server process to exit.
  • This parameter is primarily intended for the database server, which typically handles multiple connections at any one time.
  • Limitations on using this terminated connection detection feature are:

    • It is not allowed on bequeathed connections.
    • Though very small, a probe packet generates additional traffic that may downgrade network performance.
    • Depending on which operating system is in use, the server may need to perform additional processing to distinguish the connection probing event from other events that occur. This can also result in degraded network performanc

6、做完以上操作后,重启数据库的监听;

其他补充

原因

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.

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.

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)

解决方法:

其实这个参数跟监听的一个参数有关: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或者重启监听。

[转帖]TNS-12535 TNS-00505的处理方法的更多相关文章

  1. ORA-12560: TNS: 协议适配器错误的解决方法

    ORA-12560: TNS: 协议适配器错误的解决方法 造成ORA-12560: TNS: 协议适配器错误的问题的原因有三个: 1.监听服务没有起起来.windows平台个一如下操作:开始---程序 ...

  2. ORA-12560:TNS:协议器错误的解决方法

    使用SQL Plus登录数据库时,系统报ORA-12560:TNS:协议器错误.之前建了三个数据库实例,删除了一个实例.现在登录其中一个数据库报此错误.   工具/原料   Oracle11g 方法/ ...

  3. [转帖]ESXi 网卡绑定 增加吞吐量的方法

    VMware ESX 5.0 网卡负载均衡配置3种方法 http://blog.chinaunix.net/uid-186064-id-3984942.html (1) 基于端口的负载均衡 (Rout ...

  4. [转帖].NET导出Excel的四种方法及评测

    .NET导出Excel的四种方法及评测 https://www.cnblogs.com/sdflysha/p/20190824-dotnet-excel-compare.html 导出Excel是.N ...

  5. [转帖]瀚高数据库创建uuid的方法

    使用syssso登录,并执行下列语句 highgo=> select set_secure_level('off'); set_secure_level -------------------- ...

  6. [转帖]IntelliJ IDEA 2018.3.3破解方法

    IntelliJ IDEA 2018.3.3破解方法 https://blog.csdn.net/qq_42862882/article/details/86477495 验证了下 也可以激活.   ...

  7. [转帖] Linux下面计算文件数量的方法

    Linux命令-查看目录下文件个数 2018年07月04日 10:37:07 sand_clock 阅读数 2002    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blo ...

  8. [转帖]Linux下批量替换文件内容方法

    Linux下批量替换文件内容方法 https://www.cnblogs.com/fjping0606/p/4428850.html 刚才用到的命令 原作者写的挺好的记录一下 以后 用. 1:查找fi ...

  9. TNS-12535: TNS:operation timed out案例解析

    一数据库突然连接不上,在自己电脑上使用SQL Developer也连接不上.立即使用SecureCRT连接上了这台服务器,从下面几个方面检查. 1:检查了数据库的状态是否正常 $ sqlplus / ...

  10. TNS-12560: TNS: 协议适配器错误

    TNS-12560: TNS: 协议适配器错误   Microsoft Windows [版本 5.2.3790] (C) 版权所有 1985-2003 Microsoft Corp. C:\Docu ...

随机推荐

  1. IDEA Edit Configuration解决隐藏了不见了

    IDEA Edit Configuration解决隐藏了不见了 IDEA Edit Configuration解决隐藏了不见了,我的IDEA版本是2020.3.4,某天按了哪个快捷键导致不见了.按Al ...

  2. [Luogu 4912 帕秋莉的魔法] 题解报告

    算法:DP, 背包,动态规划 简化版题目: 给定 \(n\) 个物品,物品的价值为 \(v_1 - v_n\),物品的体积为 \(w_1 - w_n\).需要选择一些物品,使它们的体积和为 \(V\) ...

  3. C++篇:第十一章_标准库_知识点大全

    C++篇为本人学C++时所做笔记(特别是疑难杂点),全是硬货,虽然看着枯燥但会让你收益颇丰,可用作学习C++的一大利器 十一.标准库 include头文件: ① 一般来说,导入objective c的 ...

  4. 技术实践丨GaussDB(DWS)运维管理功能“升级”的原理和使用

    摘要:本文将详细介绍GaussDB(DWS)重要运维管理功能"升级"的原理和使用. 运维管理模块是任何软件产品最基础和重要的一部分.是软件产品的门户,也是用户接触和使用软件产品的和 ...

  5. 实践案例丨GaussDB网络重传/丢包问题定位总结

    摘要:本文将介绍几种常用手段,用于梳理数据库网络故障可能存在的问题,从而快速定位恢复. 1 问题背景 在GaussDB各类问题场景中,网络故障是最难定位及恢复的问题之一,其不仅可能影响着数据库的性能, ...

  6. 云小课|使用SQL加密函数实现数据列的加解密

    摘要:数据加密作为有效防止未授权访问和防护数据泄露的技术,在各种信息系统中广泛使用.作为信息系统的核心,GaussDB(DWS)数仓也提供数据加密功能,包括透明加密和使用SQL函数加密. 本文分享自华 ...

  7. 想快速重构智慧园区5A系统,这份方案推荐给你

    摘要:近年来,园区的数字化一直在演进,从OA.CA.BA.SA.FA等单一系统的信息化建设,到以应用为主导的大系统集成,再到以云.大数据为基础的数据开放平台构建,继而进入全量数据融合.数字技术泛在的智 ...

  8. THOR:MindSpore 自研高阶优化器源码分析和实践应用

    摘要:这篇文章跟大家分享下THOR的实践应用.THOR算法的部分内容当前已经在MindSpore中开源 本文分享自华为云社区<MindSpore 自研高阶优化器源码分析和实践应用>,原文作 ...

  9. 云小课 | MRS基础入门之HDFS组件介绍

    摘要:HDFS是MapReduce服务中的基础文件系统,全称为Hadoop的分布式文件系统(Hadoop Distributed File System),可支持实现大规模数据可靠的分布式读写. 本文 ...

  10. 论文解读:ACL2021 NER | 基于模板的BART命名实体识别

    摘要:本文是对ACL2021 NER 基于模板的BART命名实体识别这一论文工作进行初步解读. 本文分享自华为云社区<ACL2021 NER | 基于模板的BART命名实体识别>,作者: ...