问题描述:

  oracle使用过一段时间,连接断开,报ORA-03135错误。

  问题挖掘:

  用pl/sql和sqlplus连接oracle,也存在该问题,确定该问题与连接方式无关。

  查看服务器,发现没有防火墙,防火墙因素排除。

  ping -t 服务器地址,发现没有丢包,都100%收到,网络通畅。

  基本可以肯定问题出在oracle参数配置上。但也不排除其他因素。

  解决过程:

  根据ora-03135查询到oracle官方的解决方案:

  ORA-03135: connection lost contact

  Cause: 1) Server unexpectedly terminated or was forced to terminate. 2) Server timed out the connection.

  Action: 1) Check if the server session was terminated. 2) Check if the timeout parameters are set properly in sqlnet.ora.

  查询相关资料,发现该问题可能与sqlnet.ora设置参数SQLNET.EXPIRE_TIME 有关。因此在server上面的sqlnet.ora设置参数SQLNET.EXPIRE_TIME = 5(需在服务器监听reload一下使参数生效:lsnrctl reload),而在client不设置该参数,。等待一段时间后,没有出现该问题了,问题解决。

  知识扩展:

  在server端的sqlnet.ora文件中设置SQLNET.EXPIRE_TIME这一参数可以启用DCD功能,DCD是Dead Connection Detection的缩写,用于检查死掉但没有断开的session。

  例如:

  SQLNET.EXPIRE_TIME = 20

  可以设置为任意数值,单位分钟。

  重启listener

  bash-2.05$ lsnrctl reload

  ……

  The command completed successfully

  DCD可以用于防止防火墙的timeout。

  当新连接建立的时候,会读取sqlnet.ora中的这一设定,当20分钟间隔到达时,对inactive的session发送”probe” SQL*NET packet来确认client是否活着。如果已经死掉,那么相对应的resource会被自动清除。

  如果client和server中间有防火墙,防火墙设有timeout参数,例如设置为一个小时,当一个小时中client和server间没有数据传输的时候,防火墙会断开连接。开启DCD后,通过设置SQLNET.EXPIRE_TIME的值小于防火墙的timeout参数可以避免这一情况。 “probe” package确保防火墙不会断开idle的session。

  大多数情况下,这样操作就好了,要是还是不行就进行停止oracle实例和重启操作

  1、启动数据库:

  oracle@suse92:~> sqlplus /nolog

  SQL*Plus: Release 9.2.0.4.0 - Production on Fri Jan 20 02:29:37 2006

  Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

  SQL> connect /as sysdba

  Connected to an idle instance.

  SQL> startup

  ORACLE instance started.

  Total System Global Area 135352820 bytes

  Fixed Size 455156 bytes

  Variable Size 109051904 bytes

  Database Buffers 25165824 bytes

  Redo Buffers 679936 bytes

  Database mounted.

  2、关闭数据库:

  oracle@suse92:~> sqlplus /nolog

  SQL*Plus: Release 9.2.0.4.0 - Production on Fri Jan 20 02:29:37 2006

  Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

  SQL> connect /as sysdba

  Connected to an idle instance.

  SQL> shutdwon abort;

  3、启动监听器

  oracle@suse92:~> lsnrctl start

  4、停止监听器

  oracle@suse92:~> lsnrctl stop

  5、查看监听器状态

  lsnrctl">oracle@suse92:~>lsnrctl

  LSNRCTL> status

  LSNRCTL> exit

  参考资料:

  sqlnet.ora http://www.orafaq.com/wiki/Sqlnet.ora

  oracle DCD http://www.dbafan.com/blog/?p=174

  sqlnet.expire_time and IDLE_TIME http://space.itpub.net/10687595/viewspace-420407

  SQLNET.EXPIRE_TIME 的官方说明

  Purpose

  Use parameter SQLNET.EXPIRE_TIME to specify a the time interval, in minutes, to send a probe to verify that client/server connections are active. 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, 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 performance.

  Default

  0

  Minimum Value

  0

  Recommended Value

  10

  Example

  SQLNET.EXPIRE_TIME=10(编辑:雷林鹏 来源:网络)

oracle10g连接自动断开,报ORA-03135错误的更多相关文章

  1. SSH连接自动断开的解决方法(deb/rpm)

    ######### 修改后的: ## # tail -f -n 20 sshd_config#MaxStartups 10:30:60#Banner /etc/issue.net # Allow cl ...

  2. 【原创】大叔经验分享(22)securecrt连接自动断开

    securecrt一段时间没有操作连接就会自动断开(xshell就没有这个问题),提示信息为:信号灯超时时间已到,解决方法为: Options -- Session Options -- Termin ...

  3. [大数据技术]Kettle初次连接MySQL数据库 报错问题 错误连接数据库 Error occured while trying to connect to the database Exception while loading class org.gjt.mm.mysql.Driver

    报错内容如下: 错误连接数据库 [foodmartconn] : org.pentaho.di.core.exception.KettleDatabaseException: Error occure ...

  4. 升级Ubuntu 16.04 LTS后 DSL拨号上网(ppp)连接自动断开解决办法

    原本在Ubuntu 15.10用拨号上网没有问题,但升级了16.04 LTS后发现原来的DSL连接不上了.主要表现为: 1.在NetworkManager里面选择DSL Connection能够尝试拨 ...

  5. 转: xshell远程连接自动断开的问题解决办法

    转:http://blog.csdn.net/haijiaoqihao20160106/article/details/50623431 2.客户端的配置 Keep Alive修改.我的xshell的 ...

  6. linux ssh连接自动断开问题

    场景描述:云上的虚拟机使用public ip连接ssh时,一直提示已经连接,但是就会自动关闭 1. 通过正常虚拟机作为跳板,能够连接到目标机子上,检查发现进程正常,但是就一直连接不上 [root@te ...

  7. 使用navicat连接mysql要报10038的错误

    1.mysql的设置 (1)授权mysql>grant all privileges on *.*  to  'root'@'%'  identified by 'youpassword'  w ...

  8. 关于oracle 11g导出数据时 报 ORA 1455错误的处理

    因为导出的该用户的表可能存在空数据表,那么可能就会出现此其异常. 首先:  查看:     SQL>show parameter deferred_segment_creation;  假设为T ...

  9. plsql 连接oralce数据库,报ora 12557 tns 协议适配器不可加载错误

    使用plsql 连接oracle 数据库报ora 12557 错误: 解决方案: 1:首先确保服务中的service以及监听器都开启 2:F:\app\Administrator\product\11 ...

随机推荐

  1. mysql数据库新插入数据,需要立即获取最新插入的id

    在MySQL中,使用auto_increment类型的id字段作为表的主键.通常的做法,是通过“select max(id) from tablename”的做法,但是显然这种做法需要考虑并发的情况, ...

  2. Codeforces Round #434 (Div. 2, based on Technocup 2018 Elimination Round 1)

    A. k-rounding 题目意思:给两个数n和m,现在让你输出一个数ans,ans是n倍数且末尾要有m个0; 题目思路:我们知道一个数末尾0的个数和其质因数中2的数量和5的数量的最小值有关系,所以 ...

  3. 您好,python的请求es的http库是urllib3, 一个请求到贵司的es节点,想了解下,中间有哪些网关啊?冒昧推测,贵司的部分公共网关与python-urllib3的对接存在异常?

    您好,python的请求es的http库是urllib3, 一个请求到贵司的es节点,想了解下,中间有哪些网关啊?冒昧推测,贵司的部分公共网关与python-urllib3的对接存在异常? 负载均衡( ...

  4. C# WinForm实现任务栏程序图标闪烁

    相信大家在用QQ的时候都会知道,你打开了QQ聊天窗口,如果窗口不是当前激活的窗口的话,收到QQ消息时,任务栏(不是托盘图标)上的图标会闪一下变成黄色(Win7默认主题下),用以通知用户有消息进来了,之 ...

  5. Python开发【数据结构】:基础

    数据结构 什么是数据结构? 简单来说,数据结构就是设计数据以何种方式组织并存储在计算机中. 比如:列表.集合与字典等都是一种数据结构 N.Wirth: “程序=数据结构+算法” 列表 列表:在其他编程 ...

  6. mysql 数据操作 多表查询 子查询 带EXISTS关键字的子查询

    带EXISTS关键字的子查询 EXISTS关字键字表示存在. EXISTS 判断某个sql语句的有没有查到结果 有就返回真  true 否则返回假 False 如果条件成立 返回另外一条sql语句的返 ...

  7. docker镜像文件导入与导出,支持批量

    工作中经常需要拉取一些国外的镜像,但是网络限制等原因在公司拉取很慢,所以我习惯用亚马逊服务器拉取镜像,导出后下载到本地再导入开发环境 1. 查看镜像id sudo docker images REPO ...

  8. 离线安装部署zabbix

    一. 安装好CentOS安装过程中添加php,mariadb等所需要的依赖 二. 准备好所有所需的rpm压缩文件包在centos中解压,这里放在根目录下zabbix_rpms文件夹下 三. 安装所需r ...

  9. 超全超详细的 ADB 用法大全

    原文地址:原文地址 基本用法 命令语法 为命令指定目标设备 启动/停止 查看 adb 版本 以 root 权限运行 adbd 指定 adb server 的网络端口 设备连接管理 查询已连接设备/模拟 ...

  10. python16_day37【爬虫2】

    一.异步非阻塞 1.自定义异步非阻塞 import socket import select class Request(object): def __init__(self,sock,func,ur ...