|
Monday, April 6, 2009 |
Flash Recovery Area |
Using the Flash Recovery Area
The flash recovery area serves as the default storage area for all files related to backup and restore operations.
The flash recovery area provides the following benefits: • Single storage location for all recovery-related files. • Automatic management of recovery-related disk space. • Faster backup and restore operations, since you don’t need to restore tape backups. • Increased reliability of backups, since disks are generally safer storage devices than tapes.
What’s in the Flash Recovery Area? The flash recovery area may contain the following files: • Datafile copies: The new RMAN command BACKUP AS COPY can be used to create image copies of all datafiles and automatically store in the flash recovery area. • Control file autobackups: The database places any control file backups it generates in the flash recovery area. • Archived redo log files: If you store Archived redo log files in the flash recovery area, Oracle will automatically delete the files. • Online redo log files: Oracle recommends that you save a multiplexed copy of your online redo log files in the flash recovery area. The following statements can create online redo logs in the flash recovery area: CREATE DATABASE, ALTER DATABASE ADD LOGFILE, ALTER DATABASE ADD STANDBY LOGFILE, and ALTER DATABASE OPEN RESETLOGS. • Current control files: Oracle also recommends that you store a multiplexed current control file in the flash recovery area. • RMAN files • Flashback logs: If you enable the flashback database feature, Oracle copies images of each altered block in every datafile into flashback logs stored in the flash recovery area.
Note: Oracle calls the multiplexed redo log files and control files in the flash recovery area permanent files, since they should never be deleted and are part of the live database. Oracle terms all the other files in the flash recovery area (recovery related files) transient files, since Oracle will delete them eventually after they have become obsolete or have already been copied to tape. Creating a Flash Recovery Area
You use the DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE initialization parameters to configure a flash recovery area in your database. When you use the DB_RECOVERY_FILE_DEST parameter to specify the destination of your flash recovery area, you can use a directory, file system, or ASM disk group as your destination.
Dynamically Defining the Flash Recovery Area
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 2G SCOPE=BOTH ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = 'C:\ORACLE\RECOVERY_AREA' SCOPE=BOTH
You must always specify the size parameter before specifying the location parameter. Disabling the Current Flash Recovery Area
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = ''
Note: even after you disable the flash recovery area, the RMAN will continue to access the files located in the flash recovery area for backup and recovery purposes.
Default File Location and the Flash Recovery Area The initialization parameters DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_LOG_DEST_n determine the location of all OMF files. Control Files If you haven’t set the CONTROL_FILES parameter, Oracle will create the control files in various default locations, according to the following rules:
• If you specify the DB_CREATE_ONLINE_LOG_DEST_n parameter, Oracle will create an OMF-based control file in n number of locations, with the first directory holding the primary control file. • If you specify the DB_CREATE_FILE_DEST and DB_RECOVERY_FILE_DEST parameters, Oracle will create an OMF based control file in both of these locations. • If you just specify the DB_RECOVERY_FILE_DEST parameter, Oracle will create an OMF-based control file in the flash recovery area only. • If you omit all three of the initialization parameters, Oracle will create a non-OMF-based control file in the system-specific default location. Note: If the database creates an OMF control file, and it is using a server parameter file, then the database sets the CONTROL_FILES initialization parameter in the server parameter file. Redo Log Files
If you omit the LOGFILE clause during database creation, Oracle will create the redo log files according to the same rules as mentioned above. Backing Up the Flash Recovery Area In order to back up the flash recovery area itself using RMAN, you must set CONFIGURE BACKUP OPTIMIZATION to ON. You can back up the flash recovery area only to a tape device using these backup commands:
BACKUP RECOVERY AREA
o This command backs up all flash recovery files in the current or previous flash recovery area destinations. o It backs up only those files that have never been backed up to tape before. o The files that the command will back up include full backups, incremental backups, control file autobackups, archive logs, and datafile copies.
BACKUP RECOVERY FILES
This command backs up all the files that the BACKUP RECOVERY AREA command does, but from all areas on your file system, not just from the flash recovery area.
BACKUP RECOVERY FILE DESTINATION
Use this command to move disk backups created in the flash recovery area to tape. Note: Neither of the two commands, BACKUP RECOVERY AREA or BACKUP RECOVERY FILES, will back up any permanent files or the flashback logs in the flash recovery area.
Managing the Flash Recovery Area Space Management
If you ever receive the out-of-space warning (85) and critical alerts (97) because of space pressure in you flash recovery area, you have the following options: o Consider changing your backup retention and archive log retention policies. o Increase the size of the DB_RECOVERY_FILE_DEST_SIZE parameter to allocate more space to your current flash recovery area. o Use the BACKUP RECOVERY AREA command in the RMAN to back up the contents of the flash recovery area to a tape device. o Use the RMAN to delete unnecessary backup files. The RMAN commands CROSSCHECK and DELETE EXPIRED come in handy during this deletion process.
Data Dictionary Views
V$RECOVERY_FILE_DEST This view is the main source and contains the following columns:
SPACE_LIMIT :how much space has been allocated to the flash recovery area
SPACE_USED :space occupied
SPACE_RECLAIMABLE :how much space you can reclaim by getting rid of obsolete and redundant files in the flash recovery area. NUMBER_OF_FILES :number of files
V$FLASH_RECOVERY_AREA_USAGE
This view provides information about the flash recovery area disk space usage. Following is its main columns:
FILE_TYPE :the type of the file and can have any of the following values: controlfile, onlinelog, archivelog, backuppiece, imagecopy, flashbacklog
PERCENT_SPACE_USED :This represents the disk space used by the file type, in percentage.
PERCENT_SPACE_RECLAIMABLE :this represents the percentage of disk space reclaimable from the file type after deleting any obsolete or redundant files, and files backed up to a tertiary device.
Flash Recovery Area Columns in Other Views
The Yes/No column IS_RECOVERY_DEST_FILE is added to some dictionary views to indicate whether the file was created in the flash recovery area. It exists in V$CONTROLFILE, V$LOGFILE, V$ARCHIVED_LOG, V$DATAFILE_COPY, V$BACKUP_PIECE. Moving the Flash Recovery Area
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/u01/app/oracle/new_area' SCOPE=BOTH
Eventually, Oracle will delete all the transient files from the previous flash recovery area location, when each of them become eligible for deletion. However, if you want to move your current permanent files, transient files, or flashback logs to the new flash recovery area, you can do so by using the standard file-moving procedures.Labels: Flash Recovery Area |
posted by Srinivasan .R @ 7:15 AM |
|
|
|
|