# First add new redo groups after checking the current redo logs and groups
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 26 6596591616 512 2 NO INACTIVE 699445 23-FEB-15 719471 23-FEB-15
2 1 27 6596591616 512 2 NO CURRENT 719471 23-FEB-15 2.8147E+14
3 1 12 6596591616 512 2 YES INACTIVE 699401 23-FEB-15 699404 23-FEB-15
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------- ---
1 ONLINE /opt/app/dbname/oraredo01/dbname/redo_1a.log NO
1 ONLINE /opt/app/dbname/oraredo02/dbname/redo_1b.log NO
2 ONLINE /opt/app/dbname/oraredo01/dbname/redo_2a.log NO
2 ONLINE /opt/app/dbname/oraredo02/dbname/redo_2b.log NO
3 ONLINE /opt/app/dbname/oraredo01/dbname/redo_3a.log NO
#### adding new group ; add the same number of groups ie 3 in this case or add more if you want to increase the number of groups
alter database add logfile group 4 ('/opt/app/dbname/oraredo01/dbname/redo_4a.log','/opt/app/dbname/oraredo02/dbname/redo_4b.log') size 2048m reuse;
alter database add logfile group 5 ('/opt/app/dbname/oraredo01/dbname/redo_5a.log','/opt/app/dbname/oraredo02/dbname/redo_5b.log') size 2048m reuse;
alter database add logfile group 6 ('/opt/app/dbname/oraredo01/dbname/redo_6a.log','/opt/app/dbname/oraredo02/dbname/redo_6b.log') size 2048m reuse;
alter database add logfile group 7 ('/opt/app/dbname/oraredo01/dbname/redo_7a.log','/opt/app/dbname/oraredo02/dbname/redo_7b.log') size 2048m reuse;
##Make the new redo log CURRENT
SQL> select group#, status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 CURRENT
3 INACTIVE
4 UNUSED
5 UNUSED
6 UNUSED
7 UNUSED
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select group#, status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 ACTIVE
3 INACTIVE
4 ACTIVE
5 CURRENT
6 UNUSED
7 UNUSED
7 rows selected.
#Drop old redo logs ; Make sure their status is inactive before dropping it.
SQL> alter database drop logfile group 1;
SQL> alter database drop logfile group 2;
SQL> alter database drop logfile group 3;
## make some logswitches to make all the redo logs used.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 26 6596591616 512 2 NO INACTIVE 699445 23-FEB-15 719471 23-FEB-15
2 1 27 6596591616 512 2 NO CURRENT 719471 23-FEB-15 2.8147E+14
3 1 12 6596591616 512 2 YES INACTIVE 699401 23-FEB-15 699404 23-FEB-15
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------- ---
1 ONLINE /opt/app/dbname/oraredo01/dbname/redo_1a.log NO
1 ONLINE /opt/app/dbname/oraredo02/dbname/redo_1b.log NO
2 ONLINE /opt/app/dbname/oraredo01/dbname/redo_2a.log NO
2 ONLINE /opt/app/dbname/oraredo02/dbname/redo_2b.log NO
3 ONLINE /opt/app/dbname/oraredo01/dbname/redo_3a.log NO
#### adding new group ; add the same number of groups ie 3 in this case or add more if you want to increase the number of groups
alter database add logfile group 4 ('/opt/app/dbname/oraredo01/dbname/redo_4a.log','/opt/app/dbname/oraredo02/dbname/redo_4b.log') size 2048m reuse;
alter database add logfile group 5 ('/opt/app/dbname/oraredo01/dbname/redo_5a.log','/opt/app/dbname/oraredo02/dbname/redo_5b.log') size 2048m reuse;
alter database add logfile group 6 ('/opt/app/dbname/oraredo01/dbname/redo_6a.log','/opt/app/dbname/oraredo02/dbname/redo_6b.log') size 2048m reuse;
alter database add logfile group 7 ('/opt/app/dbname/oraredo01/dbname/redo_7a.log','/opt/app/dbname/oraredo02/dbname/redo_7b.log') size 2048m reuse;
##Make the new redo log CURRENT
SQL> select group#, status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 CURRENT
3 INACTIVE
4 UNUSED
5 UNUSED
6 UNUSED
7 UNUSED
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select group#, status from v$log;
GROUP# STATUS
---------- ----------------
1 INACTIVE
2 ACTIVE
3 INACTIVE
4 ACTIVE
5 CURRENT
6 UNUSED
7 UNUSED
7 rows selected.
#Drop old redo logs ; Make sure their status is inactive before dropping it.
SQL> alter database drop logfile group 1;
SQL> alter database drop logfile group 2;
SQL> alter database drop logfile group 3;
## make some logswitches to make all the redo logs used.
No comments:
Post a Comment