Friday, December 9, 2011

Flash Recovery Area in Oracle


db_recovery_file_dest_size parameter is available from oracle 10g onward. This parameter is used set Flash Recovery Area (FRA) to  manage a variety of backup and recovery-related files on your behalf. 

When setting up a flash recovery area, you must choose a location (a directory or Automatic Storage Management disk group) to hold the files. The flash recovery area cannot be stored on a raw file system.
You must also determine a disk quota for the flash recovery area, the maximum space to be used for all files stored there. You must choose a location large enough to accomodate the required disk quota. When the disk space limit is approached, Oracle can delete nonessential files to make room for new files, subject to the limitations of the retention policy.
The flash recovery area should be on a separate disk from the database area, where active database files such as datafiles, control files, and online redo logs are stored. Keeping the flash recovery area on the same disk as the database area exposes you to loss of both your live database files and backups in the event of a media failure.


The files in the flash recovery area can be classified as permanent or transient. The only permanent files (assuming these are configured to be stored in the flash recovery area) are multiplexed copies of the current control file and online redo logs. These cannot be deleted without causing the instance to fail. All other files are transient, because Oracle will generally eventually delete these files, at some point after they become obsolete under the retention policy or have been backed up to tape. Transient files include archived redo logs, datafile copies, control file copies, control file autobackups, and backup pieces.


To enable the flash recovery area, you must set the two initialization parameters DB_RECOVERY_FILE_DEST_SIZE (which specifies the disk quota, or maximum space to use for flash recovery area files for this database) andDB_RECOVERY_FILE_DEST (which specifies the location of the flash recovery area).


Note:.
  • DB_RECOVERY_FILE_DEST_SIZE must be set before DB_RECOVERY_FILE_DEST.
  • In a RAC database, all instances must have the same values for these parameters.


The V$RECOVERY_FILE_DEST and V$FLASH_RECOVERY_AREA_USAGE views can help you determine whether you have allocated enough space for your flash recovery area.
Query the V$RECOVERY_FILE_DEST view 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.
SQL> SELECT * FROM V$RECOVERY_FILE_DEST;

NAME            SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
--------------  ----------- ---------- ----------------- ---------------
/mydisk/rcva     5368709120 109240320             256000              28

Query the V$FLASH_RECOVERY_AREA_USAGE view to find out the percentage of the total disk quota used by different types of files, and how much space for each type of file can be reclaimed by deleting files that are obsolete, redundant, or already backed up to tape.
SQL> SELECT * FROM V$FLASH_RECOVERY_AREA_USAGE;

FILE_TYPE    PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE                   0                         0               0
ONLINELOG                     2                         0              22
ARCHIVELOG                 4.05                      2.01              31
BACKUPPIECE                3.94                      3.86               8
IMAGECOPY                 15.64                     10.43              66
FLASHBACKLOG                .08                         0               1

To disable the flash recovery area, set the DB_RECOVERY_FILE_DEST initialzation parameter to a null string. For example, use this SQL*Plus statement to change the parameter on a running database:

ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='' SCOPE=BOTH SID="*";

The database will no longer provide the space management features of the flash recovery area for the files stored in the old DB_RECOVERY_FILE_DEST location. The files will still be known to the RMAN repository, however, and available for backup and restore activities.

Related Error Messages:

ORA-19802: cannot use DB_RECOVERY_FILE_DEST without DB_RECOVERY_FILE_DEST_SIZE
Cause: There are two possible cause for this error: 1) The DB_RECOVERY_FILE_DEST parameter was in use when no DB_RECOVERY_FILE_DEST_SIZE parameter was encountered while fetching initialization parameter. 2) An attempt was made to set DB_RECOVERY_FILE_DEST with the ALTER SYSTEM command when no DB_RECOVERY_FILE_DEST_SIZE was in use.

Action: Correct the dependency parameter definitions and retry the command.
ORA-19803: Parameter DB_RECOVERY_FILE_DEST_SIZE is out of range (1 - %s)
Cause: Parameter DB_RECOVERY_FILE_DEST_SIZE specfied was not valid.

Action: Specify a valid number within the range.
ORA-19804: cannot reclaim %s bytes disk space from %s limit
Cause: Oracle cannot reclaim disk space of specified bytes from the DB_RECOVERY_FILE_DEST_SIZE limit.Action: There are five possible solutions:
1) Take frequent backup of recovery area using RMAN.
2) Consider changing RMAN retention policy.
Ex:-
    RMAN> configure retention policy to {none,recovery,redundancy};

3) Consider changing RMAN archivelog deletion policy.
4) Add disk space and increase DB_RECOVERY_FILE_DEST_SIZE.
Ex:-
SQL > alter system set db_recovery_file_dest=40g scope=both;

5) Delete files from recovery area using RMAN.
EX:-
  RMAN> delete expired archivelog all;
  RMAN> crosscheck archivelog all;
  
ORA-19808: recovery destination parameter mismatch
Cause: The value of parameters DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE must be same in all instances. instance. All databases must have same recovery destination parameters.Action: Check DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE values in all instances.
ORA-19809: limit exceeded for recovery files
Cause: The value of parameters DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE must be same in all instances. instance. All databases must have same recovery destination parameters.Action: Check DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE values in all instances.
ORA-38776: cannot begin flashback generation - flash recovery area is disabled
Cause: During a database mount, the RVWR process discovered that the flash recovery area was disabled. DB_RECOVERY_FILE_DEST must have been set null or removed from the INIT.ORA file while the database was unmounted.Action: Flashback database requires the flash recovery area to be enabled. Either enable the flash recovery area by setting the DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE initialization parameters, or turn off flashback database with the ALTER DATABASE FLASHBACK OFF command.

No comments:

Post a Comment

Followers