當發現於Developer下Script時,ScriptRunner一直在跑都不會停的時候,請先暫停該Query。
1. 查出哪隻Session將Table lock住了
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.object_id;
2. 取得該Session SID與SERIAL#,順便可以看是哪個SQL帳號Lock的
select b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b where a.session_id = b.sid order by b.logon_time;
3. 使用下面這段SQL,帶入SID與SERIAL#即可將該Session Kill
alter system kill session'{SID}, {SERIAL#}';