Database Reference
In-Depth Information
Later on, you can rewind that videotape and replay it to see what happened. During recov-
ery, Oracle does just that, using the online redo logs.
In this section we will discuss online redo log file basics, redo log file groups, redo log
file members, and redo log file sequence numbers.
Redo Log File Basics
Online redo logs are created when the database is created. You must have a minimum of
two redo logs in any Oracle database. When the database starts running, it will write to the
first redo log group. Once that log fills up, it will switch over and begin to write to the next
log. Once the second log fills up, the database will clear the first log and begin to write redo
into that log. Thus, redo log files are used in a round-robin style.
Redo Log File Groups
Each online redo log file is a member of a specific redo log file group . In the case where
there are just two online redo logs (the minimum allowed), there will be two groups, likely
named group 1 and group 2. You can create new online redo log groups and drop existing
groups (until you are down to just two groups) anytime online.
Redo Log File Members
As you might gather, the online redo log files are an important component of the database.
If you lose the online log files, you could permanently lose data. To protect against this,
Oracle provides for multiplexing of online redo logs within each group. Each copy of the
online redo log is considered a redo log file member , often called just a member.
Multiplexing allows you to indicate to Oracle that it should create and maintain duplicate
copies of the online redo log files. When multiplexing online redo logs, it's a good idea to put
each member on a different disk for many reasons, even on a SAN.
Redo Log Sequence Numbers
Each time an online redo log group is used, that group is assigned a unique redo log sequence
number (typically 1 for a new database). As you can see in Figure 1.1, you have two online
redo log groups. You start writing to the first online redo log group, which is log sequence 1.
Once that log group fills up, you start writing to online group 2, which was assigned
sequence number 2. Once that group fills up, you switch back to redo log group 1, reusing
that redo log group. The sequence number is incremented, though, and the redo associated
with that online redo log group will be part of sequence 3. Once that group fills up, Oracle
will switch to online log group 3. Once that group fills up, Oracle switches back to redo log
group 1, reusing that redo log group.
Sequence numbers can be very important when it comes to recovering your database, as
you will see in later chapters.
Archived Redo Logs
You may have noticed from the previous discussion on online redo logs that the redo log
files get reused over and over. As a result, the records in those log files will be lost forever
when the log file is reused. This overwriting of the online redo logs limits the recovery
options available for you to use with Oracle.
Search WWH ::




Custom Search