Log Writer Process (LGWR)


Oracle database keeps record of changes made to data. Every time user performs a DML, DDL or DCL operation, its redo entries are also created. These redo entries contain commands to rebuild or redo the changes. These entries are stored in Redo Log buffer. Log writer process (LGWR) writes these redo entries to redo log files. Redo log buffer works in circular fashion. It means that it overwrites old entries. Before overwriting LGWR writes  old entries in to redo log files. Log writer process (LGWR) writes redo entries after certain amount of time to ensure that free space is available for new redo entries. LGWR process writes

  • When a transaction commits
  • When the redo log buffer cache is one-third full
  • When there is more than a megabyte of changes records in the redo log buffer cache
  • Before DBWn writes modified blocks in the database buffer cache to the data files
  • Every 3 seconds.

 Because the redo is needed for recovery, LGWR confirms the commit only after the redo is
written to disk. When DBWn writes modified data from Database buffer cache to disk, corresponding redo entries must also be written to disk. DBWn process checks for redo entries, it signal LGWR process if redo entries have not been written.
When a user commits a transaction, the transaction is assigned a system change number (SCN), which Oracle records along with the transaction's redo entries in the redo log. SCNs are recorded in the redo log so that recovery operations can be synchronized in Real Application Clusters and distributed databases.

 LOG_BUFFER initialization parameter is used to set the size Redo Log buffer.

Related Post :-

People who read this post also read :



0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More