ORA-04021: timeout occurred while waiting to lock object 某個應用正在鎖定該表或者包表為select b.SID,b.SERIAL#,c.SQL_TEXTfrom v$locked_object a, v$session b, v$sqlare ...
ORA-04021: timeout occurred while waiting to lock object
某個應用正在鎖定該表或者包
表為
select b.SID,b.SERIAL#,c.SQL_TEXT
from v$locked_object a, v$session b, v$sqlarea c
where a.SESSION_ID = b.SID
and b.SQL_ADDRESS = c.ADDRESS
and c.sql_text like '%table_name%';
包為
select B.SID,b.USERNAME,b.MACHINE FROM V$ACCESS A, V$SESSION B WHERE A.SID=B.SID and a.OBJECT = '%PACKAGE_name%' and a.TYPE = 'PACKAGE';
找出這個session
然後 kill
alter system kill session 'sid,serial#';