oracle row cache lock 之sequence
今天遇到一个生产库产生大量row cache lock,以下是相应步骤:
1 查询当时P1的情况
select INSTANCE_NUMBER,p1,count(*) cnt from dba_hist_active_sess_history where event='row cache lock' and SAMPLE_TIME>=to_date('2018-08-31 10:00:00','yyyy-mm-dd hh24:mi:ss') and SAMPLE_TIME <=to_date('2018-08-31 10:40:00','yyyy-mm-dd hh24:mi:ss') group by INSTANCE_NUMBER,p1 order by cnt;
2 根据第一步查询的P1,代入到下面cache#,这里查询出来的结果是13,dc_sequences
select INST_ID, CACHE#,TYPE,GETS,PARAMETER from gv$rowcache where CACHE# in (?) order by gets;
3 查询当时用户会话量情况
select INSTANCE_NUMBER,USER_ID,count(*) cnt from dba_hist_active_sess_history 2 where SAMPLE_TIME>=to_date('2018-08-31 10:00:00','yyyy-mm-dd hh24:mi:ss') and SAMPLE_TIME <=to_date('2018-08-31 10:30:00','yyyy-mm-dd hh24:mi:ss') 3 group by INSTANCE_NUMBER,USER_ID order by 1,cnt;
4 查询对应SQL的情况
select INSTANCE_NUMBER,SAMPLE_TIME,event,sql_opname,sql_id,count(*) cnt from dba_hist_active_sess_history where SAMPLE_TIME>=to_date('2018-08-31 10:00:00','yyyy-mm-dd hh24:mi:ss') and SAMPLE_TIME <=to_date('2018-08-31 10:30:00','yyyy-mm-dd hh24:mi:ss') group by INSTANCE_NUMBER,SAMPLE_TIME,event,sql_opname,sql_id order by 2,1;
5 查询对应节点更详细的会话信息
select INSTANCE_NUMBER,SAMPLE_TIME,session_id,BLOCKING_SESSION,current_obj#,user_id,event,sql_id,P1 from dba_hist_active_sess_history where SAMPLE_TIME>=to_date('2018-08-31 10:17:00','yyyy-mm-dd hh24:mi:ss') and SAMPLE_TIME <=to_date('2018-08-31 10:20:00','yyyy-mm-dd hh24:mi:ss') and INSTANCE_NUMBER=2 and event='row cache lock';
最后定位是一个高频INSERT 语句引用SEQUENCE引起的,而这个序列是NOCAHE,改成cache恢复正常
- Oracle Row cache lock图解
- [ORACLE 11G]ROW CACHE LOCK 等待
- Oracle 11.2.0.3数据库CJQ进程造成row cache lock等待事件影响job无法停止问题分析
- Oracle Row cache lock图解
- 【转】(转)Oracle Sequence Cache 参数说明
- [Oracle] enq: TX - row lock contention 优化案例
- oracle sql调优学习笔记(二)RBO Query Tuning 之Row cache order
- Know More About Oracle Row Lock
- Oracle “enq: TX - row lock contention 等待事件 ”
- [Oracle]--Library cache lock 故障解决一例 oracle10g
- oracle错误密码导致library cache lock
- [Oracle] enq: TX - row lock contention 优化案例
- Oracle Library Cache Lock 解决思路
- Oracle Library Cache 的 lock 与 pin 说明
- hanganalyze 解决数据库row cache lock
- Latch:row cache lock 之 dc_rollback_segments等待
- Oracle Sequence Cache 参数说明
- row cache lock与seq竞争
- Know More About Oracle Row Lock(二、解决疑惑,说明行级锁和TX锁即事务锁是不同概念的两个东西)
- Troubleshooting: "WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! " (文档 ID 278316.1)