欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

查询Oracle对象lock信息

程序员文章站 2024-04-03 21:31:04
...

查询Oracle对象lock信息,方便解锁 无 SELECT /*+ rule */ s.username, DECODE (l.TYPE, 'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', NULL ) lock_level, o.owner, o.object_name, o.object_type, s.SID, s.serial#, s.terminal, s.machine, s.program, s.osuser

查询Oracle对象lock信息,方便解锁
SELECT /*+ rule */
       s.username,
       DECODE (l.TYPE,
               'TM', 'TABLE LOCK',
               'TX', 'ROW LOCK',
               NULL
              ) lock_level, o.owner, o.object_name, o.object_type, s.SID,
       s.serial#, s.terminal, s.machine, s.program, s.osuser
  FROM v$session s, v$lock l, dba_objects o
 WHERE l.SID = s.SID AND l.id1 = o.object_id(+) AND s.username IS NOT NULL