oracle锁表

SELECT /*+ rule */
 'alter system kill session ''' || s.sid || ',' || s.serial# || ''';' sql_test,
 s.username,
 decode(l.type, 'TM', '表 LOCK', 'TX', '行 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 l.type = 'TM'
   AND s.username is NOT Null;
posted @ 2020-08-25 17:10  fight139  阅读(143)  评论(0编辑  收藏  举报