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 ;

  • 相关阅读:
    递归分治策略
    矩阵连乘问题
    棋盘覆盖问题
    选择排序
    Dijkstra的双栈算术表达式求值算法
    斐波那契数列
    二分算法
    Linux服务器上tengine的安装配置
    Excel Sheet Column Number
    Excel Sheet Column Title
  • 原文地址:https://www.cnblogs.com/shanzzs/p/11669448.html
Copyright © 2011-2022 走看看