1 2 Previous Next 19 Replies Latest reply on Aug 7, 2014 1:46 PM by MhAGOU

    Archivelogs are not deleteing frm RMAN

    2713139


      Hi everyone,

       

       

      Linux meachine

      11.2.0.3 db version.

      we are running  Rman Level0 backup every sunday, and level1 backup everyday,

      retention policy is recovery window of 7days,

       

      whenever level0 backup runs, it will clean the obsolete backupset  and archivelogs,

       

      but both are not deleting from the backup. and again i have changed  rentetion policy 2 days again i run the backup stil it is not deleting anything

       

      my archive destination is in FRA,

       

       

      this is my Rman Script for Level 0 backup.

       

       

      BACKUP

          as compressed backupset

          TAG hb_level_0_${LOGDATE}

          INCREMENTAL LEVEL 0 DATABASE plus ARCHIVELOG;

      RELEASE CHANNEL ch00;

      }

      #### list the existing backups

      DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;

       

       

      i want to delete the archives and backupset which is older than 7 days please suggest me how to do that,

       

       

      thanks in advance,,

       

      regards,

      Sanjay..

        • 1. Re: Archivelogs are not deleteing frm RMAN
          EdStevens

          Retention policy applies to backups, not archivelogs.

           

           

          When you backup archivelogs, add 'DELETE ALL INPUT'.  

          Don't just blindly add that because I said to.  Look it up in the Backup and Recovery manuals and read up exactly what it does.

           

          BTW, with a once-weekly level 0 backup and a retention policy of 7 days, you can expect to see backupsets as old as 14 days.  That's because all recovery begins with the most recent level 0 prior to the recovery point in time.

           

          For example -

           

          Day 1 -  level 0

          Day 2 - level 1

          Day 3 - level 1

          Day 4 - level 1

          Day 5 - level 1

          Day 6 - level 1

          Day 7 - level 1

          Day 8 -  level 0

          Day 9 - level 1

          Day 10 - level 1

          Day 11 - level 1

          Day 12 - level 1

          Day 13 - level 1

          Day 14 - level 1

           

          On day 13, a 7-day recovery window reaches back to day 6.  Therefore the Level 0 of day 1, and all of the incremental and archivelogs (or their backups) since then are not yet obsolete because they could be needed for a recovery.

          • 2. Re: Archivelogs are not deleteing frm RMAN
            2713139

            Dear EdStevens,
            thanks for quick reply,

             

            i have small doubts regarding this,

             

            every sunday we have level 0 backup 21:00 hours  and level 1 everyday till monday to saturday,

             

            that is the reason we use   retention period 7days.

             

            what i have done is last wednesday i have deleted the whole backup and archivelog from Rman ,

            excuted level 0 backup, database +archivelog

             

             

            yesterday as usual, Level 0 backup scheduled (sunday)

             

             

            today what i have done is to delete the obsolete backup , i have changed obsolete recovery window to 3days, in Rman and my script also, so that means it should delete the 3 days before,  that wont happen, it wasn't deleted single archivelog and single backup..

             

            what to do delete the archivelog ,

             

            please share methe process that would be great,,

             

            thanks,

             

            Sanjay..

            • 3. Re: Re: Archivelogs are not deleteing frm RMAN
              EdStevens

              2713139 wrote:

               

              Dear EdStevens,
              thanks for quick reply,

               

              i have small doubts regarding this,

               

              every sunday we have level 0 backup 21:00 hours  and level 1 everyday till monday to saturday,

               

              that is the reason we use  retention period 7days.

               

              what i have done is last wednesday i have deleted the whole backup and archivelog from Rman ,

               

              Exactly how did you delete them?  What command did you use?  What response did you get from that command?

               

               

              excuted level 0 backup, database +archivelog

               

               

              yesterday as usual, Level 0 backup scheduled (sunday)

              So now you have a level zero from Wednesday, July 3 and one from Sunday, Aug 3. 

               

               

               

               

              today what i have done is to delete the obsolete backup , i have changed obsolete recovery window to 3days, in Rman and my script also, so that means it should delete the 3 days before,

               

              No, it should delete everything prior to the last level 0 backup that was taken prior to 3 days ago.  That would be the backup you took on Wednesday.

               

               

              that wont happen, it wasn't deleted single archivelog and single backup..

               

              Because that 5-day old level 0 backup, and all backups taken after that, are needed to guarantee your now 3-day recovery window.

               

              what to do delete the archivelog ,

              I already told you:  'BACKUP ARCHIVELOG DELETE ALL INPUT';

               

              please share methe process that would be great,,

              I gave you the key method.  Twice now.  What's missing is your understanding of why rman does not consider backups to be obsolete just because they are older than your recovery period.  I explained that in my first post.

               

              And don't confuse archivelogs with backups of archivelogs.  DELETE OBSOLETE applys to backupsets, not the original archivelogs.

              thanks,

               

              Sanjay..

              • 4. Re: Archivelogs are not deleteing frm RMAN
                2713139

                Dear EdStevens,

                 

                once agian Thanks for your Reply,

                 

                i understood clearly,

                 

                1. august 30 th i have full backup  and 3 rd i have full backup.

                today is 5 th  if i put retention policy recovery window of 2 days, in my rman script.  if i run this script today  then is it going to delete befroe 3rd august, ???

                or

                if i put retention policy recovery window 4 days, then it will delete from obsolete backupset  before 30th august. am i right??

                 

                2. Iam using the command to delete the obsolete is " delete noprompt obsolete recovey window of 3 days" in the rman script.

                 

                3.  if i am not wrong  "backup archivelog delete all input"  this command delete archivelogs which are been backedup??

                 

                4. do i need to issue  "backup archivelog delete all input"  the command for archives,   because normally when we mention obsolete recovery window in Rman script this will delete all the archivelog and backupset??

                 

                thanks for you patience and time..

                 

                Regards,

                Sanjay.

                • 5. Re: Archivelogs are not deleteing frm RMAN
                  V. A. Nagpure

                  1. august 30 th i have full backup  and 3 rd i have full backup.

                  today is 5 th  if i put retention policy recovery window of 2 days, in my rman script.  if i run this script today  then is it going to delete befroe 3rd august, ???

                  or

                  if i put retention policy recovery window 4 days, then it will delete from obsolete backupset  before 30th august. am i right??

                  Oracle will calculate two days from the time you execute the 'delete obsolete' command. If the backup taken on 3rd is older than two days from 'that' time, and is usable, then it will delete the backup of 30th July. Same applies to the recovery window of 4 days.

                   

                  3.  if i am not wrong  "backup archivelog delete all input"  this command delete archivelogs which are been backedup??

                  This command will backup the specified archivelogs and then delete them from the archive destination/s.

                   

                  4. do i need to issue  "backup archivelog delete all input"  the command for archives,   because normally when we mention obsolete recovery window in Rman script this will delete all the archivelog and backupset??

                   

                  Your question is not clear.

                   

                  Regards,

                  Vinod

                  • 6. Re: Archivelogs are not deleteing frm RMAN
                    2713139

                    Dear Vinod,

                     

                    Thanks For reply,

                     

                      "backup archivelog delete all input"   This command will backup the specified archivelogs and then delete them from the archive destination/s.

                     

                    but my question is , we are keeping one week, archivelogs in archivelog destination, before a week it gets automatically deleted with obsolete recovery window of 7 days. this will be mentioned in RMAN script..

                     

                     

                    if i add that point in my script   "backup archivelog delete all input"  is it going to delete all my archivelogs till now, or it is going to delete till last week, ?

                     

                    if u can show me the scenario. so that it would be helpful to understand..

                     

                     

                    Regards,

                    Sanjay.

                    • 7. Re: Archivelogs are not deleteing frm RMAN
                      V. A. Nagpure

                      'Delete obsolete' command has nothing to do with the archivelog files; it will delete the only the datafile, controlfile and archivelog backup files. 'Backup archivelog *** delete all input' will delete those archivelogs which it backs up.

                       

                      but my question is , we are keeping one week, archivelogs in archivelog destination, before a week it gets automatically deleted with obsolete recovery window of 7 days. this will be mentioned in RMAN script..

                       

                      Again, you have not explained yourself clearly. Do you mean that you want to keep archivelog files for one week, and you have defined a recovery window of 7 days, but your archivelog files get deleted before before one week?

                      1 person found this helpful
                      • 8. Re: Archivelogs are not deleteing frm RMAN
                        2713139

                        Dear Vinod,

                         

                         

                        i can explain more specific,

                         

                        this is my Level 0 backup script

                         

                        BACKUP

                        as compressed backupset

                        TAG hb_level_0_${LOGDATE}

                        INCREMENTAL LEVEL 0 DATABASE plus ARCHIVELOG;

                        RELEASE CHANNEL ch00;

                        }

                        #### list the existing backups

                        DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;

                         

                         

                        this will run every sunday ,  suppose 3rd aug if i run this script it will delete the backupset and archives before 27 th july..

                         

                        but what your saying is  obsolete command not deleting  the archivelogs , but i really wonder how archivelogs are deleting , before 7 days.

                         

                        and 2nd question is,

                        exactly your right, suppose if run backup on 3rd aug i want to keep my archives from 27 th aug to 3rd august. i want to delete before that date. just want to keep one week...

                        • 9. Re: Archivelogs are not deleteing frm RMAN
                          V. A. Nagpure

                          There might be another script in place which is deleting the archivelogs? Have you checked?

                           

                          Regards,

                          Vinod

                          • 10. Re: Re: Archivelogs are not deleteing frm RMAN
                            EdStevens

                            2713139 wrote:

                             

                            Dear EdStevens,

                             

                            once agian Thanks for your Reply,

                             

                            i understood clearly,

                             

                            1. august 30 th i have full backup  and 3 rd i have full backup.

                            today is 5 th  if i put retention policy recovery window of 2 days, in my rman script.  if i run this script today  then is it going to delete befroe 3rd august, ???

                            Now that might come down to the time of day when you issue the command.  You're doing this on the 5th.  You work with a recovery period of 2 days.  Two days prior to the 5th is the 3d, but that "two days" will be calculated down to the second.  If you issue your DELETE OBSOLETE (with two day recovery period) at 13:23:42 on the 5th, then your recovery window begins at 13:23:42 on the third.  So then it comes down to when on the 3d did that backup complete?

                             

                             

                             

                             

                            or

                            if i put retention policy recovery window 4 days, then it will delete from obsolete backupset  before 30th august. am i right??

                            Should be.

                             

                             

                            2. Iam using the command to delete the obsolete is " delete noprompt obsolete recovey window of 3 days" in the rman script

                            .Ok, so that over-rides whatever you had specified with a CONFIGURE command.  And your recovery window will be exactly 72 hours, zero minutes, and zero seconds from the time at which you issue that command.

                             

                            3.  if i am not wrong  "backup archivelog delete all input"  this command delete archivelogs which are been backedup??

                            It does exactly what the doc says it does.  See BACKUP

                             

                            4. do i need to issue  "backup archivelog delete all input"  the command for archives,  because normally when we mention obsolete recovery window in Rman script this will delete all the archivelog and backupset??

                            Once again .... DELETE OBSOLETE only deletes backupsets.

                            Archivelogs are not backupsets.

                            Backupsets may contain backups of archivelogs.  But a backupset containing a backup of an archivelog is not the same as the archivlog itself, which is residing in the archivelog destination. 

                             

                             

                            thanks for you patience and time..

                             

                            Regards,

                            Sanjay.

                            • 11. Re: Archivelogs are not deleteing frm RMAN
                              stefan.seck

                              Hi Sanjay,

                               

                              first of all, why do you want to keep your archivelogs in the filesystem?

                               

                              Because with "backup archivelog delete all input" you get rid of all archivelogs, which are in this backup. And you won't get an archiver stuck, if the database produces too much redo.

                               

                              Please execute the following:

                               

                              crosscheck archivelog all;

                              report obsolete archivelog all;


                              Regards

                              Stefan

                              • 12. Re: Archivelogs are not deleteing frm RMAN
                                Franck Pachot

                                Hi,

                                As you are using FRA you should not have to delete the files. But you can check if they are correctly set to reclaimable.

                                As V$RECOVERY_AREA_USAGE is difficult to use for that because it has no details, I have a query that show all files in FRA with their reclaimable status: Drilling down V$RECOVERY_AREA_USAGE

                                Regards,

                                Franck.

                                • 13. Re: Archivelogs are not deleteing frm RMAN
                                  2713139

                                  Dear All,

                                   

                                  Thankyou all  for Your valuble suggestions,

                                  according to my company policy will make it retention window of 7 days,

                                   

                                   

                                  my level 0 script is like this

                                   

                                  BACKUP

                                      as compressed backupset

                                      TAG hb_level_0_${LOGDATE}

                                      INCREMENTAL LEVEL 0 DATABASE plus ARCHIVELOG;

                                  RELEASE CHANNEL ch00;

                                  }

                                  #### list the existing backups

                                  DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;

                                   

                                  and i am adding one line after the step  DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;

                                   

                                  delete force noprompt archivelog until time 'SYSDATE-7';

                                   

                                   

                                  so that archives deleted before 7 days..

                                   

                                   

                                  this would be helpful to delete the archvies, we want archives for one week in physical location. that is the reason we r not using delete all input,

                                   

                                  iknow archvies doesnt required it already exist in RMAN backupset but our company follows this.

                                   

                                  any suggestions would be appreciated,

                                   

                                   

                                   

                                   

                                   

                                  Thanks,

                                  Sanjay.

                                   

                                   

                                   

                                   

                                   

                                   

                                   


                                  • 14. Re: Archivelogs are not deleteing frm RMAN
                                    Franck Pachot

                                    It's not a good idea to do a delete force because it bypasses the deletion policy. What if you archivelog backup fails for several days? Are you sure you recall to stop that job?

                                    1 2 Previous Next