为每个组增加一个 member(一共是4个组)
先建好目录,准备放在/u01/app/oracle/oradata/ORCL/redoimage 下
[oracle@Jeames ~]$ cd /u01/app/oracle/oradata/ORCL
[oracle@Jeames ORCL]$ mkdir redoimage
SYS@ORCL> alter database add logfile member
'/u01/app/oracle/oradata/ORCL/redoimage/redo01.log' to group 1,
'/u01/app/oracle/oradata/ORCL/redoimage/redo02.log' to group 2,
'/u01/app/oracle/oradata/ORCL/redoimage/redo03.log' to group 3,
'/u01/app/oracle/oradata/ORCL/redoimage/redo04.log' to group 4;
SYS@ORCL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------- ---
3 ONLINE /u01/app/oracle/oradata/ORCL/redo03.log NO
2 ONLINE /u01/app/oracle/oradata/ORCL/redo02.log NO
1 ONLINE /u01/app/oracle/oradata/ORCL/redo01.log NO
4 ONLINE /u01/app/oracle/oradata/ORCL/redo04.log NO
1 ONLINE /u01/app/oracle/oradata/ORCL/redoimage/redo01.log NO
2 ONLINE /u01/app/oracle/oradata/ORCL/redoimage/redo02.log NO
3 INVALID ONLINE /u01/app/oracle/oradata/ORCL/redoimage/redo03.log NO
4 ONLINE /u01/app/oracle/oradata/ORCL/redoimage/redo04.log NO
注:STATUS 是 INVALID,说明 member 还没有同步好
alter system switch logfile; 至少做 4 次切换,消除 invalid
SYS@ORCL> alter system switch logfile;
SYS@ORCL> select group#,status,archived from v$log;
GROUP# STATUS ARC
---------- ---------------- ---
1 INACTIVE NO
2 ACTIVE NO
3 CURRENT NO
4 ACTIVE NO
SYS@ORCL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------- ---
3 ONLINE /u01/app/oracle/oradata/ORCL/redo03.log NO
2 ONLINE /u01/app/oracle/oradata/ORCL/redo02.log NO
1 ONLINE /u01/app/oracle/oradata/ORCL/redo01.log NO
4 ONLINE /u01/app/oracle/oradata/ORCL/redo04.log NO
1 ONLINE /u01/app/oracle/oradata/ORCL/redoimage/redo01.log NO
2 ONLINE /u01/app/oracle/oradata/ORCL/redoimage/redo02.log NO
3 ONLINE /u01/app/oracle/oradata/ORCL/redoimage/redo03.log NO
4 ONLINE /u01/app/oracle/oradata/ORCL/redoimage/redo04.log NO