oralce中_use_adaptive_log_file_sync参数的使用建议

_use_adaptive_log_file_sync该参数在commit次数较多的系统中,post/wait and polling特性对性能影响明显,主要是在写日志上的等待上影响了事务的提交速度.建议在11g中关闭(设置为false).

该参数可以参考以下解述:

Adaptive Log File sync was introduced in 11.2. the feature is exactly enabled since release 11.2.0.3 , It’s enabled through an underscore parameter called _use_adaptive_log_file_sync and the description of this parameter is: adaptively switch between post/wait and polling.

Oracle can switches between the 2 methods:
Post/wait, traditional method for posting completion of writes to redo log

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, a new method where the foreground process checks if the LGWR has completed the write.

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.If post/wait is selected and the foreground processes fail to receive a post from LGWR, an incident is recorded.diagnostic traces are performed, and polling is used instead of post/wait.

Oracle uses semaphores extensively, If you look for references to “commit” in the Oracle docs, you’ll find the word “post” everywhere when they talk about communication between the foreground processes and LGWR. Now, remember that a COMMIT has two options: first, IMMEDIATE or BATCH and second, WAIT or NOWAIT. It looks like this to me:

Immediate: FG process will post to LGWR, triggering I/O (default)
Batch: FG process will not post LGWR
Wait: LGWR will post FG process when I/O is complete (default)
NoWait: LGWR will not post FG process when I/O is complete

There are five more hidden parameters with that string

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;

sys@ANBOB>/

NAME VALUE DESCRIPTION
————————————————– ———- ———————————————————————-
_adaptive_log_file_sync_high_switch_freq_threshold 3 Threshold for frequent log file sync mode switches (per minute)
_adaptive_log_file_sync_poll_aggressiveness 0 Polling interval selection bias (conservative=0, aggressive=100)
_adaptive_log_file_sync_sched_delay_window 60 Window (in seconds) for measuring average scheduling delay
_adaptive_log_file_sync_use_polling_threshold 200 Ratio of redo synch time to expected poll time as a percentage
_adaptive_log_file_sync_use_postwait_threshold 50 Percentage of foreground load from when post/wait was last used
_use_adaptive_log_file_sync TRUE Adaptively switch between post/wait and polling

So how do you know if you’re using this feature? The most obvious sign will be in the LGWR trace file.
There will be messages each time that a switch happens, looking something like this:
in the case my db name and instance name both is kaoshi .

[oracle@anbob trace]$ pwd
/oracle/diag/rdbms/kaoshi/kaoshi/trace

[oracle@anbob trace]$ grep -n -B 4 “kcrfw_update_adaptive_sync_mode” *_lgwr_*

Adaptive Switching Between Log Write Methods can Cause ‘log file sync’ Waits (文档 ID 1462942.1)

kaoshi_lgwr_3823.trc-147-*** 2013-11-23 12:06:23.288
kaoshi_lgwr_3823.trc-148-Log file sync switching to polling
kaoshi_lgwr_3823.trc-149-Current scheduling delay is 1 usec
kaoshi_lgwr_3823.trc-150-Current approximate redo synch write rate is 30 per sec
kaoshi_lgwr_3823.trc:151:kcrfw_update_adaptive_sync_mode: poll->post current_sched_delay=0 switch_sched_delay=1 current_sync_count_delta=0 switch_sync_count_delta=90
kaoshi_lgwr_3823.trc-152-
kaoshi_lgwr_3823.trc-153-*** 2013-11-23 12:56:23.567
kaoshi_lgwr_3823.trc-154-Log file sync switching to post/wait
kaoshi_lgwr_3823.trc-155-Current approximate redo synch write rate is 0 per sec
kaoshi_lgwr_3823.trc:156:kcrfw_update_adaptive_sync_mode: post->poll long#=36 sync#=131 sync=390 poll=1058 rw=217 ack=0 min_sleep=1058

kaoshi_lgwr_3823.trc-160-Current scheduling delay is 1 usec
kaoshi_lgwr_3823.trc-161-Current approximate redo synch write rate is 43 per sec
kaoshi_lgwr_3823.trc-162-
kaoshi_lgwr_3823.trc-163-*** 2013-11-23 14:37:46.978
kaoshi_lgwr_3823.trc:164:kcrfw_update_adaptive_sync_mode: poll->post current_sched_delay=0 switch_sched_delay=1 current_sync_count_delta=25 switch_sync_count_delta=131
kaoshi_lgwr_3823.trc-165-
kaoshi_lgwr_3823.trc-166-*** 2013-11-23 14:37:46.978
kaoshi_lgwr_3823.trc-167-Log file sync switching to post/wait
kaoshi_lgwr_3823.trc-168-Current approximate redo synch write rate is 8 per sec
kaoshi_lgwr_3823.trc:169:kcrfw_update_adaptive_sync_mode: post->poll long#=86 sync#=121 sync=2 poll=1058 rw=152 ack=0 min_sleep=1058
Disable adaptive log file sync

If there is a need to disable adaptive log file sync this can be done by setting _use_adaptive_log_file_sync = false either in the spfile and restarting the database or dynamically in memory.

“_use_adaptive_log_file_sync” is a dynamic parameter that can be changed at system level.

ALTER SYSTEM SET “_use_adaptive_log_file_sync”= false;
Known Issues with “_use_adaptive_log_file_sync” set to TRUE

See the following documents with information on bugs involving Adaptive Log File Sync:
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

References
Waits for “log file sync” with Adaptive Polling vs Post/Wait Choice Enabled (文档 ID 1541136.1)

时间: 2024-08-13 10:15:55

oralce中_use_adaptive_log_file_sync参数的使用建议的相关文章

谈谈oralce中”_db_block_max_cr_dba”参数

_db_block_max_cr_dba 这个隐含参数的作用是控制每个block(即一个dba下,或者说x$bh.dbablk)的最多cr块的个数.默认值是6(5个CR+1个XCUR). 当产生一致性读(CR)的时候,session会从前镜像读取块,加载到buffer cache中,加载的这个块,我们叫CR copy. 保留多个版本的CR,可以缓解对buffer中block的并发争用(buffer busy wait),避免多个session同时读取一个buffer block. 但是如果版本过

Jsp页面URL中传递参数乱码的方法

  Jsp页面在URL中传递参数会出现乱码 解决方法如下: 一.使用更改Tomcat的方法.这个方法简单,但是需要改动的地方是服务器软件级别的,如果稍微变动系统将无法正确转码,移植性不高. 1.来到tomcat目录,找到conf目录下的server.xml问价,打开,找到标签,在最后添加URIEncoding='GBK',效果如下: view plaincopy to clipboardprint? port="8080"maxThreads="150"minSpa

Python的Django框架中settings文件的部署建议

这篇文章主要介绍了Python的Django框架中settings文件的部署建议,包括对local_settings的弊病的一些简单分析,需要的朋友可以参考下 django在一个项目的目录结构划分方面缺乏必要的规范,因此不同人的项目组织形式也千奇百怪,而且也很难说谁的做法就比较好.我根据自己的项目组织习惯,发布了一个项目dj-scaffold. 前些天在reddit上为我的项目dj-scaffold打了个"广告"(见:http://redd.it/kw5d4).不想评价甚糟,甚至差点被

Hadoop-2.8.0集群搭建、hadoop源码编译和安装、host配置、ssh免密登录、hadoop配置文件中的参数配置参数总结、hadoop集群测试,安装过程中的常见错误

25.集群搭建 25.1 HADOOP集群搭建 25.1.1集群简介 HADOOP集群具体来说包含两个集群:HDFS集群和YARN集群,两者逻辑上分离,但物理上常在一起 HDFS集群: 负责海量数据的存储,集群中的角色主要有NameNode / DataNode YARN集群: 负责海量数据运算时的资源调度,集群中的角色主要有 ResourceManager /NodeManager 25.1.2服务器准备 本案例使用虚拟机服务器来搭建HADOOP集群,所用软件及版本: ü Vmware 11.

mysqlcommandbuilder-mysql中修改参数保存到datatable再更新到数据库出现问题

问题描述 mysql中修改参数保存到datatable再更新到数据库出现问题 这里我使用mysqlcommandbuilder实现这一功能这样使用正确吗,有什么其他好的建议 解决方案 用不着什么command builder,你的问题是你的hardwareparameter_delectcommand没有值.你怎么写的.你直接用 MySQLCommand cmd = new MySQLCommand(sql) 解决方案二: 产生异常了.你填充的参数是不是不正确

springmvc-Spring 导入applicationContext.xml的bean中无法使用参数占位符

问题描述 Spring 导入applicationContext.xml的bean中无法使用参数占位符 不知道有人遇到过这种情况没有,在applicationContext.xml中可以正常使用参数占位符,如: <property name="driverClass" value="${jdbc.driverClass}"/> <property name="jdbcUrl" value="${jdbc.jdbcUrl

请帮忙看看,链接中传递参数总是为空,读数据库非法操作

问题描述 下面红色的代码,谢谢了<DIV><IMGsrc="eshop_img/new_comment.gif"width=190height=27></DIV><DIVstyle="PADDING-TOP:12px"id=new_commentclass=i_member_area><DIVid=comment_c><ULid=new_commentclass=top-list><%di

Jsp页面在URL中传递参数会出现乱码

  Jsp页面在URL中传递参数会出现乱码 解决方法如下: 一.使用更改Tomcat的方法.这个方法简单,但是需要改动的地方是服务器软件级别的,如果稍微变动系统将无法正确转码,移植性不高. 1.来到tomcat目录,找到conf目录下的server.xml问价,打开,找到<Connector>标签,在最后添加URIEncoding='GBK',效果如下: <Connector port="8080" maxThreads="150" minSpar

* java 中的数组 对象数组 以及main方法中的参数 x y不用中间参数实现交换

 /*  java 中的数组  对象数组   以及main方法中的参数    x y不用中间参数实现交换java 基本数据类型 的数组 初始化元素为 0java中数组名.length表示数组中元素的个数 main方法中的 args[] 从0开始 是java 类  后面的字符串  args.length也是保存了 元素的个数 System.out.println()  在打印对象的时候 包括我们自己定义的对象 他会调用toString方法 因为所有类都是从object派生而来  打印出类测描述建议