Skip to content

Instantly share code, notes, and snippets.

@kapfenho
Created April 21, 2011 09:11
Show Gist options
  • Save kapfenho/934034 to your computer and use it in GitHub Desktop.
Save kapfenho/934034 to your computer and use it in GitHub Desktop.
Oracle: locks in database
-- locks in Oracle
SELECT substr(DECODE(request,0,'Holder: ','Waiter: ')||sid,1,12) sess,
id1, id2, lmode, request, type, inst_id
FROM GV$LOCK
WHERE (id1, id2, type) IN
(SELECT id1, id2, type FROM GV$LOCK WHERE request>0)
ORDER BY id1, request;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment