Multiplexing the Redo Log Files

To protect against failure of the redo logs, Oracle allows redo logs to be multiplexed. With multiplexed redo logs two or more identical copies can be placed in separate locations. The log writer process (LGWR) writes the same redo information to each multiplexed log.

Multiplexing uses groups of redo log files. A group contains a redo log and all of its multiplexed copies. Each copy or member is identical. It is required that there are at least two groups and in the case of multiple members per group that all members be the same size. It is recommend but not required that each group has the same number of members.

First we take a look at our current redo log groups and see how many members are in each group.

SQL> select group#, members, bytes from v$log;

    GROUP#    MEMBERS      BYTES
---------- ---------- ----------
         1          1   52428800
         2          1   52428800
         3          1   52428800

SQL>

Here we see that there are three redo log groups with one member each and that the log files are 50MB in size.

In this example we will add one member to each group using ALTER DATABASE ADD LOGFILE MEMBER TO GROUP.

SQL> alter database
  2  add logfile member '/u03/app/oracle/oradata/orcl/redo/redo01_b.log'
  3  to group 1;

Database altered.

SQL> alter database
  2  add logfile member '/u03/app/oracle/oradata/orcl/redo/redo02_b.log'
  3  to group 2;

Database altered.

SQL> alter database
  2  add logfile member '/u03/app/oracle/oradata/orcl/redo/redo03_b.log'
  3  to group 3;

Database altered.

SQL> host

Now when we execute the first query we see that each group has two members.

SQL> select group#, members, bytes from v$log;

    GROUP#    MEMBERS      BYTES
---------- ---------- ----------
         1          2   52428800
         2          2   52428800
         3          2   52428800

SQL>

If you happen to be need another redo log group you can multiplex the group at creation by specifying two file names. Below is an example of creating a multiplexed redo log group with two members with ALTER DATABASE ADD LOGFILE GROUP.

SQL> alter database
  2  add logfile group 4
  3  ('/u02/app/oracle/oradata/orcl/redo/redo04.log','/u03/app/oracle/oradata/orcl/redo/redo04_b.log')
  4  size 50M;

Database altered.

SQL>

Now looking at V$LOG we see four groups with two members each.

SQL> select group#, members, bytes from v$log;

    GROUP#    MEMBERS      BYTES
---------- ---------- ----------
         1          2   52428800
         2          2   52428800
         3          2   52428800
         4          2   52428800

SQL>

9 thoughts on “Multiplexing the Redo Log Files”

  1. Thanks a lot for this. I was know theory of Logfiles but don’t know how to do this practically.

  2. Thanks a lot for this Sir, very helpful. Could you please tell what steps are to be followed before adding the members? Do I need to check the status of the logs? If it’s an Active one can we go ahead with adding a member? I suppose the safest way would be to stop the database and start it up in mount mode to do this? Kindly advise.

  3. We are currently copying the redo to another Oracle instance in a secondary datacenter. It appears when we copy it the OS is locking the file temporarily and causing some performance issues during this brief moment when the file is locked for copy. Our DB admin set up a multiplex config hoping to just copy a secondary copy of the redo log, but it didn’t appear to alleviate the problem. He stated the additional copy of the redo was an asynchronous copy, but given the issue we are experiencing I don’t believe this to be true, I believe it is a synchronous copy and therefore the when we attempt to copy the secondary redo log to the other datacenter it is still locking up the log file for a handful of seconds. IS there a way to script the copy the redo log, or a secondary redo log, to a secondary location without the performance hit?

Leave a Reply

Your email address will not be published. Required fields are marked *