1 2 3 Previous Next 30 Replies Latest reply on Nov 8, 2017 11:03 PM by EdStevens

    RMAN does not delete obsolete Backups

    AndrePB

      Hello,

       

       

      every day we make a full backup, after that we crosscheck and than delete the obsolete backups. The RETENTION POLICY is set to REDUNDANCY=1.

      Normally it works fine but when there is a change in database structure for example deleting a tablespace, the backup of that day stays and it doesnt become obsolete.

      Now it is the 30th of October we deleted a Tablespace on 26th and the backup isnt marked as obsolete (report obsolete).

      Running: report obsolete recovery window of 1 days: shows the backup from the 26th as obsolete.

      report obsolete recovery window of 2 days does not show it.

       

      Recovery Manager: Release 12.2.0.1.0

      We are using controllfile and not the catalog.

       

      Any hints or suggestions?

       

      Thanks

      André

        • 1. Re: RMAN does not delete obsolete Backups
          top.gun

          You should post your backup command.

          Are you backing up each tablespace individually, or backing up the database as a whole?

           

          It looks to me that Oracle is giving you the correct response if you are backing up tablespaces individually.

          • 2. Re: RMAN does not delete obsolete Backups
            Dude!

            ...every day we make a full backup, after that we crosscheck and than delete the obsolete backups.

            A crosscheck determines backups that have expired, meaning they are still recorded, but do no longer exist. A crosscheck has nothing to do with obsolete backups. Why are you doing a crosscheck on a daily basis?

             

            Now it is the 30th of October we deleted a Tablespace on 26th and the backup isnt marked as obsolete (report obsolete).

            Running: report obsolete recovery window of 1 days: shows the backup from the 26th as obsolete.

            report obsolete recovery window of 2 days does not show it.

            In order to determine what is wrong you need to show what backups you are doing and what backups are available. If RMAN does not consider a backup obsolete based on your retention policy, than it is most likely correct. The reason can be that a controlfile backup required to restore your previous backup is missing, hence RMAN won't determine your previous backup as obsolete. Database recovery, which includes archived redo logs cannot work backwards, i.e. undoing database changes.

            • 3. Re: RMAN does not delete obsolete Backups
              AndrePB

              It is the simplest rman command:

               

              backup database plus archivelog;

              delete obsolete;

              Everyday on 11pm expect sunday;

               

              config:

              CONFIGURE RETENTION POLICY TO REDUNDANCY 1;

              CONFIGURE CONTROLFILE AUTOBACKUP ON; # default;

               

               

               

              Interesting issue, with list backup, there are no datafile names in some lines. I guess this are the deleted tablespaces. In the list from yesterday are no missing dbf names (the names are dummies):

               

              ...

              41Full 284046444  25.10.17        NOD:\....TS1.DBF
              45Full 284046444  25.10.17        NOD:\....TS2.DBF
              46Full 284046444  25.10.17        NO
              48Full 284046444  25.10.17        NOD:\....TS4.DBF
              49Full 284046444  25.10.17        NOD:\....TS5.DBF
              50Full 284046444  25.10.17        NO
              51Full 284046444  25.10.17        NO
              54Full 284046444  25.10.17        NO
              55Full 284046444  25.10.17        NOD:\....TS7.DBF
              60Full 284046444  25.10.17        NOD:\....TS8.DBF
              76Full 284046444  25.10.17        NO
              78Full 284046444  25.10.17        NO
              80Full 284046444  25.10.17        NOD:\....TS10.DBF
              88Full 284046444  25.10.17        NOD:\....TS11.DBF
              90Full 284046444  25.10.17        NO

              D:\....TS12.DBF

              ...

              • 4. Re: RMAN does not delete obsolete Backups
                CristianR-Oracle

                First, you mix the retention policy - "redundancy 1" is not the same as "recovery window of 1 days"

                 

                Second, what is the output of command below:

                 

                RMAN> crosscheck backup;

                RMAN> restore database until 'sysdate - 2' preview;

                 

                The second command should include the 26th backup as needed to restore the database two days back.

                 

                If you upload the log maybe we can see why this is not reported as obsolete when using "recovery window of 2 days"

                 

                Best regards

                • 5. Re: RMAN does not delete obsolete Backups
                  Dude!

                  You may find the following useful:

                  DBPITR After Dropping a Tablespace

                   

                  A full backup automatically includes the controlfile, but you also need to consider when your backup finished. When you need to restore a dropped tablespace while the backup was running, you will need to restore the previous backup and also require the previous controlfile. The retention policy includes the controlfile.

                   

                  Also keep in mind that RMAN performs a restore and recovery depending on what RMAN determines is the most efficient course of action, based on what backups are available.

                  • 6. Re: RMAN does not delete obsolete Backups
                    AndrePB

                    when i use restore database until time 'sysdate-2' preview; rman only takes the backup from 26th.
                    I know the difference between redundancy=1 and recovery window of 1 day.

                    Thats why i am asking. There are 2 Fullbackups my redundancy is 1. This does not fit together.

                    Another point is, the backups from 27 and 28 were deleted.

                    • 7. Re: RMAN does not delete obsolete Backups
                      Dude!

                      Redundancy does not determine what backup RMAN is going to use to perform a restore or recovery. Redundancy only tells RMAN what backups are obsolete given the specified redundancy.

                       

                      If you have a redundancy window based on a recovery window, than the consideration is recovery date and time, regardless of how many backups there are. If the the redundancy window is based on redundancy, than what matters is redundancy, regardless of how old backups are - of course provided these backups are still registered in the controlfile and have not aged out due to controlfile_record_keep_time.

                       

                      If you have a redundancy of 1 and 2 full backups remain after evaluating the redundancy policy, then your last backup is insufficient, perhaps missing a controlfile autobackup or did not complete successfully. If you have to worry about this to maintain free space available for backups, you need to add more disk space.

                      • 8. Re: RMAN does not delete obsolete Backups
                        AndrePB

                        There were no errors and the controllfile is within the backup. And why it deletes the backups from      27th and 28th. Only the one from 26th, when there was the delete of some tablespaces, is still present.

                        • 9. Re: RMAN does not delete obsolete Backups
                          Dude!

                          RMAN does not delete anything unless you explicitly tell RMAN to do so by issuing commands, such as delete backup, delete obsolete, delete expired. How were the backups from 27 to 28 deleted?

                          • 10. Re: RMAN does not delete obsolete Backups
                            AndrePB

                            This is the "script":

                             

                            backup database plus archivelog;

                            delete obsolete;

                            • 11. Re: RMAN does not delete obsolete Backups
                              Levi Pereira

                              Can You  Share output of these command ?

                               

                              REPORT OBSOLETE RECOVERY WINDOW OF 1 DAYS;

                              REPORT OBSOLETE REDUNDANCY 1;

                              LIST BACKUP SUMMARY;

                              LIST BACKUP BY FILE;

                              • 12. Re: RMAN does not delete obsolete Backups
                                Dude!

                                RMAN and the retention policy does not care whether or not there was any tablespace deleted - it does not affect what information is obsolete. The way you described is not how RMAN normally works and your analysis of the situation is very likely incorrect, but based on what information you provided should anyone be able to confirm your findings or answer your question?

                                • 13. Re: RMAN does not delete obsolete Backups
                                  Dude!

                                  One more thing, looking at your problem and respones:

                                   

                                  Running: report obsolete recovery window of 1 days: shows the backup from the 26th as obsolete.

                                  report obsolete recovery window of 2 days does not show it.

                                  What output do you expect and why?

                                  • 14. Re: RMAN does not delete obsolete Backups
                                    Levi Pereira

                                    Agree...Drop Databases Files and Delete Obsolete has no relationship.

                                     

                                    Drop Datafiles/Tablespace is a Database operation.

                                    Delete Backup Obsolete is a RMAN operation.

                                    1 2 3 Previous Next