今早上pub,看到pub的一篇帖子中提到了如何设置redo log的大小,利用视图v$log_history可以查看redo的切换的具体信息来判断。
Select round(first_time,’DD’),thead#,count(sequence#) from v$Log_history
group round(first_time,’DD’),thread#
order by 1,2
主要是通过每天的日志切换量来判断。
select a.recid,a.first_time,b.first_time last_time,(b.first_time-a.first_time)*24 redo_replace
from v$log_history a,v$log_history b
where a.recid=b.recid-1
order by a.first_time desc
这个sql可以查出两个日志切换时间间隔,单位时间间隔为小时,然后还可以参考alter trace等。在设计阶段真的要好好考虑!
联想到跟redo相关的两个等待事件:log file parallel write和log file sync
Log file parallel write:
从log buffer写retries到redo log文件,当达到阀值还没有完成会出现此等待事件。
log file sync:
当用户commit或者rollback时,此时会触发lgwr把redo retries写入redo log,而用户进程将通知lgwr写出操作,lgwr完成任务以后会通知用户进程,此时达到阀值时就会出现log file sync,这个等待事件是用于进程等待lgwr完成的通知。如果log file parallel write和log file sync出现频率相同,很有可能log file sync在等待log file parallel write的完成,此时可以判断磁盘的I/O存在瓶颈。
1 提高lgwr性能,主要从硬件着手。
2 批量提交
以下计算方法和分析摘自eygle的blog中计算平均redo写大小
avg.redo write size = (Redo block written/redo writes)*512 bytes
如果此数据偏小,系统的提交过于频繁,而过渡频繁的redo writing的latch竞争.
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25362835/viewspace-1056244/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25362835/viewspace-1056244/