遇到latch: row cache objects等待事件:
前台业务说很慢,于是检查等待事件:
参考文档:
WAITEVENT: "latch: row cache objects" Reference Note (文档 ID 1550722.1)
SQL> select inst_id,event,count(1) from gv$session where wait_class#<> 6 group by inst_id,event order by 1,3;


   INST_ID EVENT                                                              COUNT(1)
---------- ---------------------------------------------------------------- ----------
         1 control file parallel write                                               1
         1 SQL*Net message to client                                                 1
         1 reliable message                                                          1
         1 direct path read                                                          2
         1 Standby redo I/O                                                          2
         1 latch: row cache objects                                                164


SQL> 
SQL> select count(*),P1RAW from v$session where event = 'latch: row cache objects' group by P1RAW;


  COUNT(*) P1RAW
---------- ----------------
       122 0000000E364A3470




SQL>     SELECT 
  2          kqrsttxt PARAMETER, 
  3     -- kqrstcid CACHE#, 
  4          kqrstcln "Lchild#", 
  5          kqrstgrq "DCGets", 
  6          l.gets   "LGets", 
  7          l.misses "Misses"
  8    FROM X$KQRST, V$LATCH_CHILDREN l
  9   WHERE l.addr='&P1RAW'
 10     and l.child#=KQRSTCLN
 11   ORDER BY 1,2
 12   ;
Enter value for p1raw: 0000000E364A3470
old   9:  WHERE l.addr='&P1RAW'
new   9:  WHERE l.addr='0000000E364A3470'


PARAMETER                           Lchild#     DCGets      LGets     Misses
-------------------------------- ---------- ---------- ---------- ----------
dc_rollback_segments                      1  986621136 2959867775 1557382997


SQL> 
SQL> select * from V$LATCHHOLDER;


       PID        SID LADDR            NAME                       GETS
---------- ---------- ---------------- -------------------- ----------
       292        300 0000000E364A3470 row cache objects    3130388543

然后去查询sid=300的session,没有查到:
select sid,serial#,status,state,event,machine,program from v$session where sid=300;
然后再去查询等待事件: select inst_id,event,count(1) from gv$session where wait_class#<> 6 group by inst_id,event order by 1,3;
发现已经没有latch: row cache objects 这个等待事件了...
估计sid=300的session退出了.