Skip to Main Content
  • Questions
  • Effect of a Backup Retention Policy on Backup Recovery AREA to destination

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Oscar.

Asked: March 09, 2017 - 4:55 pm UTC

Last updated: March 15, 2017 - 2:53 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi,

What´s the effect of a backup retention policy on BACKUP RECOVERY AREA rman command ?
I have all backups in the FRA, and I would like to make BACKUP RECOVERY AREA to DESTINATION (disk) to have an "alternative" backup, but I am not sure of the effect of this in the backup retention policy of the backups. Will this recovery area backup obsolete the rest of backups in the FRA ?

In the oracle documentation ( http://docs.oracle.com/database/121/BRADV/rcmbckba.htm#BRADV89558 ) I can see that "BACKUP RECOVERY AREA" rman command is considered as a backup of backups, like BACKUP BACKUPSET. And this is what they say:

Viewing the Effect of a Backup Retention Policy on Backups of Backups

For a backup retention policy based on redundancy, a backup set is counted as one instance of a backup. This statement is true even if there are multiple copies of the backup pieces that form the backup set, such as when a backup set has been backed up from disk to tape.

For a recovery window retention policy, either all of the copies of a backup set are obsolete, or none of them are. This point is easiest to grasp when viewing the output of the LIST and REPORT commands.



But I am not sure if this applies to BACKUP RECOVERY AREA command too.



Thank you in advance.

Regards
Oscar

and Connor said...

It would appear that the backup of the recover area is included. I'll take a few copies of a tablespace

C:\temp>rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Sat Mar 11 11:07:24 2017

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

connected to target database: NP12 (DBID=1950473453)

RMAN> backup tablespace example;

Starting backup at 11-MAR-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=366 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=C:\ORACLE\ORADATA\NP12\EXAMPLE01.DBF
channel ORA_DISK_1: starting piece 1 at 11-MAR-17
channel ORA_DISK_1: finished piece 1 at 11-MAR-17
piece handle=C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110732_DD6THNGO_.BKP tag=TAG20170311T110732 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 11-MAR-17

RMAN> backup tablespace example;

Starting backup at 11-MAR-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=C:\ORACLE\ORADATA\NP12\EXAMPLE01.DBF
channel ORA_DISK_1: starting piece 1 at 11-MAR-17
channel ORA_DISK_1: finished piece 1 at 11-MAR-17
piece handle=C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110740_DD6THWNP_.BKP tag=TAG20170311T110740 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 11-MAR-17

RMAN> backup tablespace example;

Starting backup at 11-MAR-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=C:\ORACLE\ORADATA\NP12\EXAMPLE01.DBF
channel ORA_DISK_1: starting piece 1 at 11-MAR-17
channel ORA_DISK_1: finished piece 1 at 11-MAR-17
piece handle=C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TJ215_.BKP tag=TAG20170311T110745 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 11-MAR-17


and now take a backup of the FRA


RMAN> BACKUP RECOVERY AREA to destination 'c:\temp\fra';

Starting backup at 11-MAR-17
using channel ORA_DISK_1
specification does not match any archived log in the repository
specification does not match any datafile copy in the repository
channel ORA_DISK_1: input backup set: count=11, stamp=938344052, piece=1
channel ORA_DISK_1: starting piece 1 at 11-MAR-17
channel ORA_DISK_1: backup piece C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110732_DD6THNGO_.BKP
piece handle=C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110732_DD6TO0KM_.BKP comment=NONE
channel ORA_DISK_1: finished piece 1 at 11-MAR-17
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
channel ORA_DISK_1: input backup set: count=12, stamp=938344060, piece=1
channel ORA_DISK_1: starting piece 1 at 11-MAR-17
channel ORA_DISK_1: backup piece C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110740_DD6THWNP_.BKP
piece handle=C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110740_DD6TO1M7_.BKP comment=NONE
channel ORA_DISK_1: finished piece 1 at 11-MAR-17
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
channel ORA_DISK_1: input backup set: count=13, stamp=938344065, piece=1
channel ORA_DISK_1: starting piece 1 at 11-MAR-17
channel ORA_DISK_1: backup piece C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TJ215_.BKP
piece handle=C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TO2O3_.BKP comment=NONE
channel ORA_DISK_1: finished piece 1 at 11-MAR-17
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
Finished backup at 11-MAR-17


When we list the backups, the copy of the FRA is not seen a standalone backups but copies of existing backups

RMAN> list backup;


List of Backup Sets
===================


BS Key  Type LV Size
------- ---- -- ----------
11      Full    97.28M
  List of Datafiles in backup set 11
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  7       Full 4315525    11-MAR-17 C:\ORACLE\ORADATA\NP12\EXAMPLE01.DBF

  Backup Set Copy #1 of backup set 11
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     11-MAR-17       NO         TAG20170311T110732

    List of Backup Pieces for backup set 11 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    11      1   AVAILABLE   C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110732_DD6THNGO_.BKP

  Backup Set Copy #2 of backup set 11
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     11-MAR-17       NO         TAG20170311T110732

    List of Backup Pieces for backup set 11 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    14      1   AVAILABLE   C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110732_DD6TO0KM_.BKP

BS Key  Type LV Size
------- ---- -- ----------
12      Full    97.28M
  List of Datafiles in backup set 12
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  7       Full 4315551    11-MAR-17 C:\ORACLE\ORADATA\NP12\EXAMPLE01.DBF

  Backup Set Copy #1 of backup set 12
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     11-MAR-17       NO         TAG20170311T110740

    List of Backup Pieces for backup set 12 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    12      1   AVAILABLE   C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110740_DD6THWNP_.BKP

  Backup Set Copy #2 of backup set 12
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:01     11-MAR-17       NO         TAG20170311T110740

    List of Backup Pieces for backup set 12 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    15      1   AVAILABLE   C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110740_DD6TO1M7_.BKP

BS Key  Type LV Size
------- ---- -- ----------
13      Full    97.28M
  List of Datafiles in backup set 13
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  7       Full 4315570    11-MAR-17 C:\ORACLE\ORADATA\NP12\EXAMPLE01.DBF

  Backup Set Copy #1 of backup set 13
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     11-MAR-17       NO         TAG20170311T110745

    List of Backup Pieces for backup set 13 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    13      1   AVAILABLE   C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TJ215_.BKP

  Backup Set Copy #2 of backup set 13
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     11-MAR-17       NO         TAG20170311T110745

    List of Backup Pieces for backup set 13 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    16      1   AVAILABLE   C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TO2O3_.BKP
<code>

So when I look at my default redundancy
<code>

RMAN> show all;

RMAN configuration parameters for database with db_unique_name NP12 are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # 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 'C:\ORACLE\PRODUCT\12.1.0.2\DATABASE\SNCFNP12.ORA'; # default


and then ask for deletion of obsolete backups


RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           11     11-MAR-17
  Backup Piece       14     11-MAR-17          C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110732_DD6TO0KM_.BKP
Backup Set           11     11-MAR-17
  Backup Piece       11     11-MAR-17          C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110732_DD6THNGO_.BKP
Backup Set           12     11-MAR-17
  Backup Piece       12     11-MAR-17          C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110740_DD6THWNP_.BKP
Backup Set           12     11-MAR-17
  Backup Piece       15     11-MAR-17          C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110740_DD6TO1M7_.BKP



you can see the c:\temp\fra copies are included in the list as well.

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Not crystal clear?

P, March 11, 2017 - 10:13 pm UTC

From the test case, what I understand is that the answer to the question "Will this recovery area backup obsolete the rest of backups in the FRA ?" is NO, It won't. Am I right?
Connor McDonald
March 12, 2017 - 2:53 am UTC

Correct. They are simply copies of an existing backupset.

The example shows:

- I take 3 backups
- I then take a backup of the FRA
- list backup still says I have "3" backups, just that within them I have extra copies of it.
- delete obsolete then will delete 2 of them (including the copies)

backup backupset

Oscar --, March 13, 2017 - 7:58 am UTC

Can you apply the same to the "backup backupset" command?
Connor McDonald
March 14, 2017 - 3:54 am UTC

Looks like they all fall under the original backup set

RMAN> backup backupset 13;

Starting backup at 14-MAR-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=375 device type=DISK
channel ORA_DISK_1: input backup set: count=13, stamp=938344065, piece=1
channel ORA_DISK_1: starting piece 1 at 14-MAR-17
channel ORA_DISK_1: backup piece C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TJ215_.BKP
piece handle=C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_14\O1_MF_NNNDF_TAG20170311T110745_DDGTBBXV_.BKP comment=NONE
channel ORA_DISK_1: finished piece 1 at 14-MAR-17
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
Finished backup at 14-MAR-17

RMAN> backup backupset 13;

Starting backup at 14-MAR-17
using channel ORA_DISK_1
channel ORA_DISK_1: input backup set: count=13, stamp=938344065, piece=1
channel ORA_DISK_1: starting piece 1 at 14-MAR-17
channel ORA_DISK_1: backup piece C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TO2O3_.BKP
piece handle=C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_14\O1_MF_NNNDF_TAG20170311T110745_DDGTBJ52_.BKP comment=NONE
channel ORA_DISK_1: finished piece 1 at 14-MAR-17
channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:01
Finished backup at 14-MAR-17

RMAN> list backup;


List of Backup Sets
===================


BS Key  Type LV Size
------- ---- -- ----------
13      Full    97.28M
  List of Datafiles in backup set 13
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  7       Full 4315570    11-MAR-17 C:\ORACLE\ORADATA\NP12\EXAMPLE01.DBF

  Backup Set Copy #1 of backup set 13
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     11-MAR-17       NO         TAG20170311T110745

    List of Backup Pieces for backup set 13 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    13      1   AVAILABLE   C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TJ215_.BKP

  Backup Set Copy #2 of backup set 13
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     11-MAR-17       NO         TAG20170311T110745

    List of Backup Pieces for backup set 13 Copy #2
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    16      1   AVAILABLE   C:\TEMP\FRA\NP12\BACKUPSET\2017_03_11\O1_MF_NNNDF_TAG20170311T110745_DD6TO2O3_.BKP

  Backup Set Copy #3 of backup set 13
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     14-MAR-17       NO         TAG20170311T110745

    List of Backup Pieces for backup set 13 Copy #3
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    17      1   AVAILABLE   C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_14\O1_MF_NNNDF_TAG20170311T110745_DDGTBBXV_.BKP

  Backup Set Copy #4 of backup set 13
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:00:02     14-MAR-17       NO         TAG20170311T110745

    List of Backup Pieces for backup set 13 Copy #4
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    18      1   AVAILABLE   C:\ORACLE\FRA\NP12\BACKUPSET\2017_03_14\O1_MF_NNNDF_TAG20170311T110745_DDGTBJ52_.BKP

RMAN>


question

Oscar --, March 14, 2017 - 7:30 am UTC

Thank you very much. Now, a new full backup will become obsolete all these copies, based on a redundancy 1 retention policy, isn´t it?.
I have weekly full backups in disk (FRA) and diary backup of archivelogs in FRA. I would like to offload backups on disk to tape (montly) but without affecting the original backups in the FRA and with an independent retention policy. Any suggestion to this? If I use BACKUP RECOVERY AREA or BACKUP BACKUPSET to copy my backups from FRA to TAPE, these copies in TAPE will become obsolete by my BACKUP DATABASE PLUS ARCHIVELOG backups.

Thank you in advance.
Connor McDonald
March 15, 2017 - 2:53 am UTC

For me, I'm not a fan of the 'redundancy' policy, because of my own failures :-) All I need to is (for example) take a few backups here and there because I'm planning an upgrade or patch or similar, and splat! I might have 3 backups all taken today, and someone says "Can you restore from last night" and I'm saying ... "Um...er....well...." :-) because I've auto-purged them because I've got enough redundant copies than.

I prefer retention based on *time* not copies. And similarly, I can use the KEEP setting when taking a backup to ensure that it will not be purged unexpectedly.

So I might do my daily backups as (say) "keep until sysdate+10", but if that daily backup is on the first of the month, I'll do "keep until sysdate+90" etc.

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.