Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 
 

v$lock wait events

Oracle Database Tips by Donald Burleson


The Oracle v$lock view lists all Oracle wait events and the dba_hist_enqueue_stat table.  Also see my lock notes:

The TYPE column in v$lock shows the type of wait events (listed in the script below), and we also have the LMODE column (lock mode) and REQUEST columns:

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',

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)')

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)')

Here is a comprehensive v$lock query by Deepak Baranwal, listing the lock types:

set echo off
col sid form 9999
col id1 form 9999999999
col id2 form 999999999
col lmode    head "Lock Held" form a14
col request1 head "Lock Request" form a16
col type     head "Lock Type" form a15
col ctime    head "Time|Held" form 999999
col block head "No Of |Sessions|Waiting|For This|Lock" form 99999

select sid,
  DECODE(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(TYPE,1,1),
  'L','Library Cache ('||substr(TYPE,2,1)||')',
  'N','Library Cache Pin ('||substr(TYPE,2,1)||')',
  'Q','Row Cache ('||substr(TYPE,2,1)||')',
  '????')) TYPE,
id1,id2,
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)') request1,
ctime, block
from
  v$lock
where sid>5
and type not in ('MR','RT')
order by decode(request,0,0,2),block,5
/

 

If you like Oracle tuning, you may enjoy the new book "Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.