Saturday, October 27, 2012

Redo Log Files

The redo log files record all the changes made to the database, and play an important role during the recovery of a database.
The set of redo log files that are currently being used to record the changes to the database are called online redo log files. These logs can be archived to a different location before being reused, and the saved logs are called archived redo logs.
Redo log files contain the following information about database changes made by transactions:
• Indicators specifying when the transaction started
• The name of the transaction
• The name of the data object that was being updated
• The “before image” of the transaction (the data as it was before the changes were made)
• The “after image” of the transaction (the data as it was after the transaction made the changes)
• Commit indicators that indicate whether and when the transaction completed.
So when a database crashes, all transactions, both uncommitted as well as committed, have to be applied to the datafiles on disk, using the information in the redo log files. All redo log transactions that have both a begin and a commit entry must be roll-farward, and all transactions that have a begin entry but no commit entry must be roll-back.Committed transactions are thus re-created by applying the “after image” records in the redo log files to the database, and incomplete transactions are undone by using the “before image” records in the undo tablespace.
Oracle requires that every database have at least two redo log groups, each group consisting of at least one individual log file member.

No comments:

Post a Comment