Configuration of the Flash Recovery Area

Document ID : KB000054950
Last Modified Date : 14/02/2018
Show Technical Document Details

The flash recovery area is implemented in the Espresso/d:Series Oracle package. It allows for automated Oracle file management in a much easier way then the previous versions of Oracle.

The configuration variables are listed below:

DB_RECOVERY_FILE_DEST

Defines the location of the default file system directory where the database creates RMAN backups when no format option is used, archived logs when no other local destination is configured, and flashback logs. Also used as the default file system directory for redo log and control files if DB_CREATE_ONLINE_LOG_DEST_n is not specified. DB_RECOVERY_FILE_DEST_SIZE defines the size of the flashback. This is the case with Espresso packaged Oracle.

The file system directory specified by either of these parameters must already exist: the database does not create it. The directory must also have permissions to allow the database to create the files in it.

The default location is used whenever a location is not explicitly specified for the operation creating the file. The database creates the filename, and a file thus created is an Oracle-managed file.

Both of these initialization parameters are dynamic, and can be set using the ALTER SYSTEM or ALTER SESSION statement.

These are sample entries in the spfile:

  db_recovery_file_dest=/export/home/oratest/flash_recovery_area 
  db_recovery_file_dest_size=8489271296 

In Espresso, these correlate to $ORACLE_HOME/flash_recovery_area.

To view the current setting:

SQL> show parameter DB_RECOVERY_FILE_DEST_SIZE; 
NAME                                    TYPE                 VALUE 
------------------------------------ ----------- ------------------------------ 
db_recovery_file_dest_size big         integer               4048M 

Likewise, increasing the size at runtime can be achieved using:

    SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=8G; 

System altered.

Backup and Recovery

Espresso provides backup and recovery scripts in $ORACLE_HOME/Cybermation/scripts. These RMAN backup scripts are configured to use the Flash_Recovery_Area.

---------------------------------- 
bash-2.05$ cat backup.rman 
#spool log to backup.log; 
connect target / ; 
CONFIGURE CONTROLFILE AUTOBACKUP ON; 
CONFIGURE DEFAULT DEVICE TYPE TO DISK; 
CONFIGURE RETENTION POLICY TO REDUNDANCY 2; 
CONFIGURE BACKUP OPTIMIZATION ON; 
BACKUP DATABASE PLUS ARCHIVELOG; 
DELETE NOPROMPT OBSOLETE; 
spool log off; 
---------------------------------- 

After a backup, the Flash_Recovery_Area would contain:

drwxrwx--- 10 oracle dba 512 Jun 29 13 :33 archivelog 
drwxr-x--- 3 oracle dba 512 Jun 29 13 :47 autobackup 
drwxr-x--- 3 oracle dba 512 Jun 29 13 :46 backupset 

The Importance of Maintaining the Flash_Recovery_Area

In Espresso, the database is set to archive logs to the Flash_Recovery_Area. If the Flash_Recovery_Area is filled up, the database will not be able to archive logs, and eventually will crash. It is also important to realize that the size of Flash_Recovery_Area should be within the filesystem size on which the Flash_Recovery_Area resides. While Oracle will not write logs past the size of the Flash_Recovery_Area, if the Flash_Recovery_Area is greater than the size of the filesystem, it can cause a database crash if the filesystem fills up.

Disk Usage

If you have a flash recovery area configured, however, then the database automatically deletes unnecessary files from the flash recovery area based on its internal disk quota rules. The disk quota rules are distinct from the backup retention policy rules, but the database will never delete files in violation of the retention policy to satisfy the disk quota.

Resolving a Full Flash Recovery Area

To see the current state of the recovery area, use

V$RECOVERY_FILE_DEST 
SQL> select * from V$RECOVERY_FILE_DEST; 
NAME 
-------------------------------------------------------------------------------- 
SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES 
----------- ---------- ----------------- --------------- 
/export/home/oratest/flash_recovery_area 
1842348032 1794662400 565282816 31 

You have a number of choices on how to resolve a full flash recovery area when there are no files eligible for deletion:

  • Make more disk space available, and increase DB_RECOVERY_FILE_DEST_SIZE to reflect the new space.
  • Use the command BACKUP RECOVERY AREA, to back up the contents of the flash recovery area to a tertiary device such as tape.
  • Delete unnecessary files from the flash recovery area using the RMAN delete command. (Note that if you use host operating system commands to delete files, then the database will not be aware of the resulting free space. You can run the RMAN CROSSCHECK command to have RMAN re-check the contents of the flash recovery area and identify expired files, and then use the DELETE EXPIRED command to remove missing files from the RMAN repository.)

You may also need to consider changing your backup retention policy and, if using Data Guard, consider changing your archivelog deletion policy.

To Reduce the size of Flash_Recovery _Area In Case of Emergency:

Manually remove the archivelogs.

    RMAN 
    target / 
    crosscheck archivelog all; 
    delete expired archivelog all;