Purpose
Provide OERR information for ORA-4021.
Details
Error: ORA 4021
Text: time-out occurred while waiting to lock object <name>
-------------------------------------------------------------------------------
Cause: While trying to lock a library object, a time-out occurred.
Action: Retry the operation later.
Explanation:
This is locking error where Oracle uses a piece of memory which is shareable among all the database users calling the Library Cache. This maintains information about objects such as pl/sql packages, views, tables, etc.The object cannot be change while in used. In order to modify the object, there is a lock in the library cache. A session will wait on the library cache as the object is in use. Until the lock is released, the error ora-4021 error.
Diagnosis:
Retry the process as the lock may be released. Or kill the process holding the lock. Check V$ACCESS for users of the object:
SELECT SID, OWNER, OBJECT, TYPE
FROM V$ACCESS
WHERE OBJECT = 'object_name';