my code stock.com

marcus.sacramento

Verificação de LOCK
by marcus.sacramento

Snippet options

Download: Download snippet as verificacao-de-lock.txt.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

SELECT   SUBSTR (LPAD (' ', ABS (loc.block - 1) * 2) || ses.username, 1, 30)
                  username, ses.sid, ses.serial#, pro.spid, ses.osuser, ses.machine,
              ses.program, ses.status, ses.module, ses.lockwait, ses.row_wait_obj#,
              ses.row_wait_file#, ses.row_wait_block#, ses.row_wait_row#,
              vlo.object_id, loc.TYPE,
              DECODE (loc.TYPE, 'BL', 'Buffer Cache Management (PCM lock)', 'CF',
              'Controlfile Transaction', 'CI', 'Cross Instance Call', 'CU',
              'Bind Enqueue', 'DF', 'Data File', 'DL', 'Direct Loader', 'DM',
              'Database Mount', 'DR', 'Distributed Recovery', 'DX',
              'Distributed Transaction', 'FS', 'File Set', 'IN', 'Instance Number',
              'IR', 'Instance Recovery', 'IS', 'Instance State', 'IV',
              'Library Cache Invalidation', 'JQ', 'Job Queue', 'KK',
              'Redo Log Kick', 'LA', 'Library Cache Lock', 'LB',
              'Library Cache Lock', 'LC', 'Library Cache Lock', 'LD',
              'Library Cache Lock', 'LE', 'Library Cache Lock', 'LF',
              'Library Cache Lock', 'LG', 'Library Cache Lock', 'LH',
              'Library Cache Lock', 'LI', 'Library Cache Lock', 'LJ',
              'Library Cache Lock', 'LK', 'Library Cache Lock', 'LL',
              'Library Cache Lock', 'LM', 'Library Cache Lock', 'LN',
              'Library Cache Lock', 'LO', 'Library Cache Lock', 'LP',
              'Library Cache Lock', 'MM', 'Mount Definition', 'MR',
              'Media Recovery', 'NA', 'Library Cache Pin', 'NB',
              'Library Cache Pin', 'NC', 'Library Cache Pin', 'ND',
              'Library Cache Pin', 'NE', 'Library Cache Pin', 'NF',
              'Library Cache Pin', 'NG', 'Library Cache Pin', 'NH',
              'Library Cache Pin', 'NI', 'Library Cache Pin', 'NJ',
              'Library Cache Pin', 'NK', 'Library Cache Pin', 'NL',
              'Library Cache Pin', 'NM', 'Library Cache Pin', 'NN',
              'Library Cache Pin', 'NO', 'Library Cache Pin', 'NP',
              'Library Cache Pin', 'NQ', 'Library Cache Pin', 'NR',
              'Library Cache Pin', 'NS', 'Library Cache Pin', 'NT',
              'Library Cache Pin', 'NU', 'Library Cache Pin', 'NV',
              'Library Cache Pin', 'NW', 'Library Cache Pin', 'NX',
              'Library Cache Pin', 'NY', 'Library Cache Pin', 'NZ',
              'Library Cache Pin', 'PF', 'Password File', 'PI', 'Parallel Slaves',
              'PR', 'Process Startup', 'PS', 'Parallel Slave Synchronization',
              'QA', 'Row Cache Lock', 'QB', 'Row Cache Lock', 'QC',
              'Row Cache Lock', 'QD', 'Row Cache Lock', 'QE', 'Row Cache Lock',
              'QF', 'Row Cache Lock', 'QG', 'Row Cache Lock', 'QH',
              'Row Cache Lock', 'QI', 'Row Cache Lock', 'QJ', 'Row Cache Lock',
              'QK', 'Row Cache Lock', 'QL', 'Row Cache Lock', 'QM',
              'Row Cache Lock', 'QN', 'Row Cache Lock', 'QO', 'Row Cache Lock',
              'QP', 'Row Cache Lock', 'QQ', 'Row Cache Lock', 'QR',
              'Row Cache Lock', 'QS', 'Row Cache Lock', 'QT', 'Row Cache Lock',
              'QU', 'Row Cache Lock', 'QV', 'Row Cache Lock', 'QW',
              'Row Cache Lock', 'QX', 'Row Cache Lock', 'QY', 'Row Cache Lock',
              'QZ', 'Row Cache Lock', 'RT', 'Redo Thread', 'SC',
              'System Commit number', 'SM', 'SMON synchronization', 'SN',
              'Sequence Number', 'SQ', 'Sequence Enqueue', 'SR',
              'Synchronous Replication', 'SS', 'Sort Segment', 'ST',
              'Space Management Transaction', 'SV', 'Sequence Number Value', 'TA',
              'Transaction Recovery', 'TM', 'DML Enqueue', 'TS',
              'Table Space (or Temporary Segment)', 'TT', 'Temporary Table', 'TX',
              'Transaction', 'UL', 'User-defined Locks', 'UN', 'User Name', 'US',
              'Undo segment Serialization', 'WL', 'Writing redo Log', 'XA',
              'Instance Attribute Lock', 'XI', 'Instance Registration Lock')
                  AS type_m,
              DECODE (
                  vlo.locked_mode,
                  0, 'None',
                  1, 'Null',
                  2, 'Row-S (SS)',
                  3, 'Row-X (SX)',
                  4, 'Share',
                  5, 'S/Row-X (SSX)',
                  6, 'Exclusive',
                  TO_CHAR (lmode)
              )
                  AS LOCKED_MODE,
              obj.object_type || '.' || obj.object_name object_name
     FROM   dba_objects obj, v$locked_object vlo, v$process pro, v$session ses,
              v$lock loc
    WHERE       (loc.block <> 0 OR loc.request <> 0)
              AND ses.sid = loc.sid
              AND pro.addr = ses.paddr
              AND vlo.session_id(+) = ses.sid
              AND obj.object_id(+) = vlo.object_id
ORDER BY   loc.id1, loc.id2, loc.sid, loc.block DESC, loc.request;
/* Formatted on 15/12/2011 11:54:45 (QP5 v5.120.811.25008) */

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.