For past some time I have noticed that we get ORA-00054
error while trying to issue SELECT ... FOR UPDATE NOWAIT
, during large number of concurrent updates to the db. This our development system and we really do not have any other user, or at least that is what we believe.
We have been through the logs of our application and it seems everything is in order; no threads are trying to update the same row.
How can I configure Oracle db to generate a log on which would let me know the user id which holds the lock when this error occurred?
from here: ORA-00054: resource busy and acquire with NOWAIT specified
You can also look up the sql,username,machine,port information and get to the actual process which holds the connection
SELECT O.OBJECT_NAME, S.SID, S.SERIAL#, P.SPID, S.PROGRAM,S.USERNAME,
S.MACHINE,S.PORT , S.LOGON_TIME,SQ.SQL_FULLTEXT
FROM V$LOCKED_OBJECT L, DBA_OBJECTS O, V$SESSION S,
V$PROCESS P, V$SQL SQ
WHERE L.OBJECT_ID = O.OBJECT_ID
AND L.SESSION_ID = S.SID AND S.PADDR = P.ADDR
AND S.SQL_ADDRESS = SQ.ADDRESS;
Remove the NOWAIT, and monitor DBA_BLOCKERS/DBA_WAITERS.
Kindly use
select * from v$locked_object
for getting the lock information
Since it is development environment you can try the approach provided in the below link
https://forums.oracle.com/forums/thread.jspa?threadID=324530
A more comprehensive Approach is provided using v$lock at the below link
http://www.orafaq.com/node/854
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With