@ The cache_id for the holder can be determined using the following query:
@
@ set pages 999 lines 132
@
@ column name format a30
@ column held_mode format 990
@ column requent_mode format 990
@
@ select KQRFPCNM Name, KQRFPSES SID, KQRFPMOD Mode, KQRFPREQ Request
@ from X$KQRFP
@ where KQRFPCID=&Cache_id ;
@
@ On each node then, this will show you the waiters and holders for the
@ cache_id. Check the cache_id's using:
@
@ select distinct KQRFPCNM ,KQRFPCID from X$KQRFP ;
How to interpret the information obtained
Systemstate dump
Often the Row cache enqueue is a result of a chain of events and the lock being held is a symptom of another issue where a process holding the requested row cache enqueue is being blocked by other processes.
Systemstate dump can help to find which row cache is being requested and may help find the blocking process.
Example 1:
Oracle process number: 77
Unix process pid: 10846, image: oracle@cpdb4532
*** 2011-05-13 08:08:58.775
*** SERVICE NAME:(ALFCMR_SERVICE) 2011-05-13 08:08:58.775
*** SESSION ID:(1076.796) 2011-05-13 08:08:58.775
>>> WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! <<<
row cache enqueue: session: 0x1df57ade8, mode: N, request: S
>>
The header of the trace shows the Oracle process number (pid) of the process waiting for the row cache enqueue lock as well as the mode needed for the row cache enqueue.
In the example above Process 77 is waiting for a row cache needed in shared mode (request: S)
PROCESS 77
----------------------------------------
.
.
----------------------------------------
SO: 0x1cdf11958, type: 50, owner: 0x17d198288, flag: INIT/-/-/0x00
row cache enqueue: count=1 session=0x1df57ade8 bject=0x1dc9a5d30, request=S
savepoint=0x87b70d
row cache parent object: address=0x1dc9a5d30 cid=7(dc_users)
.
.
The systemstate contains process state information for every process in the database. Above we see that PROCESS 77 that dumped the systemstate is requesting row cache dc_users in shared mode.
The process state will also contain a stack useful to Oracle Support to determine what part of Oracle code is being performed, wait information and sql currently being run.
PROCESS 218:
----------------------------------------
.
.
SO: 0x1cdf118f8, type: 50, owner: 0x1ceb0f178, flag: INIT/-/-/0x00
row cache enqueue: count=1 session=0x1da54cf68 bject=0x1dc9a5d30, request=X
savepoint=0x11e
row cache parent object: address=0x1dc9a5d30 cid=7(dc_users)
Using the address for the row cache object (in this case 0x1dc9a5d30). we see that there is request by PROCESS 218 in exclusive mode for the particular row cache. A request in Exclusive mode will result in any requests in shared mode to wait behind it until it is granted the request in exclusive mode and has released it.
PROCESS 164:
----------------------------------------
.
.
O/S info: user: u1m, term: , ospid: 1234, machine: cpc44711
program:
last wait for 'SQL*Net message from client' blocking sess=0x(nil) seq=36289 wait_time=6943 seconds since wait started=2539
driver id=54435000, #bytes=1, =0
.
.
SO: 0x1cdf11418, type: 50, owner: 0x1ccc26120, flag: INIT/-/-/0x00
row cache enqueue: count=2 session=0x1df578318 object=0x1dc9a5d30, mode=S
savepoint=0xb1bd8e
row cache parent object: address=0x1dc9a5d30 cid=7(dc_users)
hash=fc968070 typ=11 transaction=(nil) flags=00000002
own=0x1dc9a5e00[0x1cdf11448,0x1cdf11448] wat=0x1dc9a5e10[0x1cdf11928,0x17d5192e0] mode=S
Process 164 is holding the row cache enqueue in Shared mode (mode=S) and thus preventing process 218 from obtaining the row cache enqueue. Furthermore we see that the process 163 is on CPU (the systemstate shows last wait for 'SQL*Net message from client' and not waiting for 'SQL*Net message from client'). To further diagnose support would need to check the stack calls included in the dump.
For each enqueue type, there are a limited number of operations that require each enqueue.
Example 2:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
ORACLE_HOME = /opt/oracle10/product/10.2.0
System name: SunOS
Node name: saecopt51
Release: 5.10
Version: Generic_144488-04
Machine: sun4v
Instance name: PORT_V16
Redo thread mounted by this instance: 1
Oracle process number: 18
Unix process pid: 6196, image: oracle@sae (MMON)
.
.
PROCESS 18:
----------------------------------------
.
.
last wait for 'ksdxexeotherwait' wait_time=0.000013 sec, seconds since wait started=6
.
.
SO: 39bf1f0e8, type: 50, owner: 3980783a0, flag: INIT/-/-/0x00
row cache enqueue: count=1 session=3be37ea80 object=39a79f090, request=S
savepoint=0x41f0ae
row cache parent object: address=39a79f090 cid=22(dc_awr_control)
hash=6f60197e typ=9 transaction=3bc39f560 flags=0000002a
own=39a79f160[39bf1f178,39bf1f178] wat=39a79f170[39bf1f118,39bf1f118] mode=X
.
.
PROCESS 269:
----------------------------------------
.
.
waiting for 'SGA: allocation forcing component growth' wait_time=0, seconds since wait started=3
.
.
SO: 39bf1f148, type: 50, owner: 3bc39f560, flag: INIT/-/-/0x00
row cache enqueue: count=1 session=3be1b7c98 object=39a79f090, mode=X
savepoint=0x41efe8
row cache parent object: address=39a79f090 cid=22(dc_awr_control)
hash=6f60197e typ=9 transaction=3bc39f560 flags=0000002a
own=39a79f160[39bf1f178,39bf1f178] wat=39a79f170[39bf1f118,39bf1f118] mode=X
.
.
In this example we see that PROCESS 18 (MMON) is waiting for row cache type dc_awr_control in SHARED mode.
The row cache lock is being held by PROCESS 269 in exclusive mode. The process is waiting for 'SGA: allocation forcing component growth' . Thus the root cause in this case is the resizing of SGA and the wait on row cache is secondary result of this
AWR Report
Top 5 Timed Events Avg %Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
SGA: allocation forcing compon 42,067,317 38,469 1 7.6 Other
CPU time 2,796 0.6
db file sequential read 132,906 929 7 0.2 User I/O
latch free 4,282,858 704 0 0.1 Other
log file switch (checkpoint in 904 560 620 0.1 Configurat
-------------------------------------------------------------
As can be seen clearly in the AWR report Top 5 Timed Events, the major issue is the 'SGA: allocation forcing component growth". This is the root cause where one of the processes as seen in the systemstate dump is holding the row cache while waiting on the above. The top 5 events do not even show waits on 'row cache' as this is a cause and not the actual root issue.
Potential reasons for "WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!"
DC_TABLESPACES
Probably the most likely cause is the allocation of new extents. If extent sizes are set low then the application may constantly be requesting new extents and causing contention. Do you have objects with small extent sizes that are rapidly growing? (You may be able to spot these by looking for objects with large numbers of extents). Check the trace for insert/update activity, check the objects inserted into for number of extents.
DC_SEQUENCESCheck for appropriate caching of sequences for the application requirements.
Note 853652.1 RAC and Sequences
Note 395314.1 RAC Hangs due to small cache size on SYS.AUDSES$ - fixed in 10.2.0.3
Note 6027068.8 Bug 6027068 - Contention on ORA_TQ_BASE sequence -fixed in 10.2.0.5 and 11.2.0.1
DC_USERSDeadlock and resulting "WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!" can occur if a session issues a GRANT to a user, and that user is in the process of logging on to the database.
Note 4604972.8 Bug 4604972 - Deadlock on dc_users by Concurrent Grant/Revoke - fixed in 11.1.0.6
Note 6143420.8 Bug 6143420 - Deadlock involving "ROW CACHE LOCK" on dc_users
AND "CURSOR: PIN S WAIT ON X"- fixed in 10.2.0.5 and 11.1.0.6
DC_OBJECTS
DC_OBJECT_IDSNote 11693365.8 Bug 11693365 - Concurrent Drop table and Select on Reference constraint table hangs
(deadlock) - fixed in 12.1
DC_SEGMENTS
This is likely to be down to segment allocation. Identify what the session holding the enqueue is doing and use errorstacks to diagnose.
DB_ROLLBACK_SEGMENTS
This is due to rollback segment allocation. Just like dc_segments,identify what is holding the enqueue and also generate errorstacks. Remember that on a multi-node system (RAC) the holder may be on another node and so multiple systemstates from each node will be required.
DC_TABLE_SCNS
Note 5756769.8 Bug 5756769 - Deadlock between Create MVIEW and DML - fixed in 10.2.0.5 ,11.1.07 and 11.2.0.1
RAC Specific Bugs
Note 6004916.8 Bug 6004916 - Hang involving row cache enqueues in RAC (ORA-4021) - fixed in 102.0.5 and 11.1.0.6
Note 8666117.8 Bug 8666117 - High row cache latch contention in RAC - fixed in 11.2.0.2 and 12.1
Note 9866045.8 Bug 9866045 - Long wait on 'wait for master scn' in LCK causing long row cache lock waits - fixed in 12.1
References
NOTE:468334.1 - How to Match a Row Cache Object Child Latch to its Row Cache
相关内容
|
返回页首