Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to find locked object query?

801659Mar 8 2011 — edited Mar 8 2011
There is random error ORA-00054 coming during execution of one process which is using SELECT FOR UPDATE NO WAIT statement.

Logs of process is showing row is accessed only once but still it gets error of "resource busy".
So there must be any other session which is locking object and it is not identifid. I want to identify which other session/user is locking object.

I am trying with below query which shows session id, terminal name and object name which is locked.
SELECT a.sid,a.serial#, a.username,c.os_user_name,a.terminal,
b.object_id,substr(b.object_name,1,40) object_name,sysdate
from v$session a, dba_objects b, v$locked_object c
where a.sid = c.session_id
and b.object_id = c.object_id
But i want information of SQL query from v$sqltext so i can find out throughout the applicaiton where it is executed?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2011
Added on Mar 8 2011
2 comments
53,301 views