Tuesday, October 27, 2015

ORA-00054: resource busy and acquire...

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

Problem:
This error comes because some times two different sessions are performing DML tasks (delete, update and insert) on same column/table. This scenario some times leads to object locking in database.

Solution:

BEGIN
FOR I IN (SELECT S.SID SID, S.SERIAL# SERIAL FROM V$LOCKED_OBJECT L, V$SESSION S WHERE L.SESSION_ID = S.SID) LOOP
   EXECUTE IMMEDIATE ('ALTER SYSTEM KILL SESSION ''' || I.SID || ',' || I.SERIAL || '''');
END LOOP;
END;
/

No comments:

Post a Comment

web stats