zoukankan      html  css  js  c++  java
  • db link hang的解决方法

    现象:在数据库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.



     

  • 相关阅读:
    并发编程 ~~~ 多进程~~~进程创建的两种方式, 进程pid, 验证进程之间的空间隔离, 进程对象join方法, 进程对象其他属性
    并发编程 ~~~ 多进程
    网络编程~~~~socketserver服务端
    网络编程~~~~粘包
    聊聊主流加密算法及该如何设计我们的用户密码
    Spring Boot Security 保护你的程序
    Spring Boot接口如何设计防篡改、防重放攻击
    Spring Boot 整合 Shiro实现认证及授权管理
    Spring Boot Quartz 分布式集群任务调度实现
    Spring Boot Redis 解析
  • 原文地址:https://www.cnblogs.com/jimeper/p/2586591.html
Copyright © 2011-2022 走看看