Structure of Online Redo Log Files


Figure 9.1 shows a possible configuration of online redo log files. Notice that the groups are associated with their members and that the members are each on different disks. Also, the arrows show you how log writer cycles through the groups as it performs its processing.

Figure 9.1. Redo log groups.


You, as the database administrator (DBA), can set up the Oracle database to maintain copies of online redo log files to avoid losing database information due to a single point of failure. This is the same premise used to suggest multiplexing of control files.

Online Redo Log Groups

Online redo log groups are a set of identical copies of the online redo log files. Each set is called an online redo log group. The LGWR background process is responsible for concurrently writing the same information to all the online redo log files in a group. Because these groups are used circularly by the instance processes, it is critical that there be at least two active online redo log groups for normal operation of the database.

Online Redo Log Members

Each online redo log file in a group is known as a member. Each member in a group has an identical log sequence number and an identical size. The sequence number is assigned every time that the Oracle Server starts writing to the log group and is used to identify each log file uniquely. The current log sequence number is stored in the control file and in the header of every data file in the database.

Creating the Initial Redo Log Files

The initial set of online redo log groups and their members is created during the creation of the database. The creation of these log files is governed by the following parameters in the CREATE DATABASE command:

  • MAXLOGFILES specifies the absolute maximum number of redo log groups that can be associated with the database. The default and maximum values for MAXLOGFILES are operating system dependent.

  • MAXLOGMEMBERS determines the maximum number of members to be allowed per group. Again, the default and maximum values allowed are operating system dependent.

It is important to understand that the "files" part of the MAXLOGFILES parameter in the CREATE DATABASE command does not refer to the redo log files that are the members, but rather to the set of files that make up a group. This is because it is not strictly necessary to multiplex the redo log file members in the group. MAXLOGFILES can refer to a single file, but if you do multiplex them, it can also refer to groups of more than one file.


Now that we understand the structure of the redo log groups and the members, the next section covers how these logs work.

How Redo Logs Work

Redo logs are cyclic in fashion and function, and each group is identified by a sequence number that is overwritten each time that log is reused. When one redo log file is full, LGWR moves on to the next group. This change from one group to the next is called a log switch. At this time, a checkpoint operation also occurs in the instance, and information is concurrently written out to the control file concerning the new log number. Log writer writes under the following conditions:

  • When a transaction commits

  • When the redo log buffers in the SGA become one-third full, reach 1MB in size, or, if neither of these conditions is met, every 3 seconds

  • Before DBWn writes out the modified blocks in the database buffer cache to the data files

Now we will look at the process of log switching and checkpointing as it relates to the online redo log files.



    Oracle 9i Fundamentals I Exam Cram 2
    Oracle 9i Fundamentals I Exam Cram 2
    ISBN: 0789732653
    EAN: 2147483647
    Year: 2004
    Pages: 244
    Authors: April Wells

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net