Oracle数据库之参数 _use_adaptive_log_file_sync
小标 2019-06-24 来源 : 阅读 2471 评论 0

摘要:本文主要向大家介绍了Oracle数据库之参数 _use_adaptive_log_file_sync,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。

本文主要向大家介绍了Oracle数据库之参数 _use_adaptive_log_file_sync,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。

Oracle数据库之参数 _use_adaptive_log_file_sync

The parameter “_use_adaptive_log_file_sync” was introduced in 11gR2 and controls whether adaptive switching between post/wait and polling is enabled.
In 11.2.0.1 and 11.2.0.2 the default value for the parameter is false. From 11.2.0.3, the default value has been changed to true.



ORACLE从11gR2开始,oracle写日志引入了polling机制,在此之前只有post/wait机制。为了能在两个机制之间进行自适应切换,引入了一个隐含参数"useadaptivelogfilesync"。在11.2.0.3之前,参数的默认值为false,仅启用post/wait机制。从11.2.0.3开始,默认值为true,即lgwr进程在写出日志时会选择在post/wait机制和polling机制进行自适应切换。



There are 2 methods by which LGWR and foreground processes can communicate in order to acknowledge that a commit has completed:
Post/wait - traditional method available in previous Oracle releases
LGWR explicitly posts all processes waiting for the commit to complete.
The advantage of the post/wait method is that sessions should find out almost immediately when the redo has been flushed to disk.
Polling
Foreground processes sleep and poll to see if the commit is complete.
The advantage of this new method is to free LGWR from having to inform many processes waiting on commit to complete thereby freeing high CPU usage by the LGWR.



Post/wait进制下,lgwr进程在将日志写入磁盘后,会立刻通知前台进程,log file sync等待时间相对较短,但因12C以下oracle数据库中的lgwr进程只有1个,大并发的commit会导致lgwr进程非常繁忙,cpu居高不下。lgwr与其他进程相比,更可能成为数据库的性能瓶颈。

Polling模式下,lgwr进程执行写入操作后不再单独通知前台进程写已经完成,前台进程使用定时查询的方式对写出的进度进行检查。优点是LGWR不必通知等待提交完成的许多进程,从而释放LGWR的高CPU使用率,但是会使前台进程长时间处于log file sync等待。对于交易型的系统该参数应设置为false。


启用该特性会在awr中看到redo synch poll writes、redo synch polls相关的数据不为0。同时,在lgwr的trace文件中能看到Log file sync switching to post/wait、Log file sync switching to polling等相关信息。


关闭方法:


ALTER SYSTEM SET "_use_adaptive_log_file_sync"= <FALSE/TRUE>  scope=<both/spfile/memory>;




Document 1462942.1 Adaptive Switching Between Log Write Methods can Cause 'log file sync' Waits
Document 13707904.8 Bug 13707904 - LGWR sometimes uses polling, sometimes post/wait
Document 13074706.8 Bug 13074706 - Long "log file sync" waits in RAC not correlated with slow writes
Document 1541136.1  Adaptive Log File Sync Optimization

本文由职坐标整理并发布,希望对同学们学习Oracle有所帮助,更多内容请关注职坐标数据库Oracle数据库频道!

本文由 @小标 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程