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

数据库查锁

程序员文章站 2022-03-07 15:55:07
...

SELECT lpad(' ', decode(l.xidusn, 0, 3, 0)) || l.oracle_username User_name,
       o.owner,
       o.object_name,
       o.object_type,
       s.sid,
       s.serial#,
       'alter system kill session ''' || s.SID || ',' || s.SERIAL# || ''';'
  FROM v$locked_object l, dba_objects o, v$session s
 WHERE l.object_id = o.object_id
   AND l.session_id = s.sid
 ORDER BY o.object_id, xidusn DESC

相关标签: Oracle