设为首页 收藏本站
查看: 2353|回复: 0

[经验分享] OCP考题解析_043:log file sync 和 log file parallel write

[复制链接]

尚未签到

发表于 2016-9-4 11:01:18 | 显示全部楼层 |阅读模式
sys@ORCL> select EVENT,TOTAL_WAITS,TIME_WAITED,TIME_WAITED_MICRO
2         from v$system_event
3        where event like '%log file%';
EVENT                          TOTAL_WAITS TIME_WAITED TIME_WAITED_MICRO
------------------------------ ----------- ----------- -----------------
log file sequential read                 8           4             35571
log file single write                    8           1              9462
log file parallel write                968        4672          46715069
log file sync                          300        3734          37336558
  

     log file parallel write如果大于10ms就有可能I/O有问题
   log file parallel write 跟提交木有关系,提交是 log file sync,不提交也会写redo log


   log file sync等待事件是用户发出提交或回滚声明后,等待提交完成的事件,提交命令会去做日志同步,也就是写日志缓存到日志文件
   在提交命令未完成前,用户将会看见此等待事件,注意,它专指因提交,回滚而造成的写缓存到日志文件的等待
   当发生此等待事件时,有时也会伴随log file parallel write
   因为此等待事件将会写日志缓存,如果日志的I/O系统较为缓慢的话,这必将造成log file parallel write 等待
   当发生log file sync等待后,判断是否由于缓慢的日志I/O造成的,可以查看两个等待事件的等待时间
   如果比较接近,就证明日志I/O比较缓慢或重做日志过多
   这时,造成log file sync的原因是因为log file parallel write,可以参考解决log file parallel write的方法解决问题
   如果log file sync的等待时间很高,而log file parallel write的等待时间并不高
   这意味着log file sync的原因并不是缓慢的日志I/O,而是应用程序过多的提交造成的


   log file sync常常和log file parallel write一般同时关注,大致的发生过程如下:

   ① server process接到提交请求
   ② server process通知LGWR写Redo entries到Redo log file
   ③ LGWR写Redo到文件
   ④ LGWR写完通知server process
   ⑤ server process收到写完成的通知,向用户端发送提交完成
   从步①开始,server process开始等待log file sync,到步⑤结束
   步③、步④,LGWR等待log file parallel write
   log file sync是按会话累计的,而log file parallel write不是
   所以,如果log file parallel write慢,导致的放大效应很明显,十个SP等一个LGWR进程写磁盘,log file sync的等待时间就被放大了十倍
   那么,有时log file sync比log file parallel write大很大,便有两个原因,一是CPU紧张,二是同时提交的进程多
   如果10个进程同时提交,每个进程等0.1秒,加起来就一共等了1秒,而log file parallel write只会有一个进程等待,就是LGWR

   这两个等待事件属于I/O范畴,可结合vmstat和iostat查看I/O状况


     OCP考题:
  

In your production database, the total waits and the time waited for log
file parallel write are significantly high. While investigatingthe
reason, you find that there are three redo log groups with two members
in each group, and all redo log members are places on a single physical
disk. What action would you take to minimize the waits?

DSC0000.png   

A. Start the log writer slave processes
B. Increase the number of redo log files
C. Increase the size of the redo log buffer
D. Place the redo log files on the different disks.
E. Increase the number of log writer processes.
Answer:D


  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-267461-1-1.html 上篇帖子: The Open-Closed Principle (OCP) 下篇帖子: OCP考题解析_043:rman系列之 BBED破坏,BlockRecover恢复的案例演示
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表