zoukankan      html  css  js  c++  java
  • oracle查锁及解锁命令

    --查询行锁语句

    select sql_text from v$sql a,v$session b
    where a.sql_id=b.sql_id and b.event='enq: TX - row lock contention';
    

    --找到被锁定的表

    SELECT object_name, machine, s.sid, s.serial#
    FROM gv$locked_object l, dba_objects o, gv$session s
    WHERE l.object_id = o.object_id
    AND l.session_id = s.sid;
    

     --解锁命令

    ALTER SYSTEM KILL SESSION '11,48547';
    
     

     或者用以下命令查出来后执行ALTER SYSTEM KILL SESSION '''||s.sid||', '||s.serial#||

    select     s.sid,s.machine,o.object_name,l.oracle_username,l.locked_mode,       
    'ALTER     SYSTEM     KILL     SESSION     '''||s.sid||', '||s.serial#||''';' Command       
    from     v$locked_object     l,v$session     s,all_objects     o       
    where     l.session_id=s.sid     and     l.object_id=o.object_id; 
    

     

  • 相关阅读:
    DHCP
    NFS
    GlusterFS
    作文学习笔记[1]
    围绕中心进行写作
    阅读学习笔记[1]
    作文学习笔记[2]
    心理描写的方法
    多彩的活动
    阅读理解答题步骤
  • 原文地址:https://www.cnblogs.com/Dev0ps/p/9089947.html
Copyright © 2011-2022 走看看