As you know Redo files are one of the most important file for Oracle databases. It have to be mirror and also have big enough for performance and contunity.
In Oracle formal documentation, redo switch should be between 6-8 in 1 hour. If you have a number than this( its also related what you are running) you need to change your redolog file size.
In this post, I try to explain how we can resize redolog files on RAC instance while we have ASM.
- First check existing status with below query:
select l.group#, l.thread#, f.member, l.archived, l.status, (bytes/1024/1024) fsize from gv$log l, gv$logfile f where f.group# = l.group# order by 1,2; Sample output can be like below: GROUP# THREAD# MEMBER ARCHIVED STATUS MB —— ——- ——————————— ——– ——— — 1 2 +ORADATA/test/onlinelog/group_8.882.743077403 NO CURRENT 100 2 2 +ORADATA/test/onlinelog/group_9.610.743077405 YES INACTIVE 100 3 1 +ORADATA/test/onlinelog/group_10.871.743077407 YES INACTIVE 100 4 1 +ORADATA/test/onlinelog/group_11.886.743078145 YES INACTIVE 100
2. Now our purpose is increasing redo size from 100Mb to 500 Mb. So we need to run below commands
alter database add logfile group 5 ‘+ORADATA’ size 500M; << run this command on node 2
alter database add logfile group 6 ‘+ORADATA’ size 500M; << run this command on node 2
alter database add logfile group 7 ‘+ORADATA’ size 500M; << run this command on node 1
alter database add logfile group 8 ‘+ORADATA’ size 500M; << run this command on node 1
3. Now we can run below query and we will see added redo files as UNUSED
select l.group#, l.thread#, f.member, l.archived, l.status, (bytes/1024/1024) fsize from gv$log l, gv$logfile f where f.group# = l.group# order by 1,2 / Sample output can be like below: GROUP# THREAD# MEMBER ARCHIVED STATUS MB —— ——- ——————————— ——– ——— 1 2 +ORADATA/test/onlinelog/group_1.882.743077403 NO CURRENT 100 2 2 +ORADATA/test/onlinelog/group_2.610.743077405 YES INACTIVE 100 3 1 +ORADATA/test/onlinelog/group_3.871.743077407 YES INACTIVE 100 4 1 +ORADATA/test/onlinelog/group_4.886.743078145 YES INACTIVE 100 5 2 +ORADATA/test/onlinelog/group_4.1728.743078149 NO UNUSED 500 6 2 +ORADATA/test/onlinelog/group_6.1728.743077542 NO UNUSED 500 7 1 +ORADATA/test/onlinelog/group_7.1728.743078149 NO UNUSED 500 8 1 +ORADATA/test/onlinelog/group_5.1728.743077852 NO UNUSED 500
4. Switch database by using ALTER SYSTEM SWITCH LOGFILE; until status will be not ın UNUSED status. You can also use ALTER SYSTEM CHECKPOINT command too.
5.
- Run the query at 3 again to verify the current log group is group which newly added. If status is in INACTIVE state than you can drop related group safely
Start to drop redo log groups 1, 2, and 3:
SQL> alter database drop logfile group 1;
SQL> alter database drop logfile group 2;
SQL> alter database drop logfile group 3;
SQL> alter database drop logfile group 4;