30 November, 2018

Finding Locks on tables

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;

Useful Scripts

To Find session details using SID. set verify off col sid format 99999 col machine format a10 col program format a25 trunc col username form...