1. 程式人生 > >Oracle 執行簡單的語句,一直執行中,無法成功

Oracle 執行簡單的語句,一直執行中,無法成功

搞了百度一下才知道,原來是表鎖住了!

查出哪些物件被鎖:

select a.,b. from v$locked_object a,dba_objects b where b.object_id = a.object_id
查出鎖住物件的session ID 和serial#:

select t2.username,t2.sid,t2.serial#,t2.logon_time
from vlockedobjectt1,vsession t2
where t1.session_id=t2.sid order by t2.logon_time
殺死session:
alter system kill session ‘ID,Serial#’