7 Replies Latest reply: Dec 4, 2012 6:02 AM by mseberg RSS

    Delete obsolete command not deleting backupset automatically

    596937
      Hi,

      I am trying to delete the backupset using Delete Obsolete command, but i am unable to get the success. As per the oracle Doc after completion of Retention Period oracle automatically deletes the backupset.
      I have set the retention period of 8 days. Kindly let me know how it works? or its a bug.

      Regards,
      Puneet Pradhan
        • 1. Re: Delete obsolete command not deleting backupset automatically
          mseberg
          Hello;

          Sounds like you are using a Retention Policy Based on Recovery Window. This alone will not delete anything.

          CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;

          Use SHOW ALL in RMAN to confirm your setting.

          If you specify the DELETE OBSOLETE command with no arguments, then RMAN deletes all obsolete backups defined by the currently configured retention policy.

          RMAN> DELETE OBSOLETE;

          The other thing to factor in is what type of backup are you doing?

          When using Incremental backup the last backup is always the FULL BACKUP (level 0) no matter how many Backup Incremental or Backup of Archivelog you have. So with a Recovery Window policy the window will always be much larger than setting if you are using incrementals.


          Best Regards

          mseberg
          • 2. Re: Delete obsolete command not deleting backupset automatically
            EdStevens
            user593934 wrote:
            Hi,

            I am trying to delete the backupset using Delete Obsolete command, but i am unable to get the success. As per the oracle Doc after completion of Retention Period oracle automatically deletes the backupset.
            I have set the retention period of 8 days. Kindly let me know how it works? or its a bug.

            Regards,
            Puneet Pradhan
            And to draw a picture on what mseberg said ...

            All recovery/restore must begin with a full backup -- the last full backup prior to the time to which you want to restore. So, say you have a recovery window of 7 days. Say you take an incremental 0 backup today. And then you start taking daily incremental 1 backups, but you don't take another incremental 0 for the next 3 months. That 3 month old full backup is still needed to protect your 7 day recovery window, so will not be obsolete.

            That's an extreme example to make a point. In the more common scenario, say you have a recovery window of 7 days, take a full on Sunday and incremental 1 the other 6 days. Sit down and graph that out and you'll see that the full backups won't go obsolete until they are two weeks old.

            Also, backups are not 'marked' as obsolete. They are evaluated for obsolescence every time a command that needs to determine it is issued -- REPORT OBSOLETE or DELETE OBSOLETE.
            • 3. Re: Delete obsolete command not deleting backupset automatically
              596937
              Hi,

              Your both replies are much more knowledgeable but i am unable to delete my backupset using delete obsolete command.

              Following is my rman settings:

              CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;
              CONFIGURE BACKUP OPTIMIZATION ON;
              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 COMPRESSED BACKUPSET;
              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 'BZIP2'; # default
              CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
              CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\PRODUCT\11.1.0\DB_1\DATABASE\SNCFDWGRP.ORA'; # default

              And every sunday we take the Level 0 backup of our database and Mon to Fri we take incremental level 1 backup. When i use delete obsolete command it just removes the autobackup files i.e. control and spfile not the backupset.

              Please help me to understand this concept.

              Regards,
              Puneet Pradhan
              • 4. Re: Delete obsolete command not deleting backupset automatically
                EdStevens
                user593934 wrote:
                Hi,

                Your both replies are much more knowledgeable but i am unable to delete my backupset using delete obsolete command.

                Following is my rman settings:

                CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;
                CONFIGURE BACKUP OPTIMIZATION ON;
                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 COMPRESSED BACKUPSET;
                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 'BZIP2'; # default
                CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
                CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\PRODUCT\11.1.0\DB_1\DATABASE\SNCFDWGRP.ORA'; # default

                And every sunday we take the Level 0 backup of our database and Mon to Fri we take incremental level 1 backup. When i use delete obsolete command it just removes the autobackup files i.e. control and spfile not the backupset.

                Please help me to understand this concept.

                Regards,
                Puneet Pradhan
                What are the dates of your two oldest Inc 0 backupsets?

                Let me draw the picture

                Nov 01 - backup Inc 0
                Nov 02 - backup Inc 1
                Nov 03 - backup Inc 1
                Nov 04 - backup Inc 1
                Nov 05 - backup Inc 1
                Nov 06 - backup Inc 1
                Nov 07 - backup Inc 1
                Nov 08 - backup Inc 0
                Nov 09 - backup Inc 1
                Nov 10 - backup Inc 1
                Nov 11 - backup Inc 1
                Nov 12 - backup Inc 1
                Nov 13 - backup Inc 1
                Nov 14 - backup Inc 1 - 8 days ago is Nov 6. Inc 0 from Nov 1 is still needed to recover Nov 6, so is not obsolete.
                Nov 15 - backup Inc 0

                Edited by: EdStevens on Dec 3, 2012 7:16 AM
                • 5. Re: Delete obsolete command not deleting backupset automatically
                  Victor Armbrust
                  I had the same problem in the past.

                  It will remove only 8 DAYS backups once you take the next INCR level 0 backup. Whats the size of your database?
                  • 6. Re: Delete obsolete command not deleting backupset automatically
                    596937
                    Hi,

                    Thanks for your knowledgable answers, this is the schedule of my incremental backup and database size is 385 GB.

                    0 A DISK 25-NOV-12
                    0 A DISK 25-NOV-12
                    F A DISK 25-NOV-12
                    1 A DISK 26-NOV-12
                    1 A DISK 26-NOV-12
                    F A DISK 26-NOV-12
                    1 A DISK 27-NOV-12
                    1 A DISK 27-NOV-12
                    F A DISK 27-NOV-12
                    1 A DISK 28-NOV-12
                    1 A DISK 28-NOV-12
                    F A DISK 28-NOV-12
                    1 A DISK 29-NOV-12
                    1 A DISK 29-NOV-12
                    F A DISK 29-NOV-12
                    1 A DISK 30-NOV-12
                    1 A DISK 30-NOV-12
                    F A DISK 30-NOV-12
                    0 A DISK 02-DEC-12
                    0 A DISK 02-DEC-12
                    F A DISK 02-DEC-12
                    1 A DISK 03-DEC-12
                    1 A DISK 03-DEC-12
                    F A DISK 03-DEC-12

                    Regards,
                    Puneet Pradhan
                    • 7. Re: Delete obsolete command not deleting backupset automatically
                      mseberg
                      Hello again;

                      Here's my notes on "Obsolete Backups"

                      http://www.visi.com/~mseberg/rman/obsolete_backups.html

                      Best Regards

                      mseberg