查看Oracle数据库被锁住的表,并删除锁表的进程
--1.查看被锁住的表
SELECT dob.object_name table_name,
lo.locked_mode,
lo.session_id sid,
vss.serial#,
vss.action action,
vss.osuser osuser,
vss.logon_time,
vss.process ap_pid,
vps.spid db_pid
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 dob.object_name;
--2.删除锁表的进程
ALTER system kill session 'sid, serial#';