锁表处理及查询
查看Oracle数据库被锁住的表,删除锁表的进程
1.查看被锁住的表
SELECT dob.object_name table_name,
lo.locked_mode,
lo.session_id,
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 ‘session_id, serial#‘;
时间: 2024-10-05 03:38:21