RMAN Archival (KEEP) backups and Retention Policy

(Doc ID 986382.1)

Last updated on OCTOBER 31, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.

Symptoms

RMAN does not appear to consider regular archivelog backups as obsolete even though the retention period has passed and there are full backups taken subsequently.

Assumption: this is a simple database configuration. There is no standby, no flashback logging, no streams. All files are online and not in need of backups.

Consider the following backups:

sql 'alter system switch logfile';

run {
allocate channel d1 device type disk maxopenfiles 1 rate 5m;

  backup full  tag 'LB_KEEP1DAY' format '/tmp/full_1day_%U'
     keep until time 'trunc(sysdate)+1' logs
     (database skip offline include current controlfile);

  backup tag 'LB_ARC' format '/tmp/arch_%U'
     archivelog all
     delete input;
}




The backups taken over time:

[oracle@osbr-linux testcase]$ rman target / catalog rman/rman@Rcat

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Feb 24 16:01:19 2010

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORA112 (DBID=232055638)
connected to recovery catalog database

RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time    #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------ ------- ------- ---------- ---
48      B  F  A DISK        02 FEB 10 15:30:40 1       1       NO         LB_KEEP1DAY
72      B  F  A DISK        02 FEB 10 15:44:31 1       1       NO         LB_KEEP1DAY
73      B  F  A DISK        02 FEB 10 15:44:36 1       1       NO         LB_KEEP1DAY
98      B  A  A DISK        02 FEB 10 15:44:44 1       1       NO         LB_ARC
133     B  F  A DISK        03 FEB 10 08:14:45 1       1       NO         LB_KEEP1DAY
134     B  F  A DISK        03 FEB 10 08:14:49 1       1       NO         LB_KEEP1DAY
159     B  A  A DISK        03 FEB 10 08:15:12 1       1       NO         LB_ARC
775     B  F  A DISK        12 FEB 10 15:49:49 1       1       NO         LB_KEEP1DAY
776     B  F  A DISK        12 FEB 10 15:49:55 1       1       NO         LB_KEEP1DAY
800     B  A  A DISK        12 FEB 10 15:51:13 1       1       NO         LB_ARC
1265    B  F  A DISK        24 FEB 10 15:55:02 1       1       NO         LB_NOKEEP
1266    B  F  A DISK        24 FEB 10 15:55:08 1       1       NO         LB_NOKEEP
1302    B  A  A DISK        24 FEB 10 15:59:26 1       1       NO         LB_ARC



Note: FULL backupsets 1265 and 1266 were taken with the option of keep until time 'trunc(sysdate)+1'



On the 24th of February, only the backups with KEEP options are reported as obsolete as they have past their KEEP period. The archivelog backups are NOT listed as obsolete.

[oracle@osbr-linux testcase]$ rman target / catalog rman/rman@Rcat

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Feb 24 16:02:34 2010

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORA112 (DBID=232055638)
connected to recovery catalog database

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 3 days
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           48     02 FEB 10 15:30:40
  Backup Piece       49     02 FEB 10 15:30:40 /tmp/full_1day_02l50vgu_1_1
Backup Set           72     02 FEB 10 15:44:31
  Backup Piece       76     02 FEB 10 15:44:31 /tmp/full_1day_03l5101f_1_1
Backup Set           73     02 FEB 10 15:44:36
  Backup Piece       77     02 FEB 10 15:44:36 /tmp/full_1day_04l510b1_1_1
Backup Set           133    03 FEB 10 08:14:45
  Backup Piece       137    03 FEB 10 08:14:45 /tmp/full_1day_06l52q25_1_1
Backup Set           134    03 FEB 10 08:14:49
  Backup Piece       138    03 FEB 10 08:14:49 /tmp/full_1day_07l52qbn_1_1
Backup Set           775    12 FEB 10 15:49:49
  Backup Piece       777    12 FEB 10 15:49:49 /tmp/full_1day_0ol5rbup_1_1
Backup Set           776    12 FEB 10 15:49:55
  Backup Piece       778    12 FEB 10 15:49:55 /tmp/full_1day_0pl5rcd1_1_1




Changes

Full database backups are taken with the KEEP option.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms