Wednesday, January 16, 2019

RMAN-08138: WARNING: archived log not deleted


Usually we do not need a backup of archived logs on standby site if backup is already configured on the primary database. In such scenario, if we try to delete old archived logs which have already been applied on the standby database my return “RMAN-08138: WARNING: archived log not deleted - must create more backups” if archive deletion policy is not properly set in the standby database.
Same error may come be returned on primary database as well while deleting archived logs without taking a backup (backup may not be needed because backup is already configured on the standby site).
RMAN> delete archivelog logseq  19541;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5883 instance=operastg1 device type=DISK
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=+FRA/mystandbydb/archivelog/2018_01_01/thread_1_seq_19541.88216.996365553 thread=1 sequence=19541

To avoid this warning and successfully delete archived logs, set the archived logs deletion policy to “APPLIED ON ALL STANDBY” only and it should not be configured to have at least one backup before it could be deleted.
Current policy is as follows which means that backup is needed for archived logs before these could be deleted.
RMAN> show archivelog deletion policy;

RMAN configuration parameters for database with db_unique_name SALMAN12 are:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY BACKED UP 1 TIMES TO DISK


Set the policy to have archived logs deleted without a backup.
RMAN> configure archivelog deletion policy to applied on all standby;

old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY BACKED UP 1 TIMES TO DISK;
new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;
new RMAN configuration parameters are successfully stored

Now there should not be any warning while deleting archived logs and archived logs should get deleted.
RMAN> delete archivelog logseq  19541;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5883 instance=operastg1 device type=DISK
List of Archived Log Copies for database with db_unique_name MYSTANDBYDB
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
69570   1    19541   A 31-DEC-18
        Name: +FRA/mystandbydb/archivelog/2019_01_01/thread_1_seq_19541.88216.996365553


Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=+FRA/mystandbydb/archivelog/2019_01_01/thread_1_seq_19541.88216.996365553 RECID=69570 STAMP=996365552
Deleted 1 objects

No comments:

Post a Comment

Popular Posts - All Times