redo writes的大小是变化的,与要写的the amount of redo有关。
从8i开始,LGWR试图避免等待向log buffer的不完全拷贝(也就是不等待正向log buffer拷贝redo的完成)。因此,对于后台写(3秒或1/3满),lgwr写到redo thread的末尾,或者到不包含持有redo copy latch的 redo record的最后一个块。对于COMMIT and DBWn sync writes,如果低于sync RBA的redo record依然持有redo copy latch,那么lgwr使用特殊的LGWR wait for redo copy event等待该latch。Lgwr does not attempt to take the latch, and thus does not wait for it directly under the latch free event.其后,lgwr至少写到需要同步的the highest redo block,并且possibly further subject to the retention of redo copy latches over subsequent redo records.
Lgwr不强迫the size of its writes为maximum physical I/O size.在单次写操作中,他写所有redo,并且如果必要的话,允许操作系统使用multiple physical writes完成写请求。
写出的total number of log blocks累计在system statistic的redo blocks written。The number of redo writes累计在system statistic的redo writes,这两个统计能够用来计算average redo write size.统计计算脚本:
set termout offcolumn log_block_size new_value LogBlockSizeselect max(lebsz) log_block_sizefrom sys.x_$kcclewhere inst_id = userenv('Instance')/set termout on
column write_size format 99999999999999 heading "Average Log|Write Size"
select ceil(max(decode(name, 'redo blocks written', value)) /max(decode(name, 'redo writes', value, 1))) * &LogBlockSize write_sizefrom sys.v_$sysstat/
column threshold format 99999999999999 heading "Background|Write Theshold"
select least(ceil(value/&LogBlockSize/3) * &LogBlockSize, 1024*1024) thresholdfrom sys.v_$parameterwhere name = 'log_buffer'/
column sync_cost_ratio format 990.00 heading "Sync Cost Ratio"
select (sum(decode(name, 'redo synch time', value)) / sum(decode(name, 'redo synch writes', value))) / (sum(decode(name, 'redo write time', value)) / sum(decode(name, 'redo writes', value))) sync_cost_ratiofrom sys.v_$sysstatwhere name in ('redo synch writes', 'redo synch time', 'redo writes', 'redo write time')/