1、查看现有日志组

select group# ,thread# ,status, members from v$log;

Oracle RAC Redo日志文件管理_oracle

select group# ,thread# ,status, members from gv$log;

Oracle RAC Redo日志文件管理_redo log_02

2、增加日志组

alter database add logfile thread 1 group 5 '+data' size 50M;

Oracle RAC Redo日志文件管理_redo log_03

alter database add logfile thread 2 group 6 '+data' size 50M;

Oracle RAC Redo日志文件管理_oracle_04

3、查看添加日志组情况

select group# ,thread# ,status, members from v$log;

Oracle RAC Redo日志文件管理_oracle_05

select group# ,thread# ,status, members from gv$log;

Oracle RAC Redo日志文件管理_redo log_06

4、需要手动切换log日志组

alter system switch logfile;

select group# ,thread# ,status, members from v$log;

Oracle RAC Redo日志文件管理_redo log_07

5、给日志组添加成员

select MEMBER from V$logfile;

Oracle RAC Redo日志文件管理_redo log_08

alter database add logfile member '+data' to group 1;

Oracle RAC Redo日志文件管理_redo log_09

alter database add logfile member '+data' to group 3;

Oracle RAC Redo日志文件管理_oracle_10

查看新添加日志组成员的状态

select GROUP#, MEMBER,STATUS,TYPE from V$logfile;

Oracle RAC Redo日志文件管理_oracle_11

6、切换日志组

alter system switch logfile;

select GROUP#, MEMBER,STATUS,TYPE from V$logfile;

Oracle RAC Redo日志文件管理_redo log_12

7、删除日志组和日志组成员(日志组在INACTIVE状态下)

删除日志组成员

alter database drop logfile member '+data/racdb/onlinelog/group_1.271.1033044389';

Oracle RAC Redo日志文件管理_redo log_13

select GROUP#, MEMBER,STATUS,TYPE from V$logfile;

Oracle RAC Redo日志文件管理_redo log_14

删除日志组

alter database drop logfile group 1;

select group# ,thread# ,status, members from v$log;

Oracle RAC Redo日志文件管理_oracle_15

8、将日志组1重新添加

alter database add logfile thread 1 group 1 '+data' size 50M;

select group# ,thread# ,status, members from v$log;

Oracle RAC Redo日志文件管理_redo log_16