This content has been marked as final. Show 14 replies
I'm not sure about that.
Did you backup archivelog all?
Perhaps you can perform about archivelog by
RMAN>backup ARCHIVELOG ALL DELETE INPUT;
Anyway you can check:
RMAN> report obsolete;
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?
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.
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.
Senior Oracle DBA
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
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...
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
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.
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.
I tested it at 10.2.0.1 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 10.2.0.2, 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.
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;
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 archivelog all;
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?
backup database plus archivelog
DELETE ARCHIVELOG UNTIL TIME 'SYSDATE-3' ALL DELETE ALL INPUT;
delete noprompt obsolete recovery window of 3 days;
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: