Skip to content
Home » Oracle » How to Clean Fast Recovery Area by RMAN (3/8) - Delete Obsolete by Configuring More Restrictive Policies

How to Clean Fast Recovery Area by RMAN (3/8) - Delete Obsolete by Configuring More Restrictive Policies

How to Clean Fast Recovery Area by RMAN (2/8) - Delete Expired Backup or Copy
An untightened retention or deletion policy limits little to none on usage of FRA until the space is full. DBA can proactively control FRA by re-configuring a more restrictive policy as a preventive action to manage the space automatically.

Configure deletion policy of archivelog to backup one time to tape.
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO SBT;

new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE';
new RMAN configuration parameters are successfully stored

Or, you can set the deletion policy to the archivelog that have been applied on the standby database.
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
...

Configure the retention policy for all files in FRA to a 7 days of recovery window.
RMAN> configure retention policy to recovery window of 7 days;

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters are successfully stored

Display all the configuration after reconfiguring.
RMAN> show all;

RMAN configuration parameters for database with db_unique_name PRIMDB are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
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 ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE';
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_primdb1.f'; # default

Delete the files which are no longer needed to fulfill the retention policy.
RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log          58     30-OCT-12          +DATA/primdb/archivelog/2012_10_30/thread_1_seq_24.947.798044585
Archive Log          59     30-OCT-12          +DATA/primdb/archivelog/2012_10_30/thread_1_seq_25.948.798044597
...
Archive Log          261    17-DEC-12          +DATA/primdb/archivelog/2012_12_17/thread_2_seq_69.1092.802263873
Archive Log          263    17-DEC-12          +DATA/primdb/archivelog/2012_12_17/thread_1_seq_74.1093.802263875

Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_10_30/thread_1_seq_24.947.798044585 RECID=58 STAMP=798044592
deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_10_30/thread_1_seq_25.948.798044597 RECID=59 STAMP=798044597
...
deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_12_17/thread_2_seq_69.1092.802263873 RECID=261 STAMP=802263873
deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_12_17/thread_1_seq_74.1093.802263875 RECID=263 STAMP=802263879
Deleted 102 objects

If you intend to delete obsolete without asking, you can do delete noprompt obsolete.

How to Clean Fast Recovery Area by RMAN (4/8) - Delete Specific Archivelog

Leave a Reply

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