Database Reference
In-Depth Information
tanel poder has an excellent latch profiler scripts ( latchprof.sql and latchprofx.sql ) on his web site
( www.tanelpoder.com ). these scripts help get to the data for analyzing these latch dependencies and contention.
Tip
Enqueues
Enqueues are also a type of locking mechanism used in Oracle. An enqueue is a more sophisticated mechanism
that permits several concurrent processes to have varying degrees of sharing of “known” resources. 6 A lock is a
resource that is used to get access to a resource that is requested by a process or session. Oracle has two kinds of
locks: enqueues and latches. Although a request for a latch is quick and inexpensive type of lock, enqueues are more
sophisticated locks for managing access to shared resources, for example, tables, rows, segments, transactions, and
so forth. Enqueues help prevent more than one process from accessing the same data structure at a given time.
Enqueues are queues, and using the FIFO method, requests are serviced in an arbitrary order. Similar to acquiring a
latch (discussed later), Oracle tries to acquire an enqueue.
When access is required by a session, a lock structure is obtained and a request is made to acquire access to the
resource at a specific level (mode). The lock structure is a three-level link lists placed on the acquirer, the waiter, and
the convertor. The user lock details of the enqueue (TX [transaction], TM [DML], and UL [user defined]) are defined
by the type of resource that requires the lock; the two lock identifier columns ID1 and ID2 have values that depend on
the type of enqueue. Apart from this, there is a lock mode used by both the holder and requestor. The following are the
different modes/requests (which is the description for the values from LMODE and REQUEST columns in V$LOCK view,
in the script below):
0 = none
1 = null (NULL)
2 = row-S (SS)
3 = row-X (SX)
4 = share (S)
5 = S/Row-X (SSX)
6 = exclusive (X)
Script: MVRACPDnTap_lockmodes.sql
SELECT inst_id,
sid,
type,
id1,
id2,
lmode,
request,
ctime,
block
6 Metalink Note # 22908.1. “What are Latches and What Causes Latch Contention.” Accessed at metalink.oracle.com .
 
 
Search WWH ::




Custom Search