Created
August 9, 2011 19:59
-
-
Save ran488/1135030 to your computer and use it in GitHub Desktop.
Show locks being held and by whom (Oracle)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show locks in Oracle | |
select owner||'.'||object_name obj | |
,oracle_username||' ('||s.status||')' oruser | |
,os_user_name osuser | |
,machine computer | |
,l.process unix | |
,s.sid||','||s.serial# ss | |
,r.name rs | |
,to_char(s.logon_time,'yyyy/mm/dd hh24:mi:ss') time | |
from v$locked_object l | |
,dba_objects o | |
,v$session s | |
,v$transaction t | |
,v$rollname r | |
where l.object_id = o.object_id | |
and s.sid=l.session_id | |
and s.taddr=t.addr | |
and t.xidusn=r.usn | |
order by osuser, ss, obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment