Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 62 Insurance
- 536K On-Premises Infrastructure
- 138.2K Analytics Software
- 38.6K Application Development Software
- 5.7K Cloud Platform
- 109.4K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
delete obsolete not working

Oracle DB 12.1.0.2
Solaris 11.4
Hello Team,
Good morning.
I did a crosscheck backup on disk and found backups on 12 and 15 Aug 2020. RMAN retention recovery window is set to 2 days.
RMAN> crosscheck backup;
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/files/CC_df_DWARE1_20200812_26571_1 RECID=26173 STAMP=1048269258
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/files/CC_df_DWARE1_20200812_26572_1 RECID=26174 STAMP=1048269262
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/files/CC_df_DWARE1_20200812_26570_1 RECID=26175 STAMP=1048269255
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/files/CC_df_DWARE1_20200812_26569_1 RECID=26181 STAMP=1048269254
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+RECO/DWARE1/AUTOBACKUP/2020_08_12/s_1048274205.6675.1048274205 RECID=26187 STAMP=1048274205
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/files/CC_df_DWARE1_20200815_26917_1 RECID=26490 STAMP=1048544360
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/files/CC_df_DWARE1_20200815_26918_1 RECID=26491 STAMP=1048544360
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/files/CC_df_DWARE1_20200815_26916_1 RECID=26492 STAMP=1048544360
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/backup/files/CC_df_DWARE1_20200815_26915_1 RECID=26493 STAMP=1048544360
The problem is when is execute delete obsolete backups on 12 and 15 are not deleted.
RMAN> delete obsolete device type disk;
RMAN retention policy will be applied to the command
Kindly advise.
Thanks,
Joe
RMAN retention policy is set to recovery window of 2 days
no obsolete backups found
Answers
-
And what types of backups are these?
Recovery window of two days does NOT mean anything older than two days is obsolete. It means rman will keep anything and everything needed to guarantee recovery to any point in time within the last two days (actually, last 48 hours) of when recovery is requested. And all recovery must begin with the most recent level 0 backup prior to the recovery point in time. So, to take an extreme example, if you only take a full/level 0 backup on the first day of the month, that backup and most (if not all) level 1 backups and archivelogs will still be needed - and thus NOT be obsolete - on the 30th of the month.
-
Like EdStevens said, you have told rman that you want to be able to restore to any point in time for the last two days (starting from the "obsolete" command backwards).
We do see your point many times in our workshops, so an example:
You do set "recovery window 1 day" - this means, you tell the database to guarantee the possibility to recover to any point in the last 24 hours.
You take incremental 0 backups (which is more or less a full one) on Sunday 1st, 8pm, it's running two hours.
You take incremental backups level 1 (not cumulative!) every evening at 8pm (running an hour) and you are doing archive log backups every half an hour.
Now it is Saturday, 7th, and you do a delete obsolete - nothing obsolete of the datafile backup is found (maybe some archivelogs are deleted).
Now it is Sunday, 8th, you do your incremental level 0 backup, after this, you do a delete obsolete. Oracle will delete some old archivelog backups only, because to restore, the first level 0 and all level 1 backups + the latest archivelogs are still needed.
No it is Monday, 9th, you do your incremental backup level 1 and a delete obsolete. As level 1 is faster than level 0, the backup ended at 9pm - to recover the last 24h, the first level 0 ist still needed (as the second level 1 ended at 10pm on Sunday, 8th, in the evening). So the first time, rman will delete the first level 0 backups and the incremental backups for the first week is, if you specify a delete obsolete after Monday, 9th, 10pm,
This means, you do have more than a week backups on disk - even the recovery window is only ONE day.
At the workshops, I therefore always specify a RESTORE and a RECOVER concept with the customers, because the backup strategy drops out of that concept "by itself", more or less.
-
Then how will the backup incremental L0 backups and subsequent L1 backups be deleted from Monday 1st ?
-
Only after 24hours (the set recovery window) AFTER the Sunday, 8th, backup has finished. So, if the backup has finished Sunday, 8th 10pm, the backups BEFORE this moment can/will be obsolete after Monday, 9th, 10:00:01pm.
The "control_file_record_keep_time" must be set to e.g. 10 (days), that all these backups are still in the metadata repository of the controlfile (or you do use an external RMAN catalog).