Skip to content

Fatih Acar's blog

About of Database Systems and Information Technologies

Menu
  • Home
  • About Me
  • Contact Me
Menu

Oracle 11g R2 Resize Redo Log Size on Data Guard and Primary Database

Posted on 28/03/201728/03/2017 by Fatih Acar

Sometimes, you may need to change redo log size to perform optimum size for performance. If you want to change redo log size of both standby side and primary side, you can use below commands.

Current Status Of Redo Logs

Primary Side


SQL> select group#,sum(bytes/1024/1024)"Size in MB" from v$log group by group#;
 
GROUP#     Size in MB
-------    ----------
1          50
2          50
3          50
 
SQL> select group#,sum(bytes/1024/1024)"Size in MB" from v$standby_log group by group#;
 
GROUP#   Size in MB
-------  ----------
 4       50
 5       50
 6       50
 7       50

Standby Side



SQL> select group#, sum(bytes/1024/1024)"Size in MB" from v$loggroup by group#;
 
GROUP# Size in MB
------ -------------
 1     50
 2     50
 3     50
 
SQL> select group#,sum(bytes/1024/1024)"Size in MB" from v$standby_log group by group#;
 
GROUP# Size in MB
------ ----------
 4     50
 5     50
 6     50
 7     50

Change Size Of Redo Logs

Auto File Management Disable on Standby Side


SQL> alter system set standby_file_management=manual

System altered.

Change Redo Log Size Of Primary Side


Note: You can drop log file when status is INACTIVE or UNUSED. Check status of redo log files.

SQL> select group#,status from v$log;
 
GROUP# STATUS
------ -------------------
1      INACTIVE
2      INACTIVE
3      CURRENT

SQL> alter database drop logfile group 1;
 
Database altered.
 
SQL> alter database add logfile group 1 size 100M;
 
Database altered.
 
SQL> select group#,status from v$log;
 
GROUP# STATUS
------ -------
1      UNUSED
2      INACTIVE
3      CURRENT
 
SQL> alter database drop logfile group 2;
 
Database altered.
 
SQL> alter database add logfile group 2 size 100M;
 
Database altered.
 
SQL> select group#,status from v$log;
 
GROUP# STATUS
------ -------
1      UNUSED
2      UNUSED
3      CURRENT

Note : You can use switch logfile command to change status of group 3 redo log files. 

SQL> alter system switch logfile;

System altered.

SQL> select group#,status from v$log;
 
GROUP# STATUS
------ -------
1      CURRENT
2      UNUSED
3      INACTIVE

SQL> alter database drop logfile group 3;
 
Database altered.
 
SQL> alter database add logfile group 3 size 100M;
 
Database altered.

SQL> select group#,sum(bytes/1024/1024)"size in MB" from v$log group by group#;
 
GROUP# size in MB
------ -------------
1      100
2      100
3      100

Standby Redo Log Resizing

Note : If you do not switchover, your standby log file status on primary side should be UNASSIGNED

SQL> select group#,sum(bytes/1024/1024)"size in MB" from v$standby_log group by group#;
 
GROUP# size in MB
------ -------------
6      50
4      50
5      50
7      50
 
SQL> select group#,status from v$standby_log;
 
GROUP# STATUS
------ ------------
4      UNASSIGNED
5      UNASSIGNED
6      UNASSIGNED
7      UNASSIGNED

SQL> alter database drop standby logfile group 4;
 
Database altered.
 
SQL> alter database add standby logfile group 4 size 100M;
 
Database altered.

SQL> alter database drop standby logfile group 5;
 
Database altered.
 
SQL> alter database add standby logfile group 5 size 100M;
 
Database altered.

SQL> alter database drop standby logfile group 6;
 
Database altered.
 
SQL> alter database add standby logfile group 6 size 100M;
 
Database altered.

SQL> alter database drop standby logfile group 7;
 
Database altered.
 
SQL> alter database add standby logfile group 7 size 100M;
 
Database altered.

SQL> select group#,sum(bytes/1024/1024)"size in MB" from v$standby_log group by group#;
 
GROUP# size in MB
------ -------------
4      100
5      100
6      100
7      100

Change Redo Log Size Of Standby Side



Note : Firstly, cancel appling from primary.

SQL> alter database recover managed standby database cancel;
 
Database altered.

Note : Redo log status have to be UNUSED. You can use clear command and then you can drop redo log files.

SQL> select group#,status from v$log;
 
GROUP# STATUS
------ -------------------
1      CURRENT
2      CLEARING
3      CLEARING

Note : If you attempt to drop redo log file when status is not UNUSED, you can take below error.

SQL> alter database drop logfile group 2;
alter database drop logfile group 2
*
ERROR at line 1:
ORA-01156: recovery or flashback in progress may need access to files.

Note : You have to clear redo log file before drop.

SQL> alter database clear logfile group 2;
 
Database altered.
 
SQL> alter database drop logfile group 2;
 
Database altered.
 
SQL> alter database add logfile group 2 size 100M;
 
Database altered.

SQL> alter database clear logfile group 3;
 
Database altered.
 
SQL> alter database drop logfile group 3;
 
Database altered.
 
SQL> alter database add logfile group 3 size 100M;
 
Database altered.

SQL> select group#,status from v$log;
 
GROUP# STATUS
------ -------------------
1      CURRENT
2      UNUSED
3      UNUSED

Note : You can use switch logfile command on primary side to change log file status of standby database.

On primary side

SQL> alter system switch logfile;

System altered.

Note : You can clear and drop redo log file on standby site.

SQL> alter database clear logfile group 3;
 
Database altered.
 
SQL> alter database drop logfile group 3;
 
Database altered.
 
SQL> alter database add logfile group 3 size 100M;
 
Database altered.

SQL> select group#,sum(bytes/1024/1024)"size in MB" from v$log group by group#;
 
GROUP# size in MB
------ -------------
1      100
2      100
3      100

Standby Redo Log Resizing

SQL> select group#,sum(bytes/1024/1024)"size in MB" from v$standby_log group by group#;
 
GROUP# size in MB
------ --------------
4      50
5      50
6      50
7      50
 
SQL> select group#,status from v$standby_log;
 
GROUP# STATUS
------ -------------
4      UNASSIGNED
5      UNASSIGNED
6      UNASSIGNED
7      ACTIVE

SQL> alter database drop standby logfile group 4;
 
Database altered.
 
SQL> alter database add standby logfile group 4 size 100M;
 
Database altered.

SQL> alter database drop standby logfile group 5;
 
Database altered.
 
SQL> alter database add standby logfile group 5 size 100M;
 
Database altered.

SQL> alter database drop standby logfile group 6;
 
Database altered.
 
SQL> alter database add standby logfile group 6 size 100M;
 
Database altered.

Note : You can use switch logfile command on primary side to change log file status of standby database.

On primary side

SQL> alter system switch logfile;

System altered.

Note : You can clear and drop redo log file on standby site.

SQL> alter database drop standby logfile group 7;
 
Database altered.
 
SQL> alter database add standby logfile group 7 size 100M;
 
Database altered.
 
SQL> select group#,sum(bytes/1024/1024)"size in MB" from v$standby_log group by group#;
 
GROUP# size in MB
------ -------------
4      100
5      100
6      100
7      100

Auto File Management Enable on Standby Side


SQL> alter system set standby_file_management=auto

System altered.

Enable Apply Redo From Primary Side


SQL> alter system set standby_file_management=auto

System altered.

SQL> alter database recover managed standby database using current logfile disconnect;

Database altered.

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.



View Fatih ACAR's profile on LinkedIn

Categories

  • Databases (329)
    • MsSQL Server (18)
      • Administration (16)
      • Errors and Solutions (4)
      • SQL (2)
    • MySQL (5)
      • Administration (4)
      • Backup And Recovery (1)
      • Errors and Solutions (1)
    • Oracle (290)
      • Administration (79)
      • Backup And Recovery (29)
      • Errors and Solutions (195)
      • Procedure (10)
      • SQL (32)
    • PostgreSQL (16)
      • Administration (15)
      • Errors and Solutions (3)
      • SQL (2)
    • Redis (1)
  • Microsotf Dynamics CRM (1)
  • Operating Systems (47)
    • Linux & Unix (34)
    • Windows (13)
  • Programing (5)
    • Python (5)
  • SAP (15)
    • Errors and Solutions (4)
    • SAP Basis (12)
  • Security (8)
    • Database Security (6)
    • Information Security (1)
    • System Security (4)
  • VMware (4)

Recent Posts

  • Redis 7 Sentinel Infrastructure Installation
  • Oracle Database 19c Multi Data Guard and DML Redirect, Switchover-Failover Operations on Oracle Linux 8
  • Oracle Database 23ai Free Installation Steps on Oracle Linux 9
  • Oracle Database 19c Active Data Guard Installation and DML Redirect, Switchover-Failover Operations on Oracle Linux 8
  • Oracle Database 19c Installation and 19.22 RU Patch Apply on Oracle Linux 8

Resources

  • Oracle
  • PostgreSQL

Blogroll

  • Gökhan Atıl
  • H. Koray Gündüz
  • Hakan Talip Öztürk
  • Zekeriya Beşiroğlu

Web Pages

  • BT Çözümleri

Tag Cloud

Administration Backup and Recovery Cluster Systems Database Administration Database Security Linux Linux Administration MsSQL Server MsSQL Server Error and Solutions MySQL MySQL Administration ORA-00018 ORA-00020 Oracle Oracle 12c Oracle 19c Oracle Administration Oracle Backup and Restore Oracle Data Guard Oracle Data Guard Failover Oracle Data Guard Switchover Oracle Error Solutions Oracle Linux Oracle Rman Backup Oracle Security Oracle SQL Query PostgreSQL PostgreSQL Administration PostgreSQL High Availability PostgreSQL Hot Standby Python SAP Basis Sap Errors and Solutions Sap System Administration SQL SQL Server Administration SQL Server Availability Group Stored Procedure System Administration System Security VMware VMware Administration Windows Windows Batch Script Windows Server

Social

  • View facar1987’s profile on Twitter
  • View facar’s profile on LinkedIn

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 17 other subscribers
©2026 Fatih Acar's blog | Built using WordPress and Responsive Blogily theme by Superb