There was case in one of the Production environments, where “row cache lock” wait event was topmost wait event. Below is one of the approaches that one can follow to see what is the real issue
Row Cache Lock
As seen from below awrs for time period of 12 to 18, most of time is lost on “row cache lock” wait event.
Snap Id Snap Time Sessions Curs/Sess
--------- ------------------- -------- ---------
Begin Snap: 38729 03-Dec-12 12:00:36 408 114.4
End Snap: 38735 03-Dec-12 18:00:10 282 118.7
Elapsed: 359.57 (mins)
DB Time: 6,839.92 (mins)
Top 5 Timed Events Avg %Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
row cache lock 3,980,592 285,082 72 69.5 Concurrenc
CPU time 48,706 11.9
gc buffer busy 1,591,825 13,796 9 3.4 Cluster
db file sequential read 5,521,456 12,893 2 3.1 User I/O
enq: TX - row lock contention 202,525 12,454 61 3.0 Applicatio
-------------------------------------------------------------
Now question came, what is major culprit.
Checked the Row lock wait count for that period – 3 Dec (12-18PM )
Used the below sqls
1. To check what are wait events during the particular time period(based on SNAP ids)
It will reconfirm the AWR that row lock wait is coming at top
select
EVENT, count(1)
from
DBA_HIST_ACTIVE_SESS_HISTORY
where
instance_number =1 and
snap_id between 38729 and 38735
group by event order by 2 asc;
2. To check sql ids based on event
It will give what sqls that contributed to this wait event
select distinct sql_id
from
DBA_HIST_ACTIVE_SESS_HISTORY
where
instance_number =1 and
snap_id between 38729 and 38735
and event='row cache lock';
3. To check sql, program details for sqls for particluar wait
select sql_id, PROGRAM, MODULE,count(event)
from
DBA_HIST_ACTIVE_SESS_HISTORY
where
instance_number =2 and
snap_id between 38729 and 38735
and event='row cache lock' and sql_id in ('bbacffquhrm08','b6sddsvvh6cq4')
group by sql_id, PROGRAM, MODULE order by 2 asc;
Row lock waits are related to cache_id 13, which is related to dc_sequences.
SQL_ID PROGRAM MODULE COUNT(EVENT)
————- ——- ————————
b6sdnpwzh6cq4 10535
bbarfqquhrm08 11884
4.
To check various parameters of wait events
For the sqls(captured above) that are contributing major, this will give details of the wait
select distinct sql_id, p1, p1text, p2, p2text, p3, p3text
from
DBA_HIST_ACTIVE_SESS_HISTORY
where
instance_number =2 and
snap_id between 38729 and 38735
and event='row cache lock' and sql_id in (:b1, :b2);
Wait was related to sequences.
SQL_ID P1 P1TEXT P2 P2TEXT
———- —— ——————- ———- —————————-
bbacffquhrm08 13 cache id 0 mode
b6sddsvvh6cq4 13 cache id 0 mode
Queries related to fnd_concurrent_requests were major contributor to “row cache lock” wait.
5. Now you can see what object type it is referring .
select CACHE#, PARAMETER from v$rowcache where cache#=13;
CACHE# PARAMETER
———- ——————————-
13 dc_sequences
It signifies that lock row lock waits were related to the object of SEQUENCES type.
In the same manner you can find for other objects in your case
6. Below query can be used to see other cache related information during that problem time period
select PARAMETER ,b.snap_id, b.instance_number, gets, GETMISSES, SCANS, SCANMISSES, MODIFICATIONS, FLUSHES
from
dba_hist_rowcache_summary a,
dba_hist_snapshot b
where a.SNAP_ID =b.SNAP_ID and a.instance_number=b.instance_number
--and b.instance_numer=1
and parameter like 'dc_sequences%' -- change as per your case
and
(
b.END_INTERVAL_TIME between to_timestamp('2012-12-03-12-30-00','YYYY-MM-DD-HH24-MI-SS')
and to_timestamp('2012-12-03-18-30-00','YYYY-MM-DD-HH24-MI-SS')
) order by 2 asc;
Sequence objects – row cache lock details
PARAMETER SNAP_ID INSTANCE_NUMBER GETS GETMISSES SCANS SCANMISSES MODIFICATIONS FLUSHES
dc_sequences 38730 2 1063376 418020 0 0 1063376 1063376
dc_sequences 38730 1 4019806 411951 0 0 4019806 4019806
So in my case it gave me lead that on RAC some sequences issue is there. This is already known fact but now from here I have to dig more
0.000000
0.000000