Friday, September 5, 2008

Query to find who is locking my object

set lines 120 hea on trunc on pages 50
col sid for 9999
col serial# for 9999999
col osuser for a10
col owner for a10
col module for a10
col username for a10
col type for a12
select sid
, serial#
, osuser
, username
, b.owner
, b.type
, module
, action act
from v$session v
,dba_ddl_locks b
where b.session_id = v.sid
and b.name =upper('&object_name')

No comments: