Oracle redo文件增加与扩容

#############################增加redo文件##############################

#主库
select * from v$logfile;
select group#,bytes/1024/1024 "size(M)",status,archived from v$log;

#group递增,大小保持一致

alter database add logfile group 9 '/u01/oradata/JXSX/redo09.log' size 200m;
alter database add logfile group 10 '/u01/oradata/JXSX/redo10.log' size 200m;
alter database add logfile group 11 '/u01/oradata/JXSX/redo11.log' size 200m;
alter database add logfile group 12 '/u01/oradata/JXSX/redo12.log' size 200m;

#备库
select group#,member,type from v$logfile order by 1;
select group#,bytes/1024/1024 from v$standby_log;

#先取消日志应用,再增加

alter database recover managed standby database cancel;

alter database add standby logfile group 29 '/u01/oradata/JXSX/sty_group_29.log' size 200m;
alter database add standby logfile group 30 '/u01/oradata/JXSX/sty_group_30.log' size 200m;
alter database add standby logfile group 31 '/u01/oradata/JXSX/sty_group_31.log' size 200m;
alter database add standby logfile group 32 '/u01/oradata/JXSX/sty_group_32.log' size 200m;

alter database recover managed standby database using current logfile disconnect;

#group组增加文件数量
alter database add logfile member '/u01/oradata/JXSX/redo10_1.log'to group 10;
alter database add logfile member '/u01/oradata/JXSX/redo11_1.log'to group 11;


#############################扩容redo文件##############################
#主库
select group#,sequence#,members,bytes,status ,archived from v$log;
#依次删除状态为inactive redo,CURRENT为活跃状态,ACTIVE为事务尚未完全应用状态

#先drop日志组,再删除日志文件

alter database drop logfile group 1;
cd /u01/oradata/JXSX
rm redo01.log
alter database add logfile group 1 '/u01/oradata/JXSX/redo01.log' size 1g;

alter database drop logfile group 2;
cd /u01/oradata/JXSX
rm redo02.log
alter database add logfile group 2 '/u01/oradata/JXSX/redo02.log' size 1g;

#DG库,先取消同步,再操作
alter database recover managed standby database cancel;
#依次删除inactive状态的standby redo
alter database drop logfile group 20;
cd /u01/oradata/JXSX/
rm sty_group_20.log
alter database add standby logfile group 20 '/u01/oradata/JXSX/sty_group_20.log' size 1g;

alter database drop logfile group 21;
cd /u01/oradata/JXSX/
rm sty_group_21.log
alter database add standby logfile group 20 '/u01/oradata/JXSX/sty_group_21.log' size 1g;
#启动同步,并检查同步情况
alter database recover managed standby database using current logfile disconnect;

 

posted on 2023-07-27 08:42  sonnyTag  阅读(590)  评论(0编辑  收藏  举报