现象:在数据库A 通过DB_LINK  对B数据库操作,长时间不返回,hang死在里面

解决方法:在数据库B上的sqlnet.ora文件里增加参数:
SQLNET.EXPIRE_TIME=10

10代表作0分钟

扩展:

当设置了resource_limit=true 。通过idle_time限制session idle 时间。session idle超过设置时间,状态为sniped (v$session).,然而OS下的process并不会释放,当session(user process) 再次与server process 通讯,将关闭相应的server process.

sqlnet.expire_time 的原理不一样,Oracle Server 发送包探测dead connection ,如果连接关闭,或者不再用,则关闭相应的server process.

以上两者组合使用,减少server process,防止process超过init$ORACLE_SID极限值。

DCD: Dead Connection Detection ,可以用于检测、标记僵死而没有断开会session,再由PMON进行清理,释放资源。
开启DCD,只需要在服务端的sqlnet.ora文件中添加SQLNET.EXPIRE_TIME参数,单位为分钟:

SQLNET.EXPIRE_TIME=10

如果时间达到这个值,server端就是发出一个”probe” packet 给客户端,如要客户断是正常的,这个packet就被忽略,timer重新计时;如果客户端异常中断,则server端就会收到一个消息,用以释放连接。

E文原文:

sqlnet.expire_time actually works on a different principle and is used to detect dead connectionsas opposed to disconnecting(actually 'sniping') a session based on idle_time which the profile accomplishes.

Sqlnet.expire_time basically instructs the Server to send a probe packet every set minutes to the client , and if it finds a terminated connection or a connection that is no longer in use, causes the associated server process to terminate on the server.
A valid database connection that is idle will respond to the probe packet causing no action on the part of the Server , whereas the resource_limit will snipe the session when idle_time is exceeded.The 'sniped' session will get disconnected when the user(or the user process) tries to communicate with the server again.
But again,as you mentioned, expire_time works globally while idle_time profile works for that user. You can use both of them to make sure that the client not only gets sniped but also gets disconnected if the user process abnormally terminates.

转载于:https://www.cnblogs.com/jimeper/archive/2012/07/11/2586591.html

db link hang的解决方法相关推荐

  1. SVN报错:can‘t open file db/txn-current-lock:permission denied 解决方法

    SVN报错:can't open file db/txn-current-lock:permission denied 解决方法 参考文章: (1)SVN报错:can't open file db/t ...

  2. SVN报错:can't open file db/txn-current-lock:permission denied 解决方法

    现象: SVN服务器重启后,重新挂载SVN仓库,可以下载代码,但是上传代码发现报错:can't open file db/txn-current-lock:permission denied 刚开始以 ...

  3. 连接数据库报错com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure的解决方法

    控制台报错 Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure com. ...

  4. Pcie(igb)网卡调试总结:tx uint hang异常解决方法

    前段时间做pcie网卡的适配工作,使用的网卡是Intel 1350; 环境是ARM 利用ismod xx.ko 安装上驱动后,会产生一个内核警告的异常,然后之后的通讯就会持续产生tx unit han ...

  5. Linux系统中提示/usr/bin/ld: cannot find -lxxx错误的解决方法

    报错说明 /usr/bin/ld: cannot find -lxxx 这些讯息会随着编译不同类型的source code 而有不同的结果出来如: /usr/bin/ld: cannot find - ...

  6. 突出重围:Oracle 10.2.0.5应用SCN补丁解决DB Link预警实践

    点击▲关注 "数据和云"   给公众号标星置顶 更多精彩 第一时间直达 作者:赵靖宇,云和恩墨北区交付工程师,长期服务于运营商.保险.医院.政府等行业,擅长Oracle数据库故障处 ...

  7. linux 有线网卡,linux下有线网卡出现ADDRCONF(NETDEV_UP): eth0: link is not ready的解决方法...

    一.背景 2018年5月24日,笔者的pc已经连续运转两天了,突然要使用有线网卡,却发现有线网卡无法正常工作,于是查看了一下内核日志: r8169 0000:05:00.0 eth0: link do ...

  8. 错误/异常:java.io.FileNotFoundException: .\src\db.properties (系统找不到指定的路径。);的解决方法...

    1.异常视图 2.解决方法 与之相关的部分代码: 1 static{ 2 try { 3 //读取db.properties 4 Properties props = new Properties() ...

  9. django.db.utils.OperationalError: (1050, “Table ‘表名‘ already exists)解决方法

    django.db.utils.OperationalError: (1050, "Table '表名' already exists)解决方法 参考文章: (1)django.db.uti ...

最新文章

  1. pythonWeb UI自动化最流行的工具 解放双手 双手打字以示清白!
  2. ostu进行遥感图像的分割
  3. 前端学习(2935):v-for案例
  4. mysql 5.7 延迟同步_MySQL5.6升级5.7时出现主从延迟问题排查过程
  5. 【Python】基础总结
  6. 【kafka】kafka Kafka分区leader迁移
  7. 【linux指令】dialog实现终端下的GUI-1
  8. 0基础学python有多难-0基础学Python有多难?
  9. python searchsorted_Python 二分查找与 bisect 模块
  10. 一个web项目web.xml的配置中context-param配置作用
  11. 笔记本Win10系统关于启动禁用触控板设置
  12. 关注这场直播,了解能源行业双碳目标实现路径
  13. c/c++ string转int int转string string拼接
  14. javafx 教程_何时使用JavaFX代替HTML
  15. LINUX系统的特点
  16. 搜索技术——遗传算法
  17. 模电学习5. 耦合电容、去耦电容与旁路电容
  18. 中国电竞20年:从小众娱乐到新兴体育产业
  19. 匕首线切割图纸下载_匕首击剑简介
  20. 深度学习最佳图书推荐(2019版)

热门文章

  1. matlab字符串转换
  2. OPNET网络仿真分析-目 录
  3. 知名互联网公司系统架构图[第1期]
  4. matlab2c使用c++实现matlab函数系列教程-ones函数
  5. MySQL(四)InnoDB中一棵B+树能存多少行数据
  6. UVA10838 The Pawn Chess
  7. asp.net GridView控件的列属性
  8. 转 java中static{}语句块详解
  9. flex怎么设置调用的外部浏览器
  10. Nautilus获得了标签化支持