Home Email RSS Feed

Finding locked objects in Oracle

If you've enjoyed this post, you might want to subscribe my RSS feed or email alerts for free updates. Thanks for visiting and come back again.


if you’re wondering why particular query or procedure is talking a long such a long time to run; then make sure you check out whether the object you’re accessing is locked or not.

there are quite a few dba views available to make our task less complicated. you can use the below query which will return you the list of locked objects.

SELECT
c.owner,
c.object_name,
c.object_type,
b.sid,
b.serial#,
b.status,
b.osuser,
b.machine
FROM
v$locked_object a ,
v$session b,
dba_objects c
WHERE
b.sid = a.session_id
AND
a.object_id = c.object_id;

you can now decide whether to kill the job/ process or someother roundaway to remove the lock obtained on the particular object.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)