ORA-00031 session ed for killCause: The session specified in an ALTER SYSTEM KILL SESSION command cannot be killed immediately because the session is involved in a non-interruptible operation (for example, rolling back a transaction or being blocked by a network operation). The session has been ed to be killed as soon as possible after the current operation is done.
没有被立即杀死因为会话在进行不可中断的操作(比如,正在回滚一个事务或者被网络操作阻塞)。当前操作完成,会话马上被标记为killed
Action: No action is required for the session to be killed, but further executions of the ALTER SYSTEM KILL SESSION command on this session may cause the session to be killed sooner.

解决方案 »

  1.   

    如果你的这个事务不重要,你可以在系统中用KILL -9 SID强制杀了它
      

  2.   

    可以通过alter system kill session ‘sid,serial#’来杀掉会话 SELECT /*+ rule */ s.username,  decode(l.type,'TM','TABLE LOCK',                'TX','ROW LOCK',                NULL) LOCK_LEVEL,  o.owner,o.object_name,o.object_type,  s.sid,s.serial#,s.terminal,s.machine,s.program,s.osuser  FROM v$session s,v$lock l,dba_objects o  WHERE l.sid = s.sid  AND l.id1 = o.object_id(+)  AND s.username is NOT NULL
      

  3.   

    ORACLE鎖的管理
    本文由gototop根據yufeng的文章略加修改。 http://www.ncn.cn/  
    ORACLE裏鎖有以下幾種模式:
    0:none
    1:null 空
    2:Row-S 行共用(RS):共用表鎖,sub share 
    3:Row-X 行獨占(RX):用于行的修改,sub exclusive 
    4:Share 共用鎖(S):阻止其他DML操作,share
    5:S/Row-X 共用行獨占(SRX):阻止其他事務操作,share/sub exclusive 
    6:exclusive 獨占(X):獨立訪問使用,exclusive數位越大鎖級別越高, 影響的操作越多。1級鎖有:Select,有時會在v$locked_object出現。
    2級鎖有:Select for update,Lock For Update,Lock Row Share 
    select for update當對話使用for update子串打開一個游標時,所有返回集中的資料行都將處于行級(Row-X)獨占式鎖定,其他物件只能查詢這些資料行,不能進行update、delete或select for update操作。
    3級鎖有:Insert, Update, Delete, Lock Row Exclusive
    沒有commit之前插入同樣的一條記錄會沒有反應, 因爲後一個3的鎖會一直等待上一個3的鎖, 我們必須釋放掉上一個才能繼續工作。
    4級鎖有:Create Index, Lock Share
    locked_mode爲2,3,4不影響DML(insert,delete,update,select)操作, 但DDL(alter,drop等)操作會提示ora-00054錯誤。
    00054, 00000, "resource busy and acquire with NOWAIT specified"
    // *Cause: Resource interested is busy.
    // *Action: Retry if necessary.
    5級鎖有:Lock Share Row Exclusive 
    具體來講有主外鍵約束時update / delete ... ; 可能會産生4,5的鎖。
    6級鎖有:Alter table, Drop table, Drop Index, Truncate table, Lock Exclusive以DBA角色, 查看當前資料庫裏鎖的情况可以用如下SQL語句:col owner for a12
    col object_name for a16
    select b.owner,b.object_name,l.session_id,l.locked_mode
    from v$locked_object l, dba_objects b
    where b.object_id=l.object_id
    /select t2.username,t2.sid,t2.serial#,t2.logon_time 
    from v$locked_object t1,v$session t2 
    where t1.session_id=t2.sid order by t2.logon_time
    /如果有長期出現的一列,可能是沒有釋放的鎖。我們可以用下面SQL語句殺掉長期沒有釋放非正常的鎖:alter system kill session 'sid,serial#';如果出現了鎖的問題, 某個DML操作可能等待很久沒有反應。當你采用的是直接連接資料庫的方式,也不要用OS系統命令 $kill process_num 或者 $kill -9 process_num來終止用戶連接,因爲一個用戶進程可能産生一個以上的鎖, 殺OS進程幷不能徹底清除鎖的問題。
      

  4.   

    beckhambobo(beckham):的方法我用过,可以的!