First page Back Continue Last page Graphics
Log Writer - LGWR
Writes redo log buffer to redo log file
When?
- COMMIT
- Redo log buffer 1/3 full
- Every 3 seconds
Inexpensive I/O compared to DBWR
- Sequential writes versus random, scattered writes
Writes only changed bytes, not full blocks
Supports Oracle design goal of fast commits
Notes:
The log writer background process writes the log entries in the redo log buffer (memory) to the online redo log files. Every change made in the database is logged - i.e. a log entry is written to the redo log buffer.
LGWR will write log entries to a redo log file when:
A transaction commits
The redo buffer is 1/3 full
Every 3 seconds
The redo log files are sequential files; writing to these files is a relatively inexpensive operation, when compared to the writing of the dirty data blocks from the buffer cache to the database files.
Since the redo log files contain all changes made to the database, they can be used to recover a database after either an instance failure or a media failure. Recovery from an instance failure is automatic. Recovery from a media failure requires restoring lost media from previous backups, and then applying changes since the backup from the redo logs (such recovery is actually somewhat more complex – we will cover this topic in detail later in the Introduction to RMAN lesson).