码迷,mamicode.com
首页 > 数据库 > 详细

Oracle 查看锁情况

时间:2018-11-23 14:10:59      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:objects   use   font   share   revenue   action   style   mod   from   

 

/*查看锁(lock)情况*/
SELECT ls.osuser os_user_name,
       ls.username user_name,
       decode(ls.type,
              RW,
              Row wait enqueue lock,
              TM,
              DML enqueue lock,
              TX,
              Transaction enqueue lock,
              UL,
              User supplied lock) lock_type,
       o.object_name OBJECT,
       decode(ls.lmode,
              1,
              NULL,
              2,
              Row Share,
              3,
              Row Exclusive,
              4,
              Share,
              5,
              Share Row Exclusive,
              6,
              Exclusive,
              NULL) lock_mode,
       o.owner,
       ls.sid,
       ls.serial# serial_num,
       ls.id1,
       ls.id2
  FROM sys.dba_objects o,
       (SELECT s.osuser,
               s.username,
               l.type,
               l.lmode,
               s.sid,
               s.serial#,
               l.id1,
               l.id2
          FROM v$session s, v$lock l
         WHERE s.sid = l.sid) ls
 WHERE o.object_id = ls.id1
   AND o.owner <> SYS
   AND o.object_name = CUX_CUX_PA_REVENUE_COST_TEMP
 ORDER BY o.owner, o.object_name
;

 

Oracle 查看锁情况

标签:objects   use   font   share   revenue   action   style   mod   from   

原文地址:https://www.cnblogs.com/jenrry/p/10006774.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!