下面代码可以搞定:
sql 代码
- SELECT s.SID, s.machine, o.object_name, l.oracle_username, l.locked_mode,
- 'ALTER SYSTEM KILL SESSION '''
- || s.SID
- || ', '
- || s.serial#
- || ''';' Command
- FROM v$locked_object l, v$session s, all_objects o
- WHERE l.session_id = s.SID AND l.object_id = o.object_id;