RelationalDBDesign RelationalDBDesign


Recovery File Structures   «Prev  Next»
Lesson 5 Database redo log files
ObjectiveDiscuss the role of redo log files.

Role of Database redo log files

Redo log files are used to record all changes or transactions made to the database. Every Oracle database has a minimum of two online redo log files. The primary purpose of online redo logs is to protect the database from an instance failure by storing before and after images of modified data. As users generate transactions, changes to data are stored first in memory. These changes are then written to the redo log buffer and LGWR writes this information to a redo log file. Note that LGWR is the only process that can write to redo log files. Eventually, the DBWR process writes the modified data stored in the disk buffer cache to the physical database files.
This allows the instance processes to efficiently manage writing information to disk. Writing to disk is much slower than writing to memory. By writing information to the redo logs first, Oracle does not need to constantly write data to the data files. This provides for an overall improved performance.
If you create a default database using the Oracle Database Assistant, you have four redo log files created for you. If your ORACLE_HOME is c:\oracle8, the redo log files are located in c:\oracle8\database. If your database SID is orc1, the redo log files are named log1orc1.ora, log2orc1.ora, log3orc1.ora, and log4orc1.ora.
Having all your redo log files in one subdirectory on one disk is not a good situation. If the disk crashes, the data on the redo logs is lost. Oracle provides a way to minimize this situation with multiplexed redo log file groups, which will be covered shortly.
The next lesson is about writing data to the redo log files.