ORACLE
ORA-04021 timeout occurred while waiting to lock object
하이안
2008. 12. 2. 20:19
[개요]
프로시져와 같은 오브젝트를 재컴파일시에 Lock으로 인해 Waiting 현상이 발생할 수 있다.
이러한 경우 ORA-04021 오류 메세지로 나타난다.
04021, 00000, "timeout occurred while waiting to lock object %s%s%s%s%s"
*Cause: While waiting to lock a library object, a timeout is occurred.
*Action: Retry the operation later.
[조치방법]
1. select SID from v$access where object='TEST_PROCEDURE';
→ SID = 60
2. select sid, serial#, username, status from v$session where sid=60;
3. alter system kill session 'sid,serial#';
4. 3번에서 해결되지 않으면 OS process를 kill 해야 함
5. select a.spid
from v$process a, v$session b
where a.addr=b.paddr and b.sid=60;
→ process id = 86662
6. 서버에 로그인 후 ps -ef|grep 86662
7. kill -9 86662

