代码改变世界

Oracle:检查被锁数据在V$LOCK中的情况

2011-12-27 14:59  Tracy.  阅读(819)  评论(0编辑  收藏  举报
/* Formatted on 12/27/2011 2:55:58 PM (QP5 v5.163.1008.3004) */
SELECT (SELECT username
          FROM v$session
         WHERE sid = v$lock.sid)
          username,
       sid,
       id1,
       id2,
       lmode,
       request,
       block,
       v$lock.TYPE
  FROM v$lock
 WHERE sid IN (SELECT sid
                 FROM v$mystat
                WHERE ROWNUM = 1)