6 Replies Latest reply: Oct 21, 2010 10:37 AM by user9544640 RSS

    RMAN Recovery Window Retention Policy

    658523
      Hi,

      I'm reading Oracle documentation about RMAN Recovery Window Retention policy and has some confusion regarding it which I want to clear. So, kindly help me in this.

      1- when we write rman command

      RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAY;

      What we mean by this:
      The backup that were taken after this command remain valid for 7 days, means we can use them in recovery within 7 days after backup taken. After seven days the backup get expire?
      Is it the concept behind this command?????????

      2- The documentation says that:
      For, each data file, there must always exist at least one backup that satisfies the following condition:

      SYSDATE-backup_checkpoint_time >= recovery_window

      This condition get always satisfied when the backup get older than 7 days, according to above concept.

      Kindly help me in over comming in this confusing concept.

      Regards,

      Abbasi
        • 1. Re: RMAN Recovery Window Retention Policy
          gjilevski1
          Hi,

          Have a look at

          http://www.ucertify.com/article/what-is-backup-retention-policy.html

          Regards,
          • 2. Re: RMAN Recovery Window Retention Policy
            BelMan
            Hi,
            The Recovery Manager (RMAN) provides the CONFIGURE RETENTION POLICY command to create a persistent and automatic backup retention policy for controlling how long backups and copies should be retained. When a backup retention policy is in effect, RMAN considers the backups and copies of data files and control files as obsolete (i.e., the backups and copies are no longer needed for media recovery), according to the criteria specified in the CONFIGURE RETENTION POLICY command. The REPORT OBSOLETE and DELETE OBSOLETE commands can be executed periodically or regularly to view obsolete files and to delete them, respectively

            so
            when a recovery window of five days is implemented, the window of time must extend back exactly five days from the present, so that a backup can be restored and recovered to this point. This retention policy can be implemented by executing the following RMAN command:

            CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 5 DAYS;
            Executing the above command ensures that for each data file, one backup that is older than the point of recoverability must be retained. For example, if the recovery window is five, there must always exist one backup of each data file that satisfies the following condition:

            SYSDATE – (SELECT CHECKPOINT_TIME FROM V$DATAFILE) >= 5

            All backups older than the most recent backup that satisfies the above condition are obsolete. The recovery window always keeps pace with the current time. For example, if the current day is March 12 and the recovery window is five days, then the recovery window stretches between March 7 and March 12.


            see this blog
            http://www.ucertify.com/article/what-is-backup-retention-policy.html
            • 3. Re: RMAN Recovery Window Retention Policy
              Dude!
              There are 2 types of RMAN retention policies:

              Backup Redundancy:

              CONFIGURE RETENTION POLICY TO REDUNDANCY 2;

              A redundancy-based retention policy specifies how many backups of each datafile must be retained.

              Recovery Window:

              CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

              A recovery window is a period of time that begins with the current time and extends backward in time to the point of recoverability, that is, the earliest point to which you can recover following a media failure.


              A backupset or other backup parts that have fallen behind the retention policy are marked obsolete.
              If backupsets and other RMAN backups are removed from disk not by using RMAN then these will be marked expired after running RMAN crosscheck.

              If you store backup in the Flash/Fast Recovery Area than obsolete backups are automatically deleted if there are space constrains. To reclaim space manually you can use RMAN delete obsolete. As with other forms of the DELETE command, the files deleted are removed from backup media, deleted from the recovery catalog, and marked as DELETED in the control file

              You can remove backup entries that are marked as expired using the RMAN command delete expired.

              Edited by: Markus Waldorf on Sep 9, 2010 1:46 PM
              • 4. Re: RMAN Recovery Window Retention Policy
                Aman....
                Did you read this note from Khurram?

                http://oraware.blogspot.com/2009/10/recovery-window.html

                HTH
                Aman....
                • 5. Re: RMAN Recovery Window Retention Policy
                  EdStevens
                  You've gotten some pretty good comment already, but I didn't see any of the previous posters point out a vital detail.

                  Let's say you specify a recovery window of 7 days. That means rman will not obsolete any backup needed for recovery to any point in the last seven days. Check. But what's the subtle detail?

                  Suppose you take a full backup on 1 Sep, then start taking incremental backups going forward. Now we're down to 10 Sep which puts that full backup 3 days earlier than the recovery window. However, it is still the most recent full backup and so is needed to recover into any time during the 7 day recovery window. Therefore, it will NOT be marked obsolete.

                  Think about what this does in the textbook backup routine of a full backup every 7 days, with incremental backups the other 6 days. We take a full backup on day 1. We take incremental backups on days 2 - 7. We take a full backup again on Day 8, and incrementals on days 9 - 14.
                  Day  =  1  2  3  4  5  6  7  8  9 10 11 12 13 14
                  Bkup =  F  I  I  I  I  I  I  F  I  I  I  I  I  I
                  On day 14, our recovery window reaches back to day 7, and the only way to recover to day 7 is to use the full backup from day 1 and the incrementals from 2 through 7. So even though we have a 7 day recovery window, we actually have 14 days worth of backups that are yet to go obsolete. On day 15, we can obsolete and drop everything prior to the full backup on Day 8.
                  • 6. Re: RMAN Recovery Window Retention Policy
                    user9544640
                    Ed- Thanks for the posting it answered a question I had been researching.