Search This Blog

Thursday, May 20, 2010

Check for Table Lock

select
c.owner,
c.object_name,
c.object_type,
b.sid,
b.serial#,
b.status,
b.osuser,
b.machine,
b.program,
b.type,
b.client_info
from
v$locked_object a ,
v$session b,
dba_objects c
where
b.sid = a.session_id
and
a.object_id = c.object_id;


The above SQL is to check the table lock by resources. For instance, I was running a process and it was not going to completion. I got this SQL from my friend and when i ran it, i got the info that one table is locked by SQL developer. I was thinking what would be the problem, finally came to know that it was because i didnt commit an update SQL, which locked the particular table.

A very handy SQL

No comments:

Post a Comment