oracle数据库,表被锁,如何解锁?

2017-12-07 20:11:07来源:cnblogs.com作者:千年虫虫人点击

分享

4.批量解锁
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;

微信扫一扫

第七城市微信公众平台