Friday, May 18, 2012

How to mirror redo log files


Let say we have 3 groups with 1 member each and we want to multiplex them to 3 groups with 3 members each.


sys@MIKI> select member from v$logfile where group#='1';

MEMBER
-----------------------------------------------------------------
C:\APP\MRUHTEL\ORADATA\MIKI\REDO01.LOG

sys@MIKI> select member from v$logfile where group#='2';

MEMBER
-----------------------------------------------------------------
C:\APP\MRUHTEL\ORADATA\MIKI\REDO02.LOG

sys@MIKI> select member from v$logfile where group#='3';

MEMBER
-----------------------------------------------------------------
C:\APP\MRUHTEL\ORADATA\MIKI\REDO03.LOG

Now all we need to do is add members (it is online operation) to each group:

Here I am adding member B to each group:



ys@MIKI> alter database add logfile member 'c:\app\mruhtel\oradata\miki\redo01b.log' to group 1;

atabase altered.

ys@MIKI> alter database add logfile member 'c:\app\mruhtel\oradata\miki\redo02b.log' to group 2;

atabase altered.

ys@MIKI> alter database add logfile member 'c:\app\mruhtel\oradata\miki\redo03b.log' to group 3;

atabase altered.


Here I am adding member C to each group:


sys@MIKI> alter database add logfile member 'c:\app\mruhtel\oradata\miki\redo01c.log' to group 1;

Database altered.

sys@MIKI> alter database add logfile member 'c:\appmruhtel\oradata\miki\redo02c.log' to group 2;

Database altered.

sys@MIKI> alter database add logfile member 'c:\app\mruhtel\oradata\miki\redo03c.log' to group 3;

Database altered.

And voilĂ 


sys@MIKI> select member from v$logfile where group#='1';

MEMBER
--------------------------------------------------------
C:\APP\MRUHTEL\ORADATA\MIKI\REDO01.LOG
C:\APP\MRUHTEL\ORADATA\MIKI\REDO01B.LOG
C:\APP\MRUHTEL\ORADATA\MIKI\REDO01C.LOG



sys@MIKI> select member from v$logfile where group#='2';

MEMBER
-----------------------------------------------------------
C:\APP\MRUHTEL\ORADATA\MIKI\REDO02.LOG
C:\APP\MRUHTEL\ORADATA\MIKI\REDO02B.LOG
C:\APP\MRUHTEL\ORADATA\MIKI\REDO02C.LOG


sys@MIKI> select member from v$logfile where group#='3';

MEMBER
--------------------------------------------------------
C:\APP\MRUHTEL\ORADATA\MIKI\REDO03.LOG
C:\APP\MRUHTEL\ORADATA\MIKI\REDO03B.LOG
C:\APP\MRUHTEL\ORADATA\MIKI\REDO03C.LOG








No comments:

Post a Comment