Friday, May 23, 2014

http://www.confio.com/logicalread/solving-oracle-enq-tm-contention-wait-events/#.U38OZXJdXko

Recently, I was assisting one of our customers of Ignite for Oracle trying to diagnose sessions waiting on the "enq: TM - contention" event. The blocked sessions were executing simple INSERT statements similar to:
INSERT INTO supplier VALUES (:1, :2, :3);
Waits on enq: TM - contention indicate there are unindexed foreign key constraints. Reviewing the SUPPLIER table, we found a foreign key constraint referencing the PRODUCT table that did not have an associated index. This was also confirmed by the Top Objects feature of Ignite for Oracle because all the time was associated with the PRODUCT table. We added the index on the column referencing the PRODUCT table and the problem was solved.

Finding the root cause of the enq: TM - contention wait event

After using Ignite for Oracle's locking feature to find the blocking sessions, we found the real culprit. Periodically, as the company reviewed its vendor list, they "cleaned up" the SUPPLIER table several times a week. As a result, rows from the SUPPLIER table were deleted. Those delete statements were then cascading to the PRODUCT table and taking out TM locks on it.

Reproducing a typical problem that leads to this wait

This problem has a simple fix, but I wanted to understand more about why this happens. So I reproduced the issue to see what happens under the covers. I first created a subset of the tables from this customer and loaded them with sample data.
CREATE TABLE supplier 
( supplier_id number(10) not null, 
supplier_name varchar2(50) not null, 
contact_name varchar2(50), 
CONSTRAINT supplier_pk PRIMARY KEY (supplier_id) 
); 
INSERT INTO supplier VALUES (1, 'Supplier 1', 'Contact 1'); 
INSERT INTO supplier VALUES (2, 'Supplier 2', 'Contact 2'); 
COMMIT; 

CREATE TABLE product 
( product_id number(10) not null, 
product_name varchar2(50) not null, 
supplier_id number(10) not null, 
CONSTRAINT fk_supplier 
FOREIGN KEY (supplier_id) 
REFERENCES supplier(supplier_id) 
ON DELETE CASCADE ); 
INSERT INTO product VALUES (1, 'Product 1', 1); 
INSERT INTO product VALUES (2, 'Product 2', 1); 
INSERT INTO product VALUES (3, 'Product 3', 2); 
COMMIT;
I then executed statements similar to what we found at this customer:
User 1: DELETE supplier WHERE supplier_id = 1; 
User 2: DELETE supplier WHERE supplier_id = 2;
User 3: INSERT INTO supplier VALUES (5, 'Supplier 5', 'Contact 5');
Similar to the customer's experience, User 1 and User 2 hung waiting on "enq: TM - contention". Reviewing information from V$SESSION I found the following:
SELECT l.sid, s.blocking_session blocker, s.event, l.type, l.lmode, l.request, o.object_name, o.object_type 
FROM v$lock l, dba_objects o, v$session s 
WHERE UPPER(s.username) = UPPER('&User') 
AND l.id1 = o.object_id (+) 
AND l.sid = s.sid 
ORDER BY sid, type;
SIDBLOCKEVENTTYPEMODEREQOBJECTOBJECT_TYPE
42 SQL*Net message from clientTM30PRODUCTTABLE
42 SQL*Net message from clientTM30SUPPLIERTABLE
42 SQL*Net message from clientTX60 TABLE
5442enq: TM - contentionTM30SUPPLIERTABLE
5442enq: TM - contentionTM05PRODUCTTABLE
8354enq: TM - contentionTM30SUPPLIERTABLE
8354enq: TM - contentionTM02PRODUCTTABLE
Following along with the solution we used for our customer, we added an index for the foreign key constraint on the SUPPLIER table back to the PRODUCT table:
CREATE INDEX fk_supplier ON product (supplier_id);
When we ran the test case again everything worked fine. There were no exclusive locks acquired and hence no hanging. Oracle takes out exclusive locks on the child table, the PRODUCT table in our example, when a foreign key constraint is not indexed.

Sample query to find unindexed foreign key constraints

Now that we know unindexed foreign key constraints can cause severe problems, here is a script that I use to find them for a specific user (this can easily be tailored to search all schemas):
SELECT * FROM (
SELECT c.table_name, cc.column_name, cc.position column_position
FROM   user_constraints c, user_cons_columns cc
WHERE  c.constraint_name = cc.constraint_name
AND    c.constraint_type = 'R'
MINUS
SELECT i.table_name, ic.column_name, ic.column_position
FROM   user_indexes i, user_ind_columns ic
WHERE  i.index_name = ic.index_name
)
ORDER BY table_name, column_position;
============================
spool /tmp/chktm.log 
set long 655360 
set pagesiz 100 
select dbms_metadata.get_ddl('TABLE','PORTFOLIOTYPE','WFPROD_PERMAL') from dual; 
select index_name, table_name, column_name, column_position from dba_ind_columns 
where table_owner='WFPROD_PERMAL' and table_name='PORTFOLIOTYPE'; 
select a.owner owner_name, a.table_name table_name, 
b.owner owner_nam, b.table_name referencing_table 
from dba_constraints a, dba_constraints b 
where a.constraint_name = b.r_constraint_name and 
b.constraint_type = 'R' and 
a.table_name='PORTFOLIOTYPE'; 
spool off; 

===========================
Performance Monitoring Data Dictionary Views
This section lists some of the data dictionary views that you can use to monitor an Oracle Database instance. These views are general in their scope. Other views, more specific to a process, are discussed in the section of this book where the process is described.
ViewDescription
V$LOCKLists the locks currently held by Oracle Database and outstanding requests for a lock or latch
DBA_BLOCKERSDisplays a session if it is holding a lock on an object for which another session is waiting
DBA_WAITERSDisplays a session if it is waiting for a locked object
DBA_DDL_LOCKSLists all DDL locks held in the database and all outstanding requests for a DDL lock
DBA_DML_LOCKSLists all DML locks held in the database and all outstanding requests for a DML lock
DBA_LOCKLists all locks or latches held in the database and all outstanding requests for a lock or latch
DBA_LOCK_INTERNALDisplays a row for each lock or latch that is being held, and one row for each outstanding request for a lock or latch
V$LOCKED_OBJECTLists all locks acquired by every transaction on the system
V$SESSION_WAITLists the resources or events for which active sessions are waiting
V$SYSSTATContains session statistics
V$RESOURCE_LIMITProvides information about current and maximum global resource utilization for some system resources
V$SQLAREAContains statistics about shared SQL area and contains one row for each SQL string. Also provides statistics about SQL statements that are in memory, parsed, and ready for execution
V$LATCHContains statistics for nonparent latches and summary statistics for parent latches


Identifying Locking Issues 
Note: text in this session was copied from toadworld.com


1 Query to show information about locked objects:
SELECT O.OWNER, O.OBJECT_ID, O.OBJECT_NAME, O.OBJECT_TYPE, L.TYPE
FROM DBA_OBJECTS O, V$LOCK L
WHERE O.OBJECT_ID = L.ID1
/




OWNER       OBJECT_ID OBJECT_NAME          OBJECT_TYP TY
---------- ---------- -------------------- ---------- --
SYSTEM          32392 FOOBAR               TABLE      TM
SYSTEM          32392 FOOBAR               TABLE      TM
...
SYSTEM          32371 MY_DEPT              TABLE      TM




2 DBA_BLOCKERS
The DBA_BLOCKERS view has one column, HOLDING_SESSION, which indicates each session that is:
  • Not currently waiting on a locked object, and
  • Currently holding a lock on an object for which another session is waiting.
3 DBA_WAITERS
The DBA_WAITERS view is the counterpart to DBA_BLOCKERS. It indicates which sessions are:
  • Currently waiting on a locked object, and
  • Not currently holding a lock on an object for which another session is waiting.
The WAITING_SESSION column indicates the SID of the waiting session, and the HOLDING_SESSION column indicates the SID of the holding session. The view shows the lock type, and the modes in which the lock is being held and requested.
============================
TOM KYTe scritp to find Unindexed Foreign Key constraint columns.

tkyte@TKYTE816> select table_name, constraint_name,
  2       cname1 || nvl2(cname2,','||cname2,null) ||
  3       nvl2(cname3,','||cname3,null) || nvl2(cname4,','||cname4,null) ||
  4       nvl2(cname5,','||cname5,null) || nvl2(cname6,','||cname6,null) ||
  5       nvl2(cname7,','||cname7,null) || nvl2(cname8,','||cname8,null)
  6              columns
  7    from ( select b.table_name,
  8                  b.constraint_name,
  9                  max(decode( position, 1, column_name, null )) cname1,
 10                  max(decode( position, 2, column_name, null )) cname2,
 11                  max(decode( position, 3, column_name, null )) cname3,
 12                  max(decode( position, 4, column_name, null )) cname4,
 13                  max(decode( position, 5, column_name, null )) cname5,
 14                  max(decode( position, 6, column_name, null )) cname6,
 15                  max(decode( position, 7, column_name, null )) cname7,
 16                  max(decode( position, 8, column_name, null )) cname8,
 17                  count(*) col_cnt
 18             from (select substr(table_name,1,30) table_name,
 19                          substr(constraint_name,1,30) constraint_name,
 20                          substr(column_name,1,30) column_name,
 21                          position
 22                     from user_cons_columns ) a,
 23                  user_constraints b
 24            where a.constraint_name = b.constraint_name
 25              and b.constraint_type = 'R'
 26            group by b.table_name, b.constraint_name
 27         ) cons
 28   where col_cnt > ALL
 29           ( select count(*)
 30               from user_ind_columns i
 31              where i.table_name = cons.table_name
 32                and i.column_name in (cname1, cname2, cname3, cname4,
 33                                      cname5, cname6, cname7, cname8 )
 34                and i.column_position <= cons.col_cnt
 35              group by i.index_name
 36           )
 37  /

==================================================

Toms unindex is giving me false negative four stars.
In my opinion fk_idx is satisfying the unindex need. At least TM Enq Wait events dismished from the environment after creating the index with different order of columns than fk.
Here is an alternative approach to search for unindexed foreign keys implemented in a single sql clause. It is operational at least with Oracle 10.2.0.1 and 11.1.0.7. There exists a bug involved with usage of connect_by_root in versions 10.2.0.3, 10.2.0.4 and 11.1.0.6. For those versions you need to set the _optimizer_connect_by_cost_based parameter to false.
alter session set "_optimizer_connect_by_cost_based" = false;
select case when i.index_name is not null
then 'OK'
else '****'
end ok
, c.table_name
, c.constraint_name
, c.cols,i.index_name
from (
select table_name, constraint_name
, max(sys_connect_by_path(column_name, ' ' )) cols
from (
select a.table_name
, b.constraint_name
, column_name
, position
, row_number() over
(partition by b.constraint_name
order by column_name) rn
from user_constraints a, user_cons_columns b
where a.constraint_name = b.constraint_name
and a.constraint_type = 'R'
)
start with rn = 1
connect by prior rn = rn-1
and prior constraint_name = constraint_name
group by table_name, constraint_name
) c
left outer join
(
select table_name
, index_name
, cr
, max(sys_connect_by_path(column_name, ' ' )) cols
from (
select table_name
, index_name
, column_position
, column_name
, cr
, row_number() over (partition by index_name, cr
order by column_name) rn
from (
select table_name
, index_name
, column_position
, column_name
, connect_by_root(column_name) cr
from user_ind_columns
connect by prior column_position-1 = column_position
and prior index_name = index_name
)
)
start with rn = 1
connect by prior rn = rn-1
and prior index_name = index_name
and prior cr = cr
group by table_name, index_name, cr
) i on c.cols = i.cols and c.table_name = i.table_name
;
==================================================

Wait events Oracle 11g – enqueues

Enqueues – are shared memory structures (locks) that serialize access to database resources. They can be associated with a session or transaction. Enqueue names are displayed in the LOCK_TYPE column of the DBA_LOCK and DBA_LOCK_INTERNAL data dictionary views.
In case your session is slow you can always check what it’s waiting for in v$session table.
This query just shows sessions waiting for enqueue resources
SELECT sid, serial#, event, wait_class 
FROM v$session WHERE event LIKE 'enq:%';
To get description of an enqueue resource use following query.
SELECT 
  eq_name "Enqueue", 
  ev.name "Enqueue Type", 
  eq.req_description "Description"
FROM v$enqueue_statistics eq, v$event_name ev
WHERE eq.event#=ev.event#
ORDER BY ev.name;

Enqueue nameEnqueue typeDescription
Auto BMRenq: AB – ABMR process initializedLock held to ensure that ABMR process is initialized
Auto BMRenq: AB – ABMR process start/stopLock held to ensure that only one ABMR is started in the cluster
ASM Disk AU Lockenq: AD – allocate AUSynchronizes accesses to a specific ASM disk AU
ASM Disk AU Lockenq: AD – deallocate AUSynchronizes accesses to a specific ASM disk AU
ASM Disk AU Lockenq: AD – relocate AUSynchronizes accesses to a specific ASM disk AU
Edition Lockenq: AE – lockPrevent Dropping an edition in use
Advisor Frameworkenq: AF – task serializationThis enqueue is used to serialize access to an advisor task
Analytic Workspace Generationenq: AG – contentionSynchronizes generation use of a particular workspace
ASM Enqueueenq: AM – ASM ACD RelocationBlock ASM cache freeze
ASM Enqueueenq: AM – ASM Amdu DumpAllow only one AMDU dump when block read failure
ASM Enqueueenq: AM – ASM File DestroyPrevent same file deletion race
ASM Enqueueenq: AM – ASM Grow ACDSerializes growing ASM ACD
ASM Enqueueenq: AM – ASM Password File UpdateAllow one ASM password file update per cluster at a time
ASM Enqueueenq: AM – ASM UserPrevents a user from being dropped if it owns any open files
ASM Enqueueenq: AM – ASM cache freezeStart ASM cache freeze
ASM Enqueueenq: AM – ASM disk based alloc/deallocSynchronizes disk based allocations/deallocations
ASM Enqueueenq: AM – ASM file descriptorSerializes access to ASM file descriptors
ASM Enqueueenq: AM – ASM file relocationSerializes file relocation shrink and drop
ASM Enqueueenq: AM – ASM reservedCheck id1 of call for specific purpose
ASM Enqueueenq: AM – background COD reservationReserve a background COD entry
ASM Enqueueenq: AM – block repairSerializes block repairs
ASM Enqueueenq: AM – client registrationRegisters DB instance to ASM client state object hash
ASM Enqueueenq: AM – disk offlineSynchronizes disk offlines
ASM Enqueueenq: AM – group blockASM group block
ASM Enqueueenq: AM – group useClient group use
ASM Enqueueenq: AM – rollback COD reservationReserve a rollback COD entry
ASM Enqueueenq: AM – shutdownPrevent DB instance registration during ASM instance shutdown
MultiWriter Object Accessenq: AO – contentionSynchornizes access to objects and scalar variables
SPM Autopurgeenq: AP – contentionThis enqueue is used to serialize the purging of SQL plan baselines
Service Operationsenq: AS – service activationSynchronizes new service activation
Alter Tablespaceenq: AT – contentionSerializes ‘alter tablespace’ operations
ASM volume locksenq: AV – AVD client registrationSerialize inst reg and first DG use
ASM volume locksenq: AV – add/enable first volume in DGSerialize taking the AVD DG enqueue
ASM volume locksenq: AV – persistent DG numberprevent DG number collisions
ASM volume locksenq: AV – volume relocateSerialize relocating volume extents
Analytic Workspaceenq: AW – AW generation lockIn-use generation state for a particular workspace
Analytic Workspaceenq: AW – AW state lockRow lock synchronization for the AW$ table
Analytic Workspaceenq: AW – AW$ table lockGlobal access synchronization to the AW$ table
Analytic Workspaceenq: AW – user access for AWSynchronizes user accesses to a particular workspace
KSXA Test Affinity Dictionaryenq: AY – contentionAffinity Dictionary test affinity synchronization
Global Transaction Branchenq: BB – 2PC across RAC instances2PC distributed transaction branch across RAC instances
BLOOM FILTERenq: BF – PMON Join Filter cleanupPMON bloom filter recovery
BLOOM FILTERenq: BF – allocation contentionAllocate a bloom filter in a parallel statement
clonedb bitmap file accessenq: BM – clonedb bitmap file writesynchronizes clonedb bitmap file operations
Backup/Restoreenq: BR – file shrinkLock held to prevent file from decreasing in physical size during RMAN backup
Backup/Restoreenq: BR – multi-section restore headerLock held to serialize file header access during multi-section restore
Backup/Restoreenq: BR – multi-section restore sectionLock held to serialize section access during multi-section restore
Backup/Restoreenq: BR – perform autobackupLock held to perform a new controlfile autobackup 
Backup/Restoreenq: BR – proxy-copyLock held to allow cleanup from backup mode during an RMAN proxy-copy backup
Backup/Restoreenq: BR – request autobackupLock held to request controlfile autobackups 
Backup/Restoreenq: BR – space info datafile hdr updateLock held to prevent multiple process to update the headers at the same time
Calibrationenq: CA – contentionSynchronizes various IO calibration runs
Controlfile Transactionenq: CF – contentionSynchronizes accesses to the controlfile
Cross-Instance Call Invocationenq: CI – contentionCoordinates cross-instance function invocations
Label Security cacheenq: CL – compare labelsSynchronizes accesses to label cache for label comparison
Label Security cacheenq: CL – drop labelSynchronizes accesses to label cache when dropping a label
ASM Instance Enqueueenq: CM – diskgroup dismountserialize asm diskgroup dismount
ASM Instance Enqueueenq: CM – gateserialize access to instance enqueue
ASM Instance Enqueueenq: CM – instanceindicate ASM diskgroup is mounted
KTCN REG enqenq: CN – race with initduring descriptor initialization
KTCN REG enqenq: CN – race with regduring transaction commit to see concurrent registrations
KTCN REG enqenq: CN – race with txnduring registration
KTUCLO Master Slave enqenq: CO – master slave detenqueue held be Master in Cleanout Optim
Cleanup querycache registrationsenq: CQ – contentionSerializes access to cleanup client query cache registrations
Reuse Block Rangeenq: CR – block range reuse ckptCoordinates fast block range reuse ckpt
Block Change Trackingenq: CT – CTWR process start/stopLock held to ensure that only one CTWR process is started in a single instance
Block Change Trackingenq: CT – change stream ownershipLock held by one instance while change tracking is enabled, to guarantee access to thread-specific resources
Block Change Trackingenq: CT – global space managementLock held during change tracking space management operations that affect the entire change tracking file
Block Change Trackingenq: CT – local space managementLock held during change tracking space management operations that affect just the data for one thread
Block Change Trackingenq: CT – readingLock held to ensure that change tracking data remains in existence until a reader is done with it
Block Change Trackingenq: CT – stateLock held while enabling or disabling change tracking, to ensure that it is only enabled or disabled by one user at a time
Block Change Trackingenq: CT – state change gate 1Lock held while enabling or disabling change tracking in RAC
Block Change Trackingenq: CT – state change gate 2Lock held while enabling or disabling change tracking in RAC
Cursorenq: CU – contentionRecovers cursors in case of death while compiling
TEXT: Index Specific Lockenq: CX – TEXT: Index Specific LockIndex Specific Lock on CTX index
DbsDriverenq: DB – contentionSynchronizes modification of database wide supplementallogging attributes
ASM Local Disk Groupenq: DD – contentionSynchronizes local accesses to ASM disk groups
Datafile Online in RACenq: DF – contentionEnqueue held by foreground or DBWR when a datafile is brought online in RAC
ASM Disk Group Modificationenq: DG – contentionSynchronizes accesses to ASM disk groups
Direct Loader Index Creationenq: DL – contentionLock to prevent index DDL during direct load
Database Mount/Openenq: DM – contentionEnqueue held by foreground or DBWR to syncrhonize database mount/open with other operations
Diskgroup number generatorenq: DN – contentionSerializes group number generations
ASM Disk Online Lockenq: DO – Staleness Registry createSynchronizes Staleness Registry creation
ASM Disk Online Lockenq: DO – disk onlineSynchronizes disk onlines and their recovery
ASM Disk Online Lockenq: DO – disk online operationRepresents an active disk online operation
ASM Disk Online Lockenq: DO – disk online recoverySynchronizes disk onlines and their recovery
ASM Disk Online Lockenq: DO – startup of MARK processSynchronizes startup of MARK process
LDAP Parameterenq: DP – contentionSynchronizes access to LDAP parameters
Distributed Recoveryenq: DR – contentionSerializes the active distributed recovery operation
Database Suspendenq: DS – contentionPrevents a database suspend during LMON reconfiguration
Default Temporary Tablespaceenq: DT – contentionSerializes changing the default temporary table spaceand user creation
Diana Versioningenq: DV – contentionSynchronizes access to lower-version Diana (PL/SQL intermediate representation)
In memory Dispenserenq: DW – contentionSerialize in memory dispenser operations
Distributed Transactionenq: DX – contentionSerializes tightly coupled distributed transaction branches
ASM File Access Lockenq: FA – access fileSynchronizes accesses to open ASM files
Format Blockenq: FB – contentionEnsures that only one process can format data blcoks in auto segment space managed tablespaces
Disk Group Chunk Mountenq: FC – open an ACD threadLGWR opens an ACD thread
Disk Group Chunk Mountenq: FC – recover an ACD threadSMON recovers an ACD thread
Flashback Databaseenq: FD – Flashback coordinatorSynchronization
Flashback Databaseenq: FD – Flashback logical operationsSynchronization
Flashback Databaseenq: FD – Flashback on/offSynchronization
Flashback Databaseenq: FD – Marker generationSynchronization
Flashback Databaseenq: FD – Restore point create/dropSynchronization
Flashback Databaseenq: FD – Tablespace flashback on/offSynchronization
KTFA Recoveryenq: FE – contentionSerializes flashback archive recovery 
ACD Relocation Gate Enqueueenq: FG – FG redo generation enq raceresolve race condition to acquire Disk Group Redo Generation Enqueue
ACD Relocation Gate Enqueueenq: FG – LGWR redo generation enq raceresolve race condition to acquire Disk Group Redo Generation Enqueue
ACD Relocation Gate Enqueueenq: FG – serialize ACD relocateonly 1 process in the cluster may do ACD relocation in a disk group
Flashback database logenq: FL – Flashback database logSynchronization
Flashback database logenq: FL – Flashback db commandEnqueue used to synchronize Flashback Database and and deletion of flashback logs.
File Mappingenq: FM – contentionSynchronizes access to global file mapping state
File Objectenq: FP – global fob contentionSynchronizes various File Object(FOB) operations
Disk Group Recoveryenq: FR – contentionbegin recovery of disk group
Disk Group Recoveryenq: FR – recover the threadwait for lock domain detach
Disk Group Recoveryenq: FR – use the threadindicate this ACD thread is alive
File Set / Dictionary Checkenq: FS – contentionEnqueue used to synchronize recovery and file operations or synchronize dictionary check
Disk Group Redo Generationenq: FT – allow LGWR writesallow LGWR to generate redo in this thread
Disk Group Redo Generationenq: FT – disable LGWR writesprevent LGWR from generating redo in this thread
DBFUSenq: FU – contentionThis enqueue is used to serialize the capture of the DB Feature           Usage and High Water Mark Statistics
ACD Xtnt Info CICenq: FX – issue ACD Xtnt Relocation CICARB relocates ACD extent
ASM Disk Headerenq: HD – contentionSerializes accesses to ASM SGA data structures
Queue Pageenq: HP – contentionSynchronizes accesses to queue pages
Hash Queueenq: HQ – contentionSynchronizes the creation of new queue IDs
Direct Loader High Water Markenq: HV – contentionLock used to broker the high water mark during parallel inserts
Segment High Water Markenq: HW – contentionLock used to broker the high water mark during parallel inserts
Internalenq: IA – contention
NIDenq: ID – contentionLock held to prevent other processes from performing controlfile transaction while NID is running
Label Securityenq: IL – contentionSynchronizes accesses to internal label data structures
Kti blr lockenq: IM – contention for blrSerializes block recovery for IMU txn
Instance Recoveryenq: IR – contentionSynchronizes instance recovery
Instance Recoveryenq: IR – contention2Synchronizes parallel instance recovery and shutdown immediate
Instance Stateenq: IS – contentionEnqueue used to synchronize instance state changes
In-Mem Temp Table Meta Creationenq: IT – contentionSynchronizes accesses to a temp object’s metadata
Job Queue Dateenq: JD – contentionSynchronizes dates between job queue coordinator and slave processes
Materialized Viewenq: JI – contentionLock held during materialized view operations (like refresh, alter) to prevent concurrent operations on the same materialized view
Job Queueenq: JQ – contentionLock to prevent multiple instances from running a single job
Job Schedulerenq: JS – aq syncScheduler evt code and AQ sync
Job Schedulerenq: JS – contentionSynchronizes accesses to the job cache
Job Schedulerenq: JS – evt notifyLock got during event notification
Job Schedulerenq: JS – evtsub addLock got when adding subscriber to event q
Job Schedulerenq: JS – evtsub dropLock got when dropping subscriber to event q
Job Schedulerenq: JS – job recov lockLock to recover jobs running on crashed RAC inst
Job Schedulerenq: JS – job run lock – synchronizeLock to prevent job from running elsewhere
Job Schedulerenq: JS – q mem clnup lckLock obtained when cleaning up q memory
Job Schedulerenq: JS – queue lockLock on internal scheduler queue
Job Schedulerenq: JS – sch locl enqsScheduler non-global enqueues
Job Schedulerenq: JS – wdw opLock got when doing window open/close
SQL STATEMENT QUEUEenq: JX – SQL statement queue statement
SQL STATEMENT QUEUEenq: JX – cleanup of queuerelease SQL statement resources
Scheduler Master DBRMenq: KD – determine DBRM masterDetermine DBRM master
Schedulerenq: KM – contentionSynchronizes various Resource Manager operations
Multiple Object Checkpointenq: KO – fast object checkpointCoordinates fast object checkpoint
Kupp Process Startupenq: KP – contentionSynchronizes kupp process startup
ASM Attributes Enqueenq: KQ – access ASM attributeSynchronization of ASM cached attributes
Scheduler Planenq: KT – contentionSynchronizes accesses to the current Resource Manager plan
Materialized View Log DDLenq: MD – contentionLock held during materialized view log DDL statements
AQ Notification Mail Hostenq: MH – contentionLock used for recovery when setting Mail Host for AQ e-mail notifications
Master Keyenq: MK – contentionchanging values in enc$
AQ Notification Mail Portenq: ML – contentionLock used for recovery when setting Mail Port for AQ e-mail notifications
LogMinerenq: MN – contentionSynchronizes updates to the LogMiner dictionary and prevents multiple instances from preparing the same LogMiner session
MMON restricted sessionenq: MO – contentionSerialize MMON operations for restricted sessions
Media Recoveryenq: MR – contentionLock used to coordinate media recovery with other uses of datafiles
Media Recoveryenq: MR – standby role transitionLock used to disallow concurrent standby role transition attempt
Materialized View Refresh Logenq: MS – contentionLock held during materialized view refresh to setup MV log
Online Datafile Moveenq: MV – datafile moveHeld during online datafile move operation or cleanup
MWIN Scheduleenq: MW – contentionThis enqueue is used to serialize the calibration of the           manageability schedules with the Maintenance Window
ksz synchenq: MX – sync storage server infoLock held to generate a response to the storage server information request when an instance is starting up
Outline Cacheenq: OC – contentionSynchronizes write accesses to the outline cache
Online DDLsenq: OD – Serializing DDLsLock to prevent concurrent online DDLs
Outline Nameenq: OL – contentionSynchronizes accesses to a particular outline name
OLAPI Historiesenq: OQ – xsoq*histrecbSynchronizes access to olapi history parameter CB
OLAPI Historiesenq: OQ – xsoqhiAllocSynchronizes access to olapi history allocation
OLAPI Historiesenq: OQ – xsoqhiCloseSynchronizes access to olapi history closing
OLAPI Historiesenq: OQ – xsoqhiFlushSynchronizes access to olapi history flushing
OLAPI Historiesenq: OQ – xsoqhistrecbSynchronizes access to olapi history globals
TEXT: Generic Lockenq: OT – TEXT: Generic LockCTX Generic Locks
Encryption Walletenq: OW – initializationinitializing the wallet context
Encryption Walletenq: OW – terminationterminate the wallet context
Property Lockenq: PD – contentionPrevents others from updating the same property
Parameterenq: PE – contentionSynchronizes system parameter updates
Password Fileenq: PF – contentionSynchronizes accesses to the password file
Global Parameterenq: PG – contentionSynchronizes global system parameter updates
AQ Notification Proxyenq: PH – contentionLock used for recovery when setting Proxy for AQ HTTP notifications
Remote PX Process Spawn Statusenq: PI – contentionCommunicates remote Parallel Execution Server Process creation status
Transportable Tablespaceenq: PL – contentionCoordinates plug-in operation of transportable tablespaces
Process Startupenq: PR – contentionSynchronizes process startup
PX Process Reservationenq: PS – contentionParallel Execution Server Process reservation and synchronization
ASM Partnership and Status Tableenq: PT – contentionSynchronizes access to ASM PST metadata
KSV slave startupenq: PV – syncshutSynchronizes instance shutdown_slvstart
KSV slave startupenq: PV – syncstartSynchronizes slave start_shutdown
Buffer Cache PreWarmenq: PW – flush prewarm buffersDirect Load needs to flush prewarmed buffers if DBWR 0 holds enqueue
Buffer Cache PreWarmenq: PW – perwarm status in dbw0DBWR 0 holds enqueue indicating prewarmed buffers present in cache
ASM Rollback Recoveryenq: RB – contentionSerializes ASM rollback recovery operations
Result Cache: Enqueueenq: RC – Result Cache: ContentionCoordinates access to a result-set
RAC Loadenq: RD – RAC load update RAC load info
Block Repair/Resilveringenq: RE – block repair contentionSynchronize block repair/resilvering operations
Data Guard Brokerenq: RF – DG Broker Current File IDIdentifies which configuration metadata file is current
Data Guard Brokerenq: RF – FSFO Observer HeartbeatCaptures recent Fast-Start Failover Observer heartbeat information
Data Guard Brokerenq: RF – FSFO Primary Shutdown suspendedRecords when FSFO Primary Shutdown is suspended
Data Guard Brokerenq: RF – RF – Database Automatic DisableMeans for detecting when database is being automatically disabled
Data Guard Brokerenq: RF – atomicityEnsures atomicity of log transport setup
Data Guard Brokerenq: RF – new AISynchronizes selection of the new apply instance
Data Guard Brokerenq: RF – synch: DG Broker metadataEnsures r/w atomicity of DG configuration metadata
Data Guard Brokerenq: RF – synchronization: aifo masterSynchronizes apply instance failure detection and failover operation
Data Guard Brokerenq: RF – synchronization: critical aiSynchronizes critical apply instance among primary instances
wallet_set_mkeyenq: RK – set keywallet master key rekey
RAC Encryption Wallet Lockenq: RL – RAC wallet lockRAC wallet lock
Redo Log Nab Computationenq: RN – contentionCoordinates nab computations of online logs during recovery
Multiple Object Reuseenq: RO – contentionCoordinates flushing of multiple objects
Multiple Object Reuseenq: RO – fast object reuseCoordinates fast object reuse
Resilver / Repairenq: RP – contentionEnqueue held when resilvering is needed or when datablock is repaired from mirror
Workload Capture and Replayenq: RR – contentionConcurrent invocation of DBMS_WORKLOAD_* package API
Reclaimable Spaceenq: RS – file deleteLock held to prevent file from accessing during space reclaimation
Reclaimable Spaceenq: RS – persist alert levelLock held to make alert level persistent
Reclaimable Spaceenq: RS – prevent aging list updateLock held to prevent aging list update
Reclaimable Spaceenq: RS – prevent file deleteLock held to prevent deleting file to reclaim space
Reclaimable Spaceenq: RS – read alert levelLock held to read alert level
Reclaimable Spaceenq: RS – record reuseLock held to prevent file from accessing while reusing circular record
Reclaimable Spaceenq: RS – write alert levelLock held to write alert level
Redo Threadenq: RT – contentionThread locks held by LGWR, DBW0, and RVWR to indicate mounted or open status
Redo Threadenq: RT – thread internal enable/disableThread locks held by CKPT to synchronize thread enable and disable
Rolling Migrationenq: RU – contentionSerializes rolling migration operations
Rolling Migrationenq: RU – waitingResults of rolling migration CIC
Materialized View Flagsenq: RW – MV metadata contentionLock held by CREATE/ALTER/DROP materialized viewwhile updating materialized view flags in detail tables
ASM Extent Relocation Lockenq: RX – relocate extentSynchronizes relocating ASM extents
ASM Extent Relocation Lockenq: RX – unlock extentSynchronizes unlocking ASM extents
LogicalStandbyenq: SB – logical standby metadataSynchronizes Logical Standby metadata operations
LogicalStandbyenq: SB – table instantiationSynchronizes table instantiation and EDS operations
Session Migrationenq: SE – contentionSynchronizes transparent session migration operations
AQ Notification Senderenq: SF – contentionLock used for recovery when setting Sender for AQ e-mail notifications
Active Session History Flushingenq: SH – contentionShould seldom see this contention as this Enqueue is always  acquired in no-wait mode
Streams Table Instantiationenq: SI – contentionPrevents multiple streams tabel instantiations
KTSJ Slave Task Cancelenq: SJ – Slave Task CancelSerializes cancelling task executed by slave process
Shrink Segmentenq: SK – contentionSerialize shrink of a segment
Serialize Lock requestenq: SL – escalate locksending lock escalate to LCK0
Serialize Lock requestenq: SL – get locksending lock req to LCK0
Serialize Lock requestenq: SL – get lock for undosending lock req for undo to LCK0
Shared Objectenq: SO – contentionSynchronizes access to Shared Object (PL/SQL Shared Object Manager)
Spare Enqueueenq: SP – contention 1(1) due to one-off patch
Spare Enqueueenq: SP – contention 2(2) due to one-off patch
Spare Enqueueenq: SP – contention 3(3) due to one-off patch
Spare Enqueueenq: SP – contention 4(4) due to one-off patch
Sequence Cacheenq: SQ – contentionLock to ensure that only one process can replenish the sequence cache
Synchronized Replicationenq: SR – contentionCoordinates replication / streams operations
Sort Segmentenq: SS – contentionEnsures that sort segments created during parallel DML operations aren’t prematurely cleaned up
Space Transactionenq: ST – contentionSynchronizes space management activities in dictionary-managed tablespaces
SaveUndo Segmentenq: SU – contentionSerializes access to SaveUndo Segment
Suspend Writesenq: SW – contentionCoordinates the ‘alter system suspend’ operation
Instance Undoenq: TA – contentionSerializes operations on undo segments and undo tablespaces
SQL Tuning Base Existence Cacheenq: TB – SQL Tuning Base Cache LoadSynchronizes writes to the SQL Tuning Base Existence Cache
SQL Tuning Base Existence Cacheenq: TB – SQL Tuning Base Cache UpdateSynchronizes writes to the SQL Tuning Base Existence Cache
Tablespace Checkpointenq: TC – contentionLock held to guarantee uniqueness of a tablespace checkpoint
Tablespace Checkpointenq: TC – contention2Lock of setup of a unqiue tablespace checkpoint in null mode
KTF map table enqueueenq: TD – KTF dump entriesKTF dumping time/scn mappings in SMON_SCN_TIME table
KTF broadcastenq: TE – KTF broadcastKTF broadcasting
Temporary Fileenq: TF – contentionSerializes dropping of a temporary file
Threshold Chainenq: TH – metric threshold evaluationSerializes threshold in-memory chain access
Auto Task Serializationenq: TK – Auto Task SerializationLock held by MMON to prevent other MMON spawning of Autotask Slave
Auto Task Serializationenq: TK – Auto Task Slave LockoutSerializes spawned Autotask Slaves
Log Lockenq: TL – contentionSerializes threshold log table read and update
DMLenq: TM – contentionSynchronizes accesses to an object
Temp Objectenq: TO – contentionSynchronizes DDL and DML operations on a temp object
Runtime Fixed Table Purgeenq: TP – contentionLock held during purge and dynamic reconfiguration of fixed tables.
Queue table enqueueenq: TQ – DDL contentionTM access to the queue table
Queue table enqueueenq: TQ – DDL-INI contentionStreams DDL on queue table
Queue table enqueueenq: TQ – INI contentionTM access to the queue table
Queue table enqueueenq: TQ – TM contentionTM access to the queue table
Temporary Segmentenq: TS – contentionSerializes accesses to temp segments
Tablespaceenq: TT – contentionSerializes DDL operations on tablespaces
Cross-Instance Transactionenq: TW – contentionLock held by one instance to wait for transactions on all instances to finish
Transactionenq: TX – allocate ITL entryAllocating an ITL entry in order to begin a transaction
Transactionenq: TX – contentionLock held by a transaction to allow other transactions to wait for it
Transactionenq: TX – index contentionLock held on an index during a split to prevent other operations on it
Transactionenq: TX – row lock contentionLock held on a particular row by a transaction to prevent other transactions from modifying it
User-definedenq: UL – contentionLock used by user applications
Undo Segmentenq: US – contentionLock held to perform DDL on the undo segment
AQ Notification Watermarkenq: WA – contentionLock used for recovery when setting Watermark for memory usage in AQ notifications
AWR Flushenq: WF – contentionThis enqueue is used to serialize the flushing of snapshots
Write gather local enqueueenq: WG – delete fsoacquire lobid local enqueue when deleting fso
Write gather local enqueueenq: WG – lock fsoacquire lobid local enqueue when locking fso
Being Written Redo Logenq: WL – RAC-wide SGA contentionSerialize access to RAC-wide SGA
Being Written Redo Logenq: WL – RFS global state contentionSerialize access to RFS global state
Being Written Redo Logenq: WL – Test access/lockingTesting redo transport access/locking
Being Written Redo Logenq: WL – contentionCoordinates access to redo log files and archive logs
WLM Plan Operationsenq: WM – WLM Plan activationSynchronizes new WLM Plan activation
AWR Purgeenq: WP – contentionThis enqueue handles concurrency between purging and baselines
LNS archiving logenq: WR – contentionCoordinates access to logs by Async LNS and ARCH/FG
XDB Configurationenq: XC – XDB ConfigurationLock obtained when incrementing XDB configuration version number
Auto Online Exadata disksenq: XD – ASM disk OFFLINESerialize OFFLINE Exadata disk operations
Auto Online Exadata disksenq: XD – ASM disk ONLINESerialize ONLINE Exadata disk operations
Auto Online Exadata disksenq: XD – ASM disk drop/addSerialize Auto Drop/Add Exadata disk operations
AQ Notification No-Proxyenq: XH – contentionLock used for recovery when setting No Proxy Domains for AQ HTTP notifications
ASM Extent Fault Lockenq: XL – fault extent mapKeep multiple processes from faulting in the same extent chunk
ASM Extent Relocation Enqueueenq: XQ – purificationwait for relocation before doing block purification
ASM Extent Relocation Enqueueenq: XQ – recoveryprevent relocation during _recovery_asserts checking
ASM Extent Relocation Enqueueenq: XQ – relocationwait for recovery before doing relocation
Quiesce / Force Loggingenq: XR – database force loggingLock held during database force logging mode
Quiesce / Force Loggingenq: XR – quiesce databaseLock held during database quiesce
Internal Testenq: XY – contentionLock used for internal testing
Audit Partitionenq: ZA – add std audit table partitionlock held to add partition to std audit table
FGA Partitionenq: ZF – add fga audit table partitionlock held to add partition to fga audit table
File Groupenq: ZG – contentionCoordinates file group operations
Compression Analyzerenq: ZH – compression analysisSynchronizes analysis and insert into compression$, prevents multiple threads analyzing the same table during a load
Global Context Actionenq: ZZ – update hash tableslock held for updating global context hash tables
Have a fun :)
=============================

No comments:

Post a Comment