Sunday, January 17, 2010

File Deletion Policy from Flash Recovery Area (FRA)

Flash Recovery Area (FRA) is used to set up a disk area where the database can create and manage a variety of files related to backup and recovery. If database level flashback is on then oracle creates flashback logs into flash recovery area. Also oracle creates archived logs in the flash recovery area. RMAN can store its backup sets and image copies in the flash recovery area too.

By default if flash recovery area is enabled then any backups of tablespace /datafile /database/ spfile/ controlfile/ archived logs go to flash recovery area. The site of flash recovery area is set by the parameter db_recovery_file_dest_size parameter and its location is specified by db_recovery_file_dest parameter. Now if the total file size inside flash recovery area is about to reach the it's limit then the files which to be deleted to reclaim space is determined by RMAN backup retention policy. Oracle Database does not delete eligible files from the flash recovery area until the space must be reclaimed for some other purpose. Thus, files recently moved to tape are often still available on disk for use in recovery. The recovery area can thus serve as a cache for tape. When the flash recovery area is full, Oracle Database automatically deletes eligible files to reclaim space in the recovery area as needed.

Based on the space in your flash recovery area oracle database will generate alert. The database issues a warning alert when reclaimable space is less than 15% and a critical alert when reclaimable space is less than 3%. When the recovery area is completely full and oracle sees there is no files for deletion from the flash recovery area, it will throw following errors,

ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim nnnn bytes disk space from mmmm limit


where nnnn is the number of bytes required and mmm is the disk quota.

So before you hit this error you should know which files from FRA should be eligible for deletion and which are not. I have made a list based on deletion policy.

1) Permanent files are never eligible for deletion. For example multiplexed redo log files and control files are part of database, that means they are permanent files and so they are never eligible for deletion.

2) Files that are obsolete under the retention policy are eligible for deletion. For example you set up CONFIGURE RETENTION POLICY TO REDUNDANCY 1 in RMAN configuration parameter but you have more than 1 copy backup and your FRA is under space pressure, then oracle can delete older copies of backup. In the same way if you configure RMAN to recovery window of 7 days and you have backups more than 7 days and those older backups are not needed to recover database in any point within 7 days then those older files than 7 days are eligible for deletion from FRA.

3) Transient files that have been copied to tape are eligible for deletion.

4) Archived redo logs are not eligible for deletion until all the consumers of the logs have satisfied their requirements ( If Archived Redo Log Deletion Policy is set ).
Note that, the default settings of archive log is
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
which mean by default archive logs are never eligible for deletion.

5) Foreign archived logs that have been mined by a LogMiner session on a logical standby database are eligible for deletion. Unlike an ordinary archived redo log, a foreign archived redo log has a different DBID.

6) If retention policy is set to none then no files will be eligible for deletion. But note that
if files are never considered obsolete, then a file can only be deleted from the flash recovery area if it has been backed up to some other disk location or to a tertiary storage device such as tape.

You can monitor flash recovery area space by following two views

A) V$RECOVERY_FILE_DEST : To find out the current location, disk quota, space in use, space reclaimable by deleting files, and total number of files in the flash recovery area.

B) V$FLASH_RECOVERY_AREA_USAGE : To find out the percentage of the total disk quota used by different types of files, how much space for each type of file can be reclaimed by deleting files that are obsolete, redundant, or already backed up to tape.

Related Documents
RMAN-06091 no channel allocated for maintenance (of an appropriate type)
RMAN-06429: TARGET database is not compatible with this version of RMAN
How to take RMAN backup on a remote disk/ location
RMAN-00554,RMAN-04005,ORA-0103 when remote connection by rman
Set Date format inside RMAN environment
How to skip a tablespace for restore operation
How to debug Backup, Restore Session in RMAN
Restore operation fails with RMAN-11003 ORA-01511 ORA-01516
Recover database after only lose of all controlfiles
RMAN-04014: startup failed: ORA-07446: sdnfy: bad value
How to restore an Spfile from autobackup older than 7 days
RMAN-06172: no autobackup found
Creating a Duplicate Database on a Remote Host -Part1
Database Duplication Fails Missing Log RMAN-06053 RMAN-06025
How to perform Database Point in time Recovery DBPITR

No comments:

Post a Comment