zoukankan      html  css  js  c++  java
  • oracle查锁表

    查锁表:

    SELECT l.inst_id ,s.MACHINE, client_info, s.sid, s.serial# ,object_name, os_user_name,oracle_username ,
    locked_mode, s.program,prev_exec_start,logon_time, wmsys.wm_concat(c.sql_text) sql
    FROM gv$locked_object l, dba_objects o, gv$session s , gv$open_cursor c
    WHERE l.object_id = o.object_id
    AND l.session_id = s.sid
    and l.inst_id=c.inst_id
    and s.sid=c.sid
    and l.inst_id=s.inst_id
    group by l.inst_id ,s.MACHINE, client_info, s.sid, s.serial# ,object_name, os_user_name,oracle_username ,
    locked_mode, s.program,prev_exec_start,logon_time;


    select a.SID,b.sid,a.block,a.TYPE,b.request,
    (select username||':'||sid||','||serial# from gv$session where sid=a.sid and inst_id=a.inst_id) ||
    ' 阻塞了 ' ||
    (select username ||':'||sid||','||serial# from gv$session where sid=b.sid and inst_id=b.inst_id)
    ,(select 'alter system kill session '''||sid||','||serial#||''' immediate;'from gv$session where sid=a.sid and inst_id=a.inst_id)
    from gv$lock a, gv$lock b
    where a.block>0
    and b.request > 0
    and a.id1 = b.id1
    and a.id2 = b.id2
    and a.sid<>b.sid ;

  • 相关阅读:
    [状压DP][二分]JZOJ 3521 道路覆盖
    字符串操作
    练习: 判断一个数是否为小数
    Python 深浅拷贝
    编码
    python中的 == 和 is 的区别
    Python3 字典的增删改查
    Python3 列表的基本操作
    初识 Python
    方法的入门
  • 原文地址:https://www.cnblogs.com/shanzzs/p/11669448.html
Copyright © 2011-2022 走看看