oracle dg环境主库增加redo log size
环境:11g
主库:testa 单点
备库:testb 单点
加日志之前状态:
主备库均为 5组redo log size 100m, 6组standby redo log 100m
--1、主库增加redo
alter database add logfile thread 1 group 21 '/oradata/testa/redo21.log' size 500m;
alter database add logfile thread 1 group 22 '/oradata/testa/redo22.log' size 500m;
alter database add logfile thread 1 group 23 '/oradata/testa/redo23.log' size 500m;
alter database add logfile thread 1 group 24 '/oradata/testa/redo24.log' size 500m;
alter database add logfile thread 1 group 25 '/oradata/testa/redo25.log' size 500m;
alter database add logfile thread 1 group 26 '/oradata/testa/redo26.log' size 500m;
--2、主库增加standby redo
alter database add standby logfile thread 1 group 31 '/oradata/testa/redo31std.log' size 500m;
alter database add standby logfile thread 1 group 32 '/oradata/testa/redo32std.log' size 500m;
alter database add standby logfile thread 1 group 33 '/oradata/testa/redo33std.log' size 500m;
alter database add standby logfile thread 1 group 34 '/oradata/testa/redo34std.log' size 500m;
alter database add standby logfile thread 1 group 35 '/oradata/testa/redo35std.log' size 500m;
alter database add standby logfile thread 1 group 36 '/oradata/testa/redo36std.log' size 500m;
alter database add standby logfile thread 1 group 37 '/oradata/testa/redo37std.log' size 500m;
--3、备库取消日志应用,设置为手动文件管理
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='MANUAL';
--4、备库增加redo
alter database add logfile thread 1 group 21 '/oradata/testb/redo21.log' size 500m;
alter database add logfile thread 1 group 22 '/oradata/testb/redo22.log' size 500m;
alter database add logfile thread 1 group 23 '/oradata/testb/redo23.log' size 500m;
alter database add logfile thread 1 group 24 '/oradata/testb/redo24.log' size 500m;
alter database add logfile thread 1 group 25 '/oradata/testb/redo25.log' size 500m;
alter database add logfile thread 1 group 26 '/oradata/testb/redo26.log' size 500m;
--5、备库增加standby redo
alter database add standby logfile thread 1 group 31 '/oradata/testb/redo31std.log' size 500m;
alter database add standby logfile thread 1 group 32 '/oradata/testb/redo32std.log' size 500m;
alter database add standby logfile thread 1 group 33 '/oradata/testb/redo33std.log' size 500m;
alter database add standby logfile thread 1 group 34 '/oradata/testb/redo34std.log' size 500m;
alter database add standby logfile thread 1 group 35 '/oradata/testb/redo35std.log' size 500m;
alter database add standby logfile thread 1 group 36 '/oradata/testb/redo36std.log' size 500m;
alter database add standby logfile thread 1 group 37 '/oradata/testb/redo37std.log' size 500m;
--6、主库删除老的redo
alter system switch logfile; 可执行多次,只至需要删除的group 状态为inactive 切换logfile是要删除的group没有current或者active状态
selecct * from v$Log; 确认状态为inactive
alter database clear logfile group 1;
alter database clear logfile group 2;
alter database clear logfile group 3;
alter database clear logfile group 4;
alter database clear logfile group 5;
alter database clear logfile group 6;
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 4;
alter database drop logfile group 5;
alter database drop logfile group 6;
--7、主库删除老的standby redo
selecct * from v$standby_log; 确认要删除的日志状态为非active
alter database drop standby logfile group 7;
alter database drop standby logfile group 8;
alter database drop standby logfile group 9;
alter database drop standby logfile group 10;
alter database drop standby logfile group 11;
alter database drop standby logfile group 12;
alter database drop standby logfile group 13;
--8、备库删除老的redo
select group#,status from v$Log;
注:如果是current 状态,可在主库进行switch logfile操作;
alter database clear logfile group 1;
alter database clear logfile group 2;
alter database clear logfile group 3;
alter database clear logfile group 4;
alter database clear logfile group 5;
alter database clear logfile group 6;
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 4;
alter database drop logfile group 5;
alter database drop logfile group 6;
--9、备库删除老的standby redo
select * from v$standby_log; 确认要删除的日志状态为非active
alter database drop standby logfile group 7;
alter database drop standby logfile group 8;
alter database drop standby logfile group 9;
alter database drop standby logfile group 10;
alter database drop standby logfile group 11;
alter database drop standby logfile group 12;
alter database drop standby logfile group 13;
--备库设置自动管理文件,打开恢复进程
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO';
alter database recover managed standby database using current logfile disconnect from session;
--测试日志是否正常切换应用
alter system switch logfile;