Redo logs
Redo logs are critical for database and instance recovery. Proper redo log configuration is also critical for performance.
Some recommendations for redo logs configuration include:
- Implement redo logs in Automatic Storage Management (ASM).
- We strongly discourage implementing redo logs on file systems. If you
prefer file systems, you should implement redo logs on file systems that are configured to
perform I/O in small data blocks to avoid partial block writes.
Redo log buffers are typically small. If redo logs are implemented on file systems that are configured as 8KB blocks, some redo log writes requires the file system to read in the block, append the log buffer to that block and then write out the block to disk.
If you are using a file system on AIX®, the redo log file system should be configured for 512 byte blocks. See Use raw log files for reference. - If the redo logs are placed on file systems, enable direct I/O - specifically avoid the situation where the writes are buffered in the file system cache before written out to disk.
- Consider implementing redo logs on dedicated disk devices.
- Consider implementing redo log group log files on alternating disks.
Redo file size
Your choice of redo file size depends on your trade-off between performance and availability, specifically the time needed to recover the Oracle instance in the event of a failure. For performance, some installations opt to create large redo logs to reduce the frequency of log switches. However, doing so means that there are potentially more transactions in the redo logs that have to be replayed during recovery. The general rule for sizing redo log files is to look at the time it takes to switch log files. By issuing the following query you can see how often the redo log files are changing. As a general rule the logs should not be switching more that once every twenty to thirty minutes:
select * from v$loghist
order by first_time desc
The following is an example of the output:
THREAD# SEQUENCE# FIRST_CHANGE# FIRST_TIME SWITCH_CHANGE#
1 97 7132082 10/20/2011 11:47:53 PM 7155874
1 96 7086715 10/20/2011 11:32:04 PM 7132082
1 95 7043684 10/20/2011 11:15:07 PM 7086715
1 94 6998984 10/20/2011 11:00:57 PM 7043684
1 93 6950799 10/20/2011 10:48:03 PM 6998984
In the example above, the logs switched every fifteen minutes.