Log Writer Process (LGWR)
Committing Redo Changes ๐ ๐งพ What Is LGWR? The Log Writer Process (LGWR) is a crucial background process in Oracle Database that ensures all changes made in memory (redo log buffer) are safely written to online redo log filesโprotecting data integrity and enabling recovery. ๐ ๏ธ What Does LGWR Do? ๐ง Function ๐ Details ๐ชต Sequential […]
Committing Redo Changes ๐
๐งพ What Is LGWR?
The Log Writer Process (LGWR) is a crucial background process in Oracle Database that ensures all changes made in memory (redo log buffer) are safely written to online redo log filesโprotecting data integrity and enabling recovery.
๐ ๏ธ What Does LGWR Do?
| ๐ง Function | ๐ Details |
|---|---|
| ๐ชต Sequential Redo Logging | Writes redo log entries from the redo log buffer to the online redo logs. |
| ๐ช Multiplexed Logging | In a multiplexed redo log setup, LGWR writes to all members of the group simultaneously. |
| โ๏ธ Delegates Work | Uses LGnn worker processes (LG00โLG99) for parallel writing operations and posting results to waiting server processes. |
| ๐ก Redo Shipping | TTnn processes (TT00โTTzz) send redo logs to standby databases when ASYNC redo transport is configured. |
๐งฉ Additional Notes
- LGWR runs as either a thread or OS process, depending on the environment.
- Operates in Oracle ASM and Oracle RACโeach RAC instance has its own redo log set.
- Ensures recoverability by immediately flushing redo entries during commits, checkpoints, and log switches.
๐ Why LGWR Matters
- Guarantees durability of transactions.
- Enables fast recovery in the event of a failure.
- Minimizes performance impact by offloading to worker processes.
๐ Tip of the Day:
Use the view V$LOGFILE and V$LOG to monitor LGWR activity and multiplexed redo log status. Keeping redo logs on separate disks enhances performance and safety!