RelationalDBDesign RelationalDBDesign

Managing Redo log   «Prev  Next»

Managing the Redo log

Lesson 1
Redo logs are used by Oracle to preserve a record of transactions that have been issued against a database. In fact, transactions aren't considered to be committed until their changes have been written to the redo log. Once a record of a commit has been written to a redo log file, only then is a transaction secure.
This module will teach you how to manage and protect your redo log files. When you have finished this module, you should be able to:
  1. Explain how to protect redo log files from loss and why it is important to do so
  2. List the redo log files in your database
  3. Create new redo log files for a database
  4. Move redo log files
  5. Drop redo log files
  6. Manually force a log switch

Properly managing the database redo log is one of the most important responsibilities of a database administrator (DBA).

What role does the redo log play when Oracle Transactions are committed?

The redo log plays an important role when Oracle transactions are committed.
When a transaction is committed, changes made by the transaction are recorded in the redo log buffer in memory. The redo log buffer is a buffer that holds all changes made to the database, including changes made by DDL and DML statements. Once the redo log buffer is filled, or a log switch occurs, the changes are written to the redo log files on disk. This process is called "checkpointing". The redo log files record all changes made to the database and are used to recover the database in case of a failure.
When a commit happens, the database writes the changes to the redo log files and then sends a commit acknowledgement to the client, indicating that the transaction has been successfully committed. In the event of a crash or other failure, the database can use the redo log files to recover all committed transactions that were in progress at the time of the failure. This process is called recovery. During recovery, the database reads the redo log files and applies all changes to the database, rolling back any changes that were not committed.
In summary, the redo log plays a critical role in maintaining the consistency and integrity of the data in the Oracle database, by recording all changes made to the database, and is used to recover the database in case of failure.
In the next lesson, you will learn how to and why you should protect your redo log files.