oracle数据库 锁表解锁 批量解锁

oracle数据库 锁表解锁 批量解锁

《PS:留下小赞赞,比心比心》

ORACLE中查看当前系统中锁表情况:
select object_name,machine,s.sid,s.serial#
from v$locked_object l,dba_objects o ,v$session s
where l.object_id = o.object_id and l.session_id=s.sid;

ORACLE解锁的方法 (单个解锁)
alter system kill session '13,298';

ORACLE解锁的方法 (多个解锁)
select a.object_name,b.session_id,c.serial#,'alter system kill session '''||b.session_id||','||c.serial#||'''; ' as a,c.program,c.username,c.command,c.machine,c.lockwait
from all_objects a,v$locked_object b,v$session c where a.object_id=b.object_id and c.sid=b.session_id;

你可能感兴趣的:(oracle)