ORA-04021: timeout occurred while waiting to lock object
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.
V$ACCESS – You can use the V$ACCESS view to see which users have locks on which objects in your database
SELECT SID, OWNER, OBJECT, TYPE
WHERE OBJECT = 'object_name';
$SESSION_EVENT and V$SESSION_WAIT – use these views to see what Oracle wait events the session(s) are waiting on
WHERE SID = <sid>
ORDER BY TIME_WAITED DESC;
WHERE SID = <sid>;
V$LOCKED_OBJECT – This view will also help you see who is locking the object