zoukankan      html  css  js  c++  java
  • oracle 互锁的sql查询

    SELECT DECODE(request, 0, 'Holder: ', 'Waiter: ') || sid sess,
           id1,
           id2,
           lmode,
           request,
           type
      FROM V$LOCK
     WHERE (id1, id2, type) IN
           (SELECT id1, id2, type FROM V$LOCK WHERE request > 0)
     ORDER BY id1, request;

    select blkingsess.sid blockingsid, blkedsess.sid blockedsid
      from v$lock blkingsess,
           (select * from v$lock where request != 0) blkedsess
     where blkingsess.id1 = blkedsess.id1
       and blkingsess.id2 = blkedsess.id2
       and blkingsess.sid != blkedsess.sid;

    select s.sql_id, s.sql_text, v.sid, v.machine
      from v$sql S, v$session V
     where s.address = v.sql_address
       and v.sid in (select blkedsess.sid blockedsid
                       from v$lock blkingsess,
                            (select * from v$lock where request != 0) blkedsess
                      where blkingsess.id1 = blkedsess.id1
                        and blkingsess.id2 = blkedsess.id2
                        and blkingsess.sid != blkedsess.sid)
    union
    select s.sql_id, s.sql_text, v.sid, v.machine
      from v$sql S, v$session V
     where s.address = v.sql_address
       and v.sid in (select blkingsess.sid blockingsid
                       from v$lock blkingsess,
                            (select * from v$lock where request != 0) blkedsess
                      where blkingsess.id1 = blkedsess.id1
                        and blkingsess.id2 = blkedsess.id2
                        and blkingsess.sid != blkedsess.sid);
    ;

  • 相关阅读:
    Docker最全教程之MySQL容器化 (二十四)
    Docker最全教程之使用Node.js搭建团队技术文档站(二十三)
    Docker最全教程之使用PHP搭建个人博客站点(二十二)
    构建自己的简单微服务架构(开源)
    使用Jmeter进行http接口测试
    Appium 服务关键字
    Appium入门示例(Java)
    Appium for win7 环境搭建
    android adb常用指令
    Android测试环境搭建(win7)
  • 原文地址:https://www.cnblogs.com/seasonzone/p/3761545.html
Copyright © 2011-2022 走看看