Home » RDBMS Server » Backup & Recovery » RMAN backup deleted even within recovery window (Oracle 10g (10.2.0.2.0), Windows 2003 server 64bit SP2)
RMAN backup deleted even within recovery window [message #527477] Tue, 18 October 2011 04:31 Go to next message
pt12340
Messages: 8
Registered: August 2011
Junior Member
I have problem on using "delete obsolete" in RMAN.

First, let describe my backup configuration.

1. Full backup every Monday (17-Oct, 10-Oct, 3-Oct, 26-Sep)
2. Incremental backup for other days
3. Enable autobackup of control file
4. Backup archive log every day
5. RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS
6. Execute "Delete obsolete" every day
7. control file is used instead of catalog

The results observed:
1. Backup of control files older than 30 days will be deleted
2. Backup of archive log files older than 30 days will be deleted.
3. Backup of datafiles older than ~14 days but before 30 days are also DELETED.

In my example, the backup of datafiles created at 26-Sep is deleted at 16-Oct.

What is going wrong?

I tried "restore database validate until time "sysdate-22"" at 17-Oct. And RMAN reported "datafile xx will be created automatically during restore operation". It seems that RMAN failed to do restoration up to 22 days ago. The retention policy I set seems not effective on datafile backups.

I checked view v$backup_set and the "Keep" is "No" and "Keep until" is empty.

The only thing I can think of, is the settings of "CONTROL_FILE_RECORD_KEEP_TIME". It is marked "7" in the Oracle, which is less than the retention. But I suppose this only causes the backup not deleted, but NOT be deleted earlier.

Thanks.
Re: RMAN backup deleted even within recovery window [message #527481 is a reply to message #527477] Tue, 18 October 2011 05:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
What is going wrong?

Maybe your policy is not the one you think you have.

Regards
Michel
Re: RMAN backup deleted even within recovery window [message #527567 is a reply to message #527481] Tue, 18 October 2011 21:46 Go to previous messageGo to next message
pt12340
Messages: 8
Registered: August 2011
Junior Member
I checked in RMAN by typing "show all;".
It did show "retention policy to recovery window of 30 days"
And, it seems the RMAN can identify the "backup of control files" and "backup of archive log files" as obsolete correctly. But incorrectly mark some "backup of datafiles" as obsolete.

How can I verify and proceed to check?

Philip
Re: RMAN backup deleted even within recovery window [message #527578 is a reply to message #527567] Wed, 19 October 2011 00:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Check the script.

Regards
Michel
Re: RMAN backup deleted even within recovery window [message #527728 is a reply to message #527578] Wed, 19 October 2011 22:35 Go to previous messageGo to next message
pt12340
Messages: 8
Registered: August 2011
Junior Member
My script is simple. Here is the output RMAN command:

---start of command---
CONNECT TARGET yyy/xxx@aaa

CROSSCHECK archivelog all;
delete noprompt expired archivelog all;
RUN {
SHOW ALL;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'c:\db\backup\control_%d_%F';
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\db\backup\data_%d-%T-%t%s';
SHOW ALL;
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 1 FOR RECOVER OF TAG 'de_level_0' TAG 'de_level_1' DATABASE;
BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT 'c:\db\backup\archlog_%d-%T-%t%s';
}
DELETE OBSOLETE;
LIST BACKUP;
--end of command--

On Monday, the database backup is replaced by command
"BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0 TAG 'de_level_0' DATABASE;".

The result of "show all" is
--start of "show all;" result--
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'c:\db\backup\control_%d_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\db\backup\data_%d-%T-%t%s';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\xxx.ORA'; # default
--end of "show all;" result--

Can you see any problem? Any Oracle parameters I can check/verify?

Philip
Re: RMAN backup deleted even within recovery window [message #537908 is a reply to message #527728] Mon, 02 January 2012 20:01 Go to previous messageGo to next message
pt12340
Messages: 8
Registered: August 2011
Junior Member
Hi all,

I report the solution I find for my problem here.

After several trials, I find that I need to configure the Oracle parameter "CONTROL_FILE_RECORD_KEEP_TIME" to something bigger than 30, to make my retention policy to work.

It seems that the "backup record entry" of my backups are deleted around 14 days (even though the "CONTROL_FILE_RECORD_KEEP_TIME" is set to 7 at this moment). Then RMAN also deletes the backup files when the "backup record entry" is removed from the control file.

Hope this information is useful to you all.

Re: RMAN backup deleted even within recovery window [message #537924 is a reply to message #537908] Tue, 03 January 2012 01:02 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Thanks for the feedback.

CONTROL_FILE_RECORD_KEEP_TIME is a lower limit, it does not mean Oracle will delete the maching records as soon as the limit is reached but it does not do it before the limit is reached.
Actually Oracle deletes the matching records when there is a lock of entries in the control file.

Regards
Michel
Previous Topic: Recovery Catalog error
Next Topic: rman Incomplete recovery
Goto Forum:
  


Current Time: Thu Mar 28 08:14:04 CDT 2024