Thursday, December 4, 2008

Redo Logs :2

Multiplexing Redo Logs:

Oracle Database lets you multiplex the redo log files of an instance to safeguard against damage to any single file. When redo log files are multiplexed, LGWR concurrently writes the same redo log information to multiple identical redo log files, thereby eliminating a single point of redo log failure.

Multiplexed redo log files are called groups. Each redo log file in a group is called a member. Redo01 and redo01a are both members of Group 1, redo02 and redo02a are both members of Group 2, and so forth. Each member in a group must be exactly the same size.

Whenever LGWR cannot write to a member of a group, the database marks that member as INVALID and writes an error message to the LGWR trace file and to the database alert file to indicate the problem with the inaccessible files

Multiplexed redo log should be symmetrical: all groups of the redo log should have the same number of members. However, the database does not require that a multiplexed redo log be symmetrical. For example, one group can have only one member, and other groups can have two members. This configuration protects against disk failures that temporarily affect some redo log members but leave others intact.

Creating Redo Log Groups:

To create new redo log group we can issue like this---

Alter database add logfile size 500k;
Or
Alter database add logfile group 1 size 500k;

Creating Redo Log Members:

In some cases, it might not be necessary to create a complete group of redo log files. A group could already exist, but not be complete because one or more members of the group were dropped (for example, because of a disk failure). In this case, you can add new members to an existing group.

To create redo log members we can issue like this…

Alter database add logfile member to group 1;
Filename should be specified, sizes need not to be..size is determined by existing members.
Renaming Redo Log:

This should be done when your DB is in mount state…move the file by using UNIX commands... (mv) and open your DB for normal operations.

mv $ORACLE_HOME/oradata/test/redo01.log $ORACLE_HOME/oradata/test/redo02.log

Dropping Redo Groups:

An instance requires at least two groups of redo log files, regardless of the number of members in the groups. (A group comprises one or more members.)
You can drop a redo log group only if it is inactive. If you need to drop the current group, first force a log switch to occur.
Make sure a redo log group is archived (if archiving is enabled) before dropping it.

Drop a group like this…

Alter database drop logfile group 1;

Dropping Redo Log Member:

To drop a redo log member, you must have the alter database system privilege.

You can drop a redo log member only if it is not part of an active or current group. If you want to drop a member of an active group, first force a log switch to occur.

Drop a member like this…

Alter database drop logfile member ;

When a redo log member is dropped from the database, the operating system file is not deleted from disk. Rather, the control files of the associated database are updated to drop the member from the database structure. After dropping a redo log file, make sure that the drop completed successfully, and then use the appropriate operating system command to delete the dropped redo log file.

Viewing Redo Log Information:

v$log --- Displays the redo log file information from the control file
v$logfile --- Identifies redo log groups and members and member status
v$log_history --- Contains log history information

No comments: