Skip to content

Instantly share code, notes, and snippets.

@kotlas92
Created December 5, 2019 08:47
Show Gist options
  • Save kotlas92/abc433583949095eb81df255ccaff02b to your computer and use it in GitHub Desktop.
Save kotlas92/abc433583949095eb81df255ccaff02b to your computer and use it in GitHub Desktop.
Oracle locks tree
SELECT LPAD(' ', (level-1)*2, ' ') || NVL(s.username, '(oracle)') AS username,
s.osuser,
s.sid,
s.serial#,
s.lockwait,
s.status,
s.module,
s.machine,
s.program,
s.event,
s.sql_id
FROM v$session s
CONNECT BY PRIOR s.sid = s.blocking_session
START WITH s.blocking_session IS NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment