1、查看现有日志组
select group# ,thread# ,status, members from v$log;
select group# ,thread# ,status, members from gv$log;
2、增加日志组
alter database add logfile thread 1 group 5 '+data' size 50M;
alter database add logfile thread 2 group 6 '+data' size 50M;
3、查看添加日志组情况
select group# ,thread# ,status, members from v$log;
select group# ,thread# ,status, members from gv$log;
4、需要手动切换log日志组
alter system switch logfile;
select group# ,thread# ,status, members from v$log;
5、给日志组添加成员
select MEMBER from V$logfile;
alter database add logfile member '+data' to group 1;
alter database add logfile member '+data' to group 3;
查看新添加日志组成员的状态
select GROUP#, MEMBER,STATUS,TYPE from V$logfile;
6、切换日志组
alter system switch logfile;
select GROUP#, MEMBER,STATUS,TYPE from V$logfile;
7、删除日志组和日志组成员(日志组在INACTIVE状态下)
删除日志组成员
alter database drop logfile member '+data/racdb/onlinelog/group_1.271.1033044389';
select GROUP#, MEMBER,STATUS,TYPE from V$logfile;
删除日志组
alter database drop logfile group 1;
select group# ,thread# ,status, members from v$log;
8、将日志组1重新添加
alter database add logfile thread 1 group 1 '+data' size 50M;
select group# ,thread# ,status, members from v$log;