Skip to main content

Posts

Showing posts with the label SQL Quries

How to find out blocking locks & sessions.

SELECT s.inst_id, NVL (s.username, 'Internal') "Database User", m.SID, s.serial#, p.spid "DB OS Process", m.TYPE, DECODE (m.lmode, 0, 'None', 1, 'Null', 2, 'Row Share', 3, 'Row Excl.', 4, 'Share', 5, 'S/Row Excl.', 6, 'Exclusive', lmode, LTRIM (TO_CHAR (lmode, '990')) ) "Lock Type", DECODE (m.request, 0, 'None', 1, 'Null', 2, 'Row Share', 3, 'Row Excl.', 4, 'Share', 5, 'S/Row Excl.', 6, 'Exclusive', request, LTRIM (TO_CHAR (m.request, '990')) ) "Lock Request", DECODE (command, 0, 'None', DECODE (m.id2, 0, dusr.username || '.' || SUBSTR (dobj.NAME, 1, 30), 'Rollback Segment' ) ) "Object", s.machine "Application Server", s.process "Apps OS process", m.ctime, NVL (NVL (usr.description, s.action), 'Database Session' ) "Online User,Concurrent", N...