oracle数据库有锁住的情况下,批量解锁的脚本
程序员文章站
2022-07-05 11:50:44
...
declare
cursor mycur is
select b.sid,b.serial#
from v$locked_object a,v$session b
where a.session_id = b.sid group by b.sid,b.serial#;
begin
for cur in mycur loop
execute immediate ( 'alter system kill session '''||cur.sid || ','|| cur.SERIAL# ||''' ');
end loop;
end;
转载于:https://my.oschina.net/yck108/blog/423850