日期:2014-05-16 浏览次数:20552 次
1.获取出sid,serial 用于解锁的参数
select s.username, s.osuser, s.sid, s.serial#, p.spid from v$session s,v$process p
where s.paddr = p.addr and s.username is not null;
select 'alter system kill session ',''''||trim(t2.sid)||','||trim(t2.serial#)||''';'
from v$locked_object t1,v$session t2 where t1.session_id=t2.sid order by t2.logon_time;
2.执行sql进行解锁
--alter system kill session 'sid,serial#';
alter system kill session '156,87';