zoukankan      html  css  js  c++  java
  • 如何彻底杀死Oracle会话

    当你觉得一个长时间运行的一个PL/SQL,有问题时需要立即中止,怎么办:有两种方法:
    1.执行
    alter system kill session 'sid,serial#'
        这里的sid,serial# 可以在V$Session中找到。执行这个命令,有时候不一定有效。而且看起来杀掉了,
        但是使用的相关资源,也不一定被释放了。那么这时候就要用到下面这种方法了:
    2.操作系统级的命令OraKill
       这个命令是Oracle自带的命令,在Oracle_Home的bin目录下。
       执行不带任何参数的OraKill, 会给出下面的提示:
        
    Usage:  orakill sid thread
         where sid    = the Oracle instance ID to target
            thread = the thread id of the thread to kill
          The thread id should be retrieved from the spid column of a query such as:

            select spid, osuser, s.program from
            v$process p, v$session s where p.addr=s.paddr


         这个命令瞬间会把相关的进程杀掉,所以使用的时候一定要小心。
         相关的文章,请参见http://www.eygle.com/faq/Kill_Session.htm





  • 相关阅读:
    梦断代码阅读笔记之一
    你的灯亮着吗阅读笔记之三
    第二次冲刺第八天
    第二次冲刺第七天
    价格计算
    第二次冲刺第六天
    构建之法阅读笔记06
    第二阶段冲刺第五天
    第二阶段冲刺第四天
    第二阶段冲刺第三天
  • 原文地址:https://www.cnblogs.com/SharkXu/p/OraleKillSession.html
Copyright © 2011-2022 走看看