Memory Architecture   «Prev  Next»

Lesson 5 The redo log buffer
Objective Explain the Function of the Redo Log Buffer

Function of Oracle Redo Log Buffer

The redo log buffer is an area of memory set aside to hold redo log entries long enough for the Log Writer process to write them to the redo log files. Ideally, the log writer would write the redo log as fast as new entries were generated. Then you would not need a buffer. In reality, that's simply not feasible. This following series of images shows conceptually how the redo log buffer is used:

1) Server processes create redo log entries as they change blocks in database buffer cache.
1) Server processes create redo log entries as they change blocks in database buffer cache.

2) As redo log entries are created, they are placed in the redo log buffer
2) As redo log entries are created, they are placed in the redo log buffer

3) log writer's job is to write the redo log entries to the redo log files as fast as possible
3) The log writer's job is to write the redo log entries to the redo log files as fast as possible.

4) Log writer continuously pulls entries from the head of the redo log buffer
4) Log writer continuously pulls entries from the head of the redo log buffer, and writes those entries to a redo log file.

5) Even as entries are being written, more are being generated
5) Even as entries are being written, more are being generated

6) When one log file fills, logwriter switches to another
6) When one log file fills, logwriter switches to another

7) This process continues for as long as the database is running
7) This process continues for as long as the database is running

Redo log buffer

The redo log buffer caches redo information until it is written to the physical redo log files stored on a disk. This buffer also improves performance. Oracle caches the redo until it can be written to a disk at a more optimal time, which avoids the overhead of constantly writing the redo logs to disk.

The redo log buffer holds the most recent changes to the data blocks in the datafiles. When the redo log buffer is one-third full, or every three seconds, Oracle writes redo log records to the redo log files. As of Oracle 10g, the LGWR process will write the redo log records to the redo log files when 1MB of redo is stored in the redo log buffer. The entries in the redo log buffer, once written to the redo log files, are critical to database recovery if the instance crashes before the changed data blocks are written from the buffer cache to the datafiles. A user's committed transaction is not considered complete until the redo log entries have been successfully written to the redo log files.

SGA - Memory Structures - Quiz

Click the Quiz link below to test how well you've learned the material so far.
SGA - Memory Structures - Quiz

SEMrush Software