Locks (identifiacion de bloqueador y bloqueados) | ExpoDBA

Locks (identifiacion de bloqueador y bloqueados)

Locks (identifiacion de bloqueador y bloqueados)

set linesize 250
col sess format a20
col event format a40
col mata format a40
col osuser format a10
col username format a11


SELECT /*+ RULE */
a.sid,b.serial#,
decode(lmode, 0,'None(0)', 1,'Null(1)', 2,'Row Share(2)', 3,'Row Exclu(3)', 4,'Share(4)', 5,'Share Row Ex(5)', 6,'Exclusive(6)') lmode,
decode(request, 0,'None(0)', 1,'Null(1)', 2,'Row Share(2)', 3,'Row Exclu(3)', 4,'Share(4)', 5,'Share Row Ex(5)', 6,'Exclusive(6)') request,
DECODE(a.TYPE,
'BL','Buffer hash table',
'CF','Control File Transaction',
'CI','Cross Instance Call',
'CS','Control File Schema',
'CU','Bind Enqueue',
'DF','Data File',
'DL','Direct-loader index-creation',
'DM','Mount/startup db primary/secondary instance',
'DR','Distributed Recovery Process',
'DX','Distributed Transaction Entry',
'FI','SGA Open-File Information',
'FS','File Set',
'IN','Instance Number',
'IR','Instance Recovery Serialization',
'IS','Instance State',
'IV','Library Cache InValidation',
'JQ','Job Queue',
'KK','Redo Log "Kick"',
'LS','Log Start/Log Switch',
'MB','Master Buffer hash table',
'MM','Mount Definition',
'MR','Media Recovery',
'PF','Password File',
'PI','Parallel Slaves',
'PR','Process Startup',
'PS','Parallel Slaves Synchronization',
'RE','USE_ROW_ENQUEUE Enforcement',
'RT','Redo Thread',
'RW','Row Wait',
'SC','System Commit Number',
'SH','System Commit Number HWM',
'SM','SMON',
'SQ','Sequence Number',
'SR','Synchronized Replication',
'SS','Sort Segment',
'ST','Space Transaction',
'SV','Sequence Number Value',
'TA','Transaction Recovery',
'TD','DDL enqueue',
'TE','Extend-segment enqueue',
'TM','DML enqueue',
'TS','Temporary Segment',
'TT','Temporary Table',
'TX','Transaction',
'UL','User-defined Lock',
'UN','User Name',
'US','Undo Segment Serialization',
'WL','Being-written redo log instance',
'WS','Write-atomic-log-switch global enqueue',
'XA','Instance Attribute',
'XI','Instance Registration',
decode(substr(a.TYPE,1,1),
'L','Library Cache ('||substr(a.TYPE,2,1)||')',
'N','Library Cache Pin ('||substr(a.TYPE,2,1)||')',
'Q','Row Cache ('||substr(a.TYPE,2,1)||')',
'????')) TYPE,
a.ctime,
id1, id2, block, b.sql_hash_value
FROM gV$LOCK a,
gv$session b
WHERE (a.id1, a.id2, a.type) IN (SELECT c.id1, c.id2, type FROM V$LOCK c WHERE c.request>0)
and a.sid = b.sid
ORDER BY a.id1, a.request, ctime
/