Yann Neuhaus Blog

All around Open Source and High Availability

Oracle Backup with Media Manager and Flashback Recovery Area (FRA)

Managing RMAN backups with FRA (Flashback Recovery Area) is definitively not "out of the box". Consider the following situation: the RMAN backup are performed in the Flashback Recovery Area in a first step (before going to tape). In a second step, the backup are saved on tape from the FRA with the following policies : DAILY, WEEKLY, MONTHLY. Each policy has its own retention (5 days, 5 weeks, 13 months).

The used media manager is NetBackup from Veritas. The backup scripts look like:

Backup of the database:
run {
allocate channel bck_chan1 type disk;
backup as compressed backupset incremental level 1 tag inc1_daily_dbf database;
backup current controlfile for standby
tag inc1_daily_std_ctrl;
sql "alter system archive log current";
backup filesperset 300 archivelog all not backed up 2 times tag inc1_daily_arch;
backup current controlfile tag inc1_daily_cur_ctrl;
backup spfile tag inc1_daily_spfile;
sql "alter database backup controlfile to trace";
backup filesperset 300 archivelog until time 'SYSDATE - 3' not backed up 2 times delete input tag inc1_daily_arch;
release channel bck_chan1;
}


Backup of the FRA:
run
{
allocate channel bck_chan1 type 'SBT_TAPE';
send  'NB_ORA_CLASS=Net0WinOracleGP, NB_ORA_SERV= NetBackupServ, NB_ORA_SCHED=DaillySchedule,NB_ORA_CLIENT=MyClient';
backup recovery area;
release channel bck_chan1;
}


If you didn't setup any RMAN catalog house keeping from the begin you could be confronted with large crosscheck/delete times the first time. The goal is to remove the RMAN catalog entries because they were already deleted from the media manager (out of the retention period).

A way to optimize the crosscheck/delete procedure, is to perform a first crosscheck with the NetBackup parameters (an access to the tape media manager will be performed) : the backup no more existing on tape will be set to “EXPIRED”. In a second step delete the “EXPIRED” backup with a new channel without NetBackup channel parameters (no tape access required, this will be faster):

For instance, to delete all the backups older then 100 days:
allocate channel for maintenance type 'SBT_TAPE';

# Set the NetBackup parameters
send 'NB_ORA_CLASS=Net0WinOracleGP, NB_ORA_SERV=NetBackupServ, NB_ORA_SCHED=DaillySchedule,NB_ORA_CLIENT=myclient';

# Perform the crosscheck
crosscheck backup completed before 'sysdate - 100';

# This second allocate avoids any netbackup access because no NetBackup
# variables are set.
allocate channel for maintenance type 'SBT_TAPE';

# Delete the entries in the catalog :
delete force noprompt expired backup completed before 'sysdate - 100';

But the problem is not yet totally solved. Indeed some entries have been deleted from the catalog which MAY (!) be still available on the FRA ! This could be due to the fact that the FRA is very large. This can be easily verified by a simple “ls” command in the FRA :
ls -lrt /export/oradata/ORACLE_SID/data99/flash_recovery_area/ORACLE_SID_SITE1/backupset/

In fact Oracle doesn't delete the FRA backupset as long as space if available in the FRA. Also the RMAN command “delete “EXPIRED”” does NOT delete the FRA backupsets.

The consequence is very simple: on the next scheduled daily backup all the backupset still available in the FRA will be backed up again on the Media Manager. This could generate a bad surprise because the backup will suddenly take much more time (depending on the size of the FRA).

It is required to suppress the backupset manually from the FRA through the following command:
delete obsolete recovery window of 100 days device type disk;

The FRA seems to clear the old backup set automatically when space is required, but when lot of space is available in the FRA the backup remain and must be cleaned manually.

It is also worth to mention that this effect also takes place even if only one retention period has been defined. The only factor limiting the number of backup stored in the FRA is the place available and not the retention period of the RMAN backup strategy.

One of the numerous hidden FRA “feature”. However the benefit of the FRA in a Dataguard environment largely covers the several drawbacks.

Kommentare

rman catalog scripts sagte:

Ping Antwort von  rman catalog scripts

# August 1, 2008 8:53
Kommentar abgeben

(verpflichtend) 

(verpflichtend) 

(optional)

(verpflichtend)