|
Step 6 - Redo Log Files
|
Learn Oracle - Redo Log Files
Every Oracle database has a set of two or more redo log files. The set of redo log files is
collectively known as the redo log for the database. A redo log is made up of redo
entries (also called redo records). The primary function of the redo log is to record all
changes made to data. If a failure prevents modified data from being permanently
written to the datafiles, then the changes can be obtained from the redo log, so work is
never lost. To protect against a failure involving the redo log itself, Oracle allows a
multiplexed redo log so that two or more copies of the redo log can be maintained on
different disks.
Your database’s redo log consists of groups of redo log files. A group consists of a redo
log file, and its multiplexed copies. Each identical copy is said to be a member of that
group, and each group is defined by a number, such as group 1. The database log
writer process writes redo records from the memory buffer to a redo log group until
the group fills up, or a log switch operation is requested, then it writes to the next
group. This is done in a circular fashion, where the oldest group is overwritten by the
most recent redo records.
A database typically consists of three groups.
Multiplexing the Redo Log
While not multiplexing redo log groups is acceptable to a small database environment,
as your database grows in users and applications, Oracle DBA should consider adding
multiplexing. This provides better protection for data in the case of instance or media
failure.
To multiplex your redo log, Oracle DBA must add members to each redo log group. This
example will add one member to each redo log group. It is not required that redo log
groups be symmetrical (all have the same number of members), but in practice, it is
recommended that this be the case. It is required that a database have a minimum of
two redo log groups.
To create a multiplexed redo log for your database, follow these steps:
1. Navigate to the Redo Log Groups page.
2. Select a group and click Edit, or click the group number link.
The Edit Redo Log Group page appears.
3. In the Redo Log Members section, click Add.
The Add Redo Log Member page appears.
4. Enter the file name. For example, if your existing member file name is REDO01,
Oracle DBA might name this member REDO01a. Enter the file directory. Click OK.
Oracle DBA can create this file in the same directory, but it is recommended that Oracle DBA store
members on separate drives. That way, if there is a drive failure, you still have
access to one member.
5. Repeat these steps for every existing group.
When Oracle DBA add the redo log member to a group, the group’s status is marked
INVALID. This is a normal state because there is a member that has not been written to
yet. When a log switch occurs, and the invalid group becomes the current group, then
its status is marked CURRENT.
To see the status change on a log switch:
1. Navigate to the Redo Log Groups page.
2. From the Actions pull down menu, select Switch logfile. Click Go.
Oracle DBA can see that the next groups status changes from INVALID to CURRENT.
|
|
|