理解redo(9)10g R2后oracle对redo写的增强
来源:互联网 发布:java软件技术学校 编辑:程序博客网 时间:2024/05/22 06:24
10G R2后,ORACLE提供了一个新参数commit_write来控制客户端commit后,ORACLE写日志的行为。这个参数值有四种组合。
· immediate , wait
注释:Server process在提交时使用semctl发送信号给LGWR,通知其Flush Log Buffer,并等待LGWR发回的消息(semtimedop).
LGWR在接收到消息后, Flush log buffer到磁盘,通过semctl发送信号给Server Process,告知其commit成功.
· immediate , nowait
· batch , wait
注释:Server Process在提交时使用semctl发送信号给LGWR,要求其提交后通知此Server Process进程,并等待此消息返回(运行semtmdop)
LGWR在经过一定的内部时间(Timeout)后, Flush Log Buffer到磁盘,并使用semctl通知此Server Process进程
· batch , nowait
传统的,我们的默认写方式都是immediate , wait。代表server process立即通知LGWR刷新日志,LGWR刷新完log buffer后通知server process,COMMIT成功。
如果用了nowait选项,your session doesn’t send a message to lgwr at all。不管是batch,还是immediate,在指定nowait时候,事务都是在in the near future进行提交,
而不是立即提交。因为,由下图可知:Immediate nowait和Batch nowait的redo synch writes次数都是0,即没有立即进行日志写。也就是nowait选项表示,没写完就返回“commit complete”。
如果你的系统的数据非常的重要,不能丢失任何的数据,那么需要确认wait选项,如果你的事务都是非常的小,那么batch wait将会稍微提高你的事务效率,减少了redo blocks的浪费。如果你的系统的数据丢失一点没关系,那么batch nowait是你最好的选择。这种组合对于redo的size,redo的浪费,以及用户的等待时间都是最小的。
batch和immediate有个关键的不同,immedaite把commit当成是一个单独的change vector。上图可知:immediate比batch多了一倍的redo entries。这一倍的实际内容就是commit本身产生的。也就是,batch的含义是commit本身的提交不需要以单条redo reocord的形式出现在redo log里,而immediate含义是commit本身也以一条单独的redo record记录出现在redo log里。
但不管是不是batch,ORACLE都会默默的进行group commit。
08:30:19 hr@ORCL (^ω^) show parameter commit_writNAME TYPE VALUE------------------------------------ ---------- ------------------------------commit_write string
缺省是immediate、wait。我们可以有三种方式改变之:
1)实例级别
alter system set commit_write=batch,wait;
2)会话级别
alter session set commit_write=batch,wait;
3)语句级别
commit write batch wait;
- 理解redo(9)10g R2后oracle对redo写的增强
- ORACLE 10g append跟nologging插入对REDO的影响
- 理解redo(7)oracle redo并行机制的原理介绍
- oracle触发redo写的四个条件
- 理解redo(11)truncate和select的redo
- 对Oracle Redo log的学习之一
- 11G R2 重做redo日志
- Oracle 的Redo Log
- ORACLE的redo日志
- 理解redo(10)一个IMU的问题解释
- oracle 10g standby database 实时应用 redo 数据
- 数据库崩溃后对redo log的使用
- 数据库崩溃后对redo log的使用
- oracle redo
- Oracle 11g logminer解析redo日志
- Oracle 11g Data Guard Redo应用服务
- 9.oracle的dump理解九 dump REDO文件头
- oracle 的redo和undo
- SQLite3数据库中LIMIT和 OFFSET的理解
- Axis,axis2,Xfire以及cxf对比
- 通过双击事件来修改 C1DockTabControl for WPF的状态
- perl按照字符串长度进行排序,sort函数的示例
- jsp中得到当前url
- 理解redo(9)10g R2后oracle对redo写的增强
- eclipse中的快捷键
- enq: TX - index contention
- 天线效应
- spring 定时器
- CSS - position:absolute VS position:relative
- 关于vs2005、vs2008和vs2010项目互转的总结
- [oracle学习] oracle 数据类型
- 与用户登录shell相关的文件/etc/profile,~/bashrc等浅析