oracle row cache lock 之sequence
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了oracle row cache lock 之sequence,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1630字,纯文字阅读大概需要3分钟。
内容图文
![oracle row cache lock 之sequence](/upload/InfoBanner/zyjiaocheng/875/02dd582815bd4b1cb491469e26020bef.jpg)
今天遇到一个生产库产生大量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 之sequence全部内容,希望文章能够帮你解决oracle row cache lock 之sequence所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。