In Oracle Database operations, disk space pressure caused by ARCHIVELOGs is an unavoidable challenge. This article explains how to use the RMAN CONFIGURE ARCHIVELOG DELETION POLICY command to set persistent ARCHIVELOG deletion policies and how to revert them to the default.
- 1. What is the ARCHIVELOG Deletion Policy? (Overview and Benefits)
- 2. [Quick Steps] Configuration, Verification, and Initialization
- 3. Types of Deletion Policies and Their Uses
- 4. Implementation Steps via CONFIGURE Command
- 5. Verification and Resetting of Settings
- 6. Troubleshooting: ORA- Errors and Workarounds
- 7. FAQ Regarding ARCHIVELOG Deletion Policy
- 8. Summary
1. What is the ARCHIVELOG Deletion Policy? (Overview and Benefits)
An ARCHIVELOG deletion policy is a set of rules designed to prevent the accidental deletion of ARCHIVELOGs required for recovery and to safely organize unneeded logs either automatically or manually.
By appropriately configuring this policy, you can prevent Fast Recovery Area (FRA) space exhaustion (such as ORA-19809) while minimizing the risk of data loss due to missing transfers in Data Guard environments or uncaptured backups.
2. [Quick Steps] Configuration, Verification, and Initialization
This is a list of basic RMAN operations available as snippets.
Check the current configuration
SHOW ARCHIVELOG DELETION POLICY;
Set a condition based on completed backups (e.g., 1 time)
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DEVICE TYPE DISK;
Reset the configuration to default (NONE)
CONFIGURE ARCHIVELOG DELETION POLICY CLEAR;
3. Types of Deletion Policies and Their Uses
It is necessary to select the optimal policy according to your environment.
| Policy Name | Content / Application Scene |
| NONE | Default setting. No restrictions are placed on deletion targets. |
| BACKED UP n TIMES | Prohibits deletion until a specified number of backups (n times) have been taken. |
| APPLIED ON ALL STANDBY | Prohibits deletion until application is complete on all standby databases (for Data Guard). |
| SHIPPED TO ALL STANDBY | Prohibits deletion until transfer to all standby databases is complete. |
4. Implementation Steps via CONFIGURE Command
Once the deletion policy is set, it is written to the control file and applied persistently.
Prerequisites
- Executing User: A user with
SYSBACKUPorSYSDBAprivileges. - Environment: Connected to the target database (CDB or PDB).
Configuration Example 1: Allow deletion of logs backed up once to disk
This is the most common setting. Until the backup is successful, the logs remain protected even if the DELETE ARCHIVELOG command is executed.
-- Connect to RMAN and execute
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DEVICE TYPE DISK;
Note: With this setting, RMAN excludes logs that do not have “at least one backup” from being eligible for deletion (Obsolete).
Configuration Example 2: Condition based on completion of application to standby DBs
In a Data Guard configuration, this prevents logs from being deleted before they are applied to the standby side.
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
5. Verification and Resetting of Settings
Always execute the verification command to ensure the current configuration is as intended.
Check current settings
RMAN> SHOW ALL;
Items that do not have # default at the end of the execution result are the currently customized settings.
RMAN> show all;
リカバリ・カタログのかわりにターゲット・データベース制御ファイルを使用しています
db_unique_name V19のデータベースにおけるRMAN構成パラメータ:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/19.0.0/dbhome_1/dbs/snapcf_v19.f'; # default
How to return to default values
If you want to return the setting to its initial state (NONE), use the CLEAR clause.
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY CLEAR;
6. Troubleshooting: ORA- Errors and Workarounds
How to handle errors likely to occur in relation to the deletion policy.
| Error Code | Cause | Verification / Workaround |
| ORA-19809 | Fast Recovery Area (FRA) capacity exceeded. | Logs that cannot be deleted due to the policy may be accumulating. |
| RMAN-08137 | ARCHIVELOG does not satisfy the deletion policy. | Delete using the FORCE option, or temporarily change the policy to NONE. |
Caution (Risks and Reversion)
Forced deletion using the FORCE option carries the risk of making recovery impossible. Priority should be given to taking a backup with BACKUP ARCHIVELOG ALL before deletion.
7. FAQ Regarding ARCHIVELOG Deletion Policy
Q: If I set a policy, is it okay to delete logs using OS commands (like rm)?
A: No. If you delete them outside of Oracle’s management, consistency with the control file will be lost. Always use the RMAN DELETE command.
Q: Is the setting effective even if I am not using the FRA (Fast Recovery Area)?
A: Yes. Even if the FRA is not used, the policy applies to deletion operations performed via RMAN.
Q: Are there any changes in new versions like 23ai?
A: The basic syntax does not change, but 23ai enhances integration with more detailed “Immutable Storage.” Knowledge from 19c remains applicable.
8. Summary
- ARCHIVELOG deletion policies can be made persistent with the
CONFIGUREcommand. - Select
BACKED UPorAPPLIED ON STANDBYaccording to your operations. - Use
CLEARto erase settings and return to default. - Always check the current values with
SHOW ALLafter changing settings.
This article is based on Oracle Database 19c (screens and default values may differ in other versions).
[reference]
Oracle Database Backup and Recovery Reference, 19c


コメント