14 Replies Latest reply on Jun 19, 2008 11:06 AM by 645977

    Archive logs after RMAN full database backup

      After taking a full database backup through RMAN, I run 'delete obsolete' command.

      Now after deleting the obsolete files though retention policy setting is 1

      But still I see (yesterdays) or sometimes (yesterday and day before yesterdays) archive files doesn't get deleted.

      My Database is on 64-bit Windows 2003 Standard Edition.

      Experts please guide on this.

      Thanks in advance.
        • 1. Re: Archive logs after RMAN full database backup
          Surachart Opun
          I'm not sure about that.
          Did you backup archivelog all?

          Perhaps you can perform about archivelog by


          Anyway you can check:

          RMAN> report obsolete;
          • 2. Re: Archive logs after RMAN full database backup
            After backing up archive files delete obsolete command deletes all archive files.

            But After full database backup without archive files, delete obsolete command doesn't delete yesterdays archive files.

            Why full database backup without archivelog backup behaves differently?
            • 3. Re: Archive logs after RMAN full database backup
              Because it's preventing you from making your database unrecoverable, that's what it should do! Why would you delete not backed up archive logs? Did you wonder how a restore would work? Even backing them up once and deleting them on input is questionable.
              • 4. Re: Archive logs after RMAN full database backup
                delete obsolete deletes files which are no longer required for recovery.
                As you didn't backup the archivelogs, they are still required for recovery.
                Also you shouldn't backup a database without backing up the archivelogs.

                Sybrand Bakker
                Senior Oracle DBA
                • 5. Re: Archive logs after RMAN full database backup
                  Pavan Kumar

                  The term obsolete does not mean the same as expired. A backup is obsolete when REPORT OBSOLETE or DELETE OBSOLETE determines, based on the user-defined retention policy, that it is not needed for recovery. A backup is considered expired only when RMAN performs a crosscheck and cannot find the file. In short, obsolete means "not needed," whereas expired means "not found."

                  I think the files are needed for recovery.. so might have seen

                  Pavan Kumar N
                  • 6. Re: Archive logs after RMAN full database backup
                    I understand that but my question is when I take a full database backup now why are yesterdays archive files and todays archive files required for recovery and doesn't get deleted when I run delete obsolete? Does this mean that my current full database backup is not todays but day before yesterday's? Really strange...
                    • 7. Re: Archive logs after RMAN full database backup
                      Pavan Kumar

                      yes, If you got a time.. then a full backup of your database with archive logs and then see ...you will not find these...results..as expected by you..will be resulted..

                      Pavan Kumar N
                      • 8. Re: Archive logs after RMAN full database backup
                        RMAN will backup all the archive logs that are on disk. So, you take a backup now as well as archivelogs, that completes, the database does more work and generates more archive logs, the next day the backup happens again, backs up the previous days and all archivelogs up to the current point. You're getting confused because you're thinking this is your first backup and you don't need the previous days archivelogs.
                        • 9. Re: Archive logs after RMAN full database backup
                          Recovery manager will backup all required files to guarantee recoverability of the database up to the defined retention time. Once a backup is overdue because it has exceeded the retention period it is considered obsolte and it can be removed.

                          If you want to get rid of the archivelog files then you should first backup the database, once finished perform the purge obsolete, at this time the old archivelogs, which are no longer required to perform a recover from the previously taken backup are considered obsolete and rman can get rid of them.

                          ~ Madrid

                          • 10. Re: Archive logs after RMAN full database backup
                            I tested it at on Oracle Enterprise Linux 4.

                            After making a full backup of database, all archived log files created before this full backup were reported as obsolete backups and I could delete all.

                            Is your database running in the Streams or data guard environment?

                            From, RMAN knows the archived log files being used by these components. So, even if you issue DELETE command for the archived log files, RMAN simply ignores the archived log files registered or being used by these components.
                            • 11. Re: Archive logs after RMAN full database backup
                              Hi guys,

                              I have the very same problem:
                              my retention policy was redundancy 3 for the long period. Now I need to change to recovery window of 3 days. I changed it. Here is my backup script, that runs every morning at 5 AM:

                              backup database plus archivelog;
                              delete obsolete;

                              Now, when I go to me archivelog_destination, I can see tons of archivelogs, that were not deleted, while recovery policy was redundancy 3. I decided to do:
                              crosscheck backup;
                              crosscheck archivelog all;
                              report obsolete;
                              delete obsolete;

                              But both backups and archivelogs are still in place and eat my space..
                              Please, let me know what should I do else to get rid of archivelogs from May 2008.. Do I need to run my script and THEN do report/delete obsolete?

                              Thanks beforehand!!!
                              • 13. Re: Archive logs after RMAN full database backup
                                backup database plus archivelog
                                crosscheck backup;
                                delete noprompt obsolete recovery window of 3 days;
                                • 14. Re: Archive logs after RMAN full database backup
                                  hey guys!
                                  I would recommend not to delete manually those archive files. I'm pretty sure, what's happening here...

                                  What was the last time when you backed up your control file?? Because, maybe you are backing up the database incompletely (you're maybe forgetting about the ctrl file)... so if this is the case, let's assume you backed it up (the ctrl file) 2 weeks ago... but the database was backed up yesterday and you have a retention policy of 1 (whatever: day or backupset)...BUT the old archive files are still related with that old 2-week ctrl backup... so RMAN will keep these 2 weeks of archives for consistency reasons.

                                  rman> backup current controlfile;
                                  rman> crosscheck archivelog all;
                                  rman> report obsolete;

                                  now you should see all those archive files...

                                  and then, you can drop them...

                                  rman> delete noprompt obsolete...

                                  Try to configure the autocontrol backup or do it manually by adding this line (backup...current...) to your cron job.


                                  Message was edited by: