Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Resizing online redo logs

Focus mode
Resizing online redo logs - Amazon Relational Database Service

An Amazon RDS DB instance running Oracle starts with four online redo logs, 128 MB each. The following example shows how you can use Amazon RDS procedures to resize your logs from 128 MB each to 512 MB each.

/* Query V$LOG to see the logs. */ /* You start with 4 logs of 128 MB each. */ SELECT GROUP#, BYTES, STATUS FROM V$LOG; GROUP# BYTES STATUS ---------- ---------- ---------------- 1 134217728 INACTIVE 2 134217728 CURRENT 3 134217728 INACTIVE 4 134217728 INACTIVE /* Add four new logs that are each 512 MB */ EXEC rdsadmin.rdsadmin_util.add_logfile(bytes => 536870912); EXEC rdsadmin.rdsadmin_util.add_logfile(bytes => 536870912); EXEC rdsadmin.rdsadmin_util.add_logfile(bytes => 536870912); EXEC rdsadmin.rdsadmin_util.add_logfile(bytes => 536870912); /* Query V$LOG to see the logs. */ /* Now there are 8 logs. */ SELECT GROUP#, BYTES, STATUS FROM V$LOG; GROUP# BYTES STATUS ---------- ---------- ---------------- 1 134217728 INACTIVE 2 134217728 CURRENT 3 134217728 INACTIVE 4 134217728 INACTIVE 5 536870912 UNUSED 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED /* Drop each inactive log using the group number. */ EXEC rdsadmin.rdsadmin_util.drop_logfile(grp => 1); EXEC rdsadmin.rdsadmin_util.drop_logfile(grp => 3); EXEC rdsadmin.rdsadmin_util.drop_logfile(grp => 4); /* Query V$LOG to see the logs. */ /* Now there are 5 logs. */ select GROUP#, BYTES, STATUS from V$LOG; GROUP# BYTES STATUS ---------- ---------- ---------------- 2 134217728 CURRENT 5 536870912 UNUSED 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED /* Switch logs so that group 2 is no longer current. */ EXEC rdsadmin.rdsadmin_util.switch_logfile; /* Query V$LOG to see the logs. */ /* Now one of the new logs is current. */ SQL>SELECT GROUP#, BYTES, STATUS FROM V$LOG; GROUP# BYTES STATUS ---------- ---------- ---------------- 2 134217728 ACTIVE 5 536870912 CURRENT 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED /* If the status of log 2 is still "ACTIVE", issue a checkpoint to clear it to "INACTIVE". */ EXEC rdsadmin.rdsadmin_util.checkpoint; /* Query V$LOG to see the logs. */ /* Now the final original log is inactive. */ select GROUP#, BYTES, STATUS from V$LOG; GROUP# BYTES STATUS ---------- ---------- ---------------- 2 134217728 INACTIVE 5 536870912 CURRENT 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED # Drop the final inactive log. EXEC rdsadmin.rdsadmin_util.drop_logfile(grp => 2); /* Query V$LOG to see the logs. */ /* Now there are four 512 MB logs. */ SELECT GROUP#, BYTES, STATUS FROM V$LOG; GROUP# BYTES STATUS ---------- ---------- ---------------- 5 536870912 CURRENT 6 536870912 UNUSED 7 536870912 UNUSED 8 536870912 UNUSED
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.