SELECT dob.object_name table_name,
lo.locked_mode,
lo.session_id,
vss.serial#,
vss.status,
vps.spid,
vss.action action,
vss.osuser osuser,
vss.machine, --机器名
vss.terminal, --终端
vss.client_identifier, --客户端标识符
vss.process ap_pid,
vps.spid db_pid,
'alter system kill session '
|| ''''
|| lo.session_id
|| ','
|| vss.serial#
|| ''';'
kill_command
FROM v$locked_object lo,
dba_objects dob,
v$session vss,
v$process vps
WHERE lo.object_id = dob.object_id
AND lo.session_id = vss.sid
AND vss.paddr = vps.addr
ORDER BY 2, 3, dob.object_name;
lo.locked_mode,
lo.session_id,
vss.serial#,
vss.status,
vps.spid,
vss.action action,
vss.osuser osuser,
vss.machine, --机器名
vss.terminal, --终端
vss.client_identifier, --客户端标识符
vss.process ap_pid,
vps.spid db_pid,
'alter system kill session '
|| ''''
|| lo.session_id
|| ','
|| vss.serial#
|| ''';'
kill_command
FROM v$locked_object lo,
dba_objects dob,
v$session vss,
v$process vps
WHERE lo.object_id = dob.object_id
AND lo.session_id = vss.sid
AND vss.paddr = vps.addr
ORDER BY 2, 3, dob.object_name;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7423319/viewspace-2141896/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7423319/viewspace-2141896/