ITPub博客

首页 > 数据库 > Oracle > _use_adaptive_log_file_sync

_use_adaptive_log_file_sync

原创 Oracle 作者:531968912 时间:2017-05-03 21:25:05 0 删除 编辑
在11gr2以前写日志缓冲区到文件方式是通过Post/wait方式,在11gr2开始增加了Polling的方式,在11.2.0.3以前默认还是采用Post/wait方式,
11.2.0.3开始默认是两种方式自动切换。它是通过隐含参数_use_adaptive_log_file_sync进行设置,当值为true时开启自动切换模式。
NAME                          VALUE   ISDEFAULT ISMOD      ISADJ
----------------------------- ------- --------- ---------- -----
_use_adaptive_log_file_sync   TRUE    TRUE      FALSE      FALSE


Post/wait:用户会话被动等待LGWR通知redo写入到log file完毕,这种方式响应速度比较快。
若cpu空闲时采用这种方式可以体验到更好的响应时间。
Polling:用户会话主动监测LGWR是否完成写入。这种方式比Post/wait方式响应速度慢,LGWR
不直接把完成的消息通知到很多用户会话,可以节约CPU资源。若cpu繁忙时采用这种方式可以
降低cpu资源的消耗。


在lgwr日志中可以看到切换的信息
Log file sync switching to polling
Log file sync switching to post/wait


查询当前log file sync的方式
SQL> select name,value from v$sysstat where name like 'redo sync%'
NAME                                                           VALUE
-------------------------------------------------- -----------------
redo synch time                                                 4644
redo synch time (usec)                                      46422779
redo synch writes                                                 15
redo synch long waits                                              7
redo synch poll writes                                             0
redo synch polls                                                   0



查询(_use_adaptive_log_file_sync)方式:
select a.ksppinm name, b.ksppstvl value, a.ksppdesc description
from sys.x$ksppi a, sys.x$ksppcv b
where a.indx = b.indx and a.ksppinm like '\_%adaptive\_log%' escape '\'
order by name;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25462274/viewspace-2138364/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: log file sync
请登录后发表评论 登录
全部评论

注册时间:2014-09-24

  • 博文量
    576
  • 访问量
    1111376