RelationalDBDesign RelationalDBDesign


Tuning Instance   «Prev 

Oracle Redo Log

Redo logs are transaction journals and each transaction is recorded in the redo logs. Redo logs are used in a serial fashion with each transaction queuing up in the redo log buffers and being written one at a time into the redo logs.
Redo logs should switch about every thirty minutes. However, you may need to adjust the time up or down depending on how important your data is. The rule of thumb is to size the redo logs such that you only loose the amount of data you can stand to loose should for some reason the online redo log become corrupt. With modern Oracle redo log mirroring and with disk array mirroring and various forms of online disk repair and replacement the occurrence of redo log corruptions has dropped to practically zero, so size based on the number of archive logs you want to apply should the database fail just before your next backup.
The LOG_BUFFER_SIZE and LOG_BUFFERS parameters control the redo log buffers. The LOG_BUFFER_SIZE should be set to reduce the number of writes required per redo log but not be so large that it results in an excessive IO wait time. Some studies have shown that sizing bigger than one megabyte rarely results in performance gains. Generally I size the LOG_BUFFER_SIZE such that it is equal to or results in an even divisor of the redo log size.
Monitor redo logs using the alert log, V$LOGHIST, V$LOGFILE, V$RECOVERY_LOG and V$LOG DPTs.

Redo entries are written to the redo log buffer. When a transaction issues a COMMIT or reaches a normal end of task, the entries are written to the online redo log files. The LGWR process takes the images from the log buffer and places them into the online redo log files.

When Oracle switches redo log files, the old redo log file is copied to an archived redo log filesystem by the ARCH process. The redo log file can then be overwritten by Oracle.

As the archived red log file system becomes full, a user-written process is invoked to copy the redo log files to tape for long-term storage.