There are a number of ways you can create a flash recovery area:
- Configure the flash recovery area at database-creation time using the Database Configuration Assistant (DBCA).
- Configure two flash recovery area–related dynamic initialization parameters. You can creat a flash recovery area with these two parameters while the database is running.
- Use the OEM Database Control to configure a flash recovery area.
Configuring a Flash Recovery Area
You use two initialization parameters to configure a flash recovery area:
DB_RECOVERY_FILE_DEST_SIZE: This parameter sets the maximum size of the flash recovery area.
DB_RECOVERY_FILE_DEST: This parameter points to the location on disk of the flash recovery area. You must locate the flash recovery area on a disk separate from the database area, where you store the active database files such as datafiles, control files, and online redo logs.
You have to specify DB_RECOVERY_FILE_DEST_SIZE before you can specify DB_RECOVERY_FILE_DEST.
Here’s how you would specify the two flash recovery area initialization parameters in your
init.ora file:
DB_RECOVERY_FILE_DEST_SIZE = 10G
DB_RECOVERY_FILE_DEST = '/u01/oradata/rcv_area'
Dynamically Defining the Flash Recovery Area
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 2G;
System altered.
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = '/u01/app/oracle/flashrec_area';
System altered.
Disabling the Current Flash Recovery Area
If you want to disable the current flash recovery area, set DB_RECOVERY_FILE_DEST to blank (''). This unsets the destination for the flash recovery area files. You can check the V$RECOVERY_FILE_DEST view to see the current location of the flash recovery area.
Examining the Default File Location
The flash recovery area requires that you use OMF, which means you can’t use the LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST parameters to specify redo log archive destinations (if you use these, you can’t enable the flash recovery area). Instead, you must use the newer LOG_ARCHIVE_DEST_n parameters.
With OMF, Oracle designates the default location for the datafiles, control files, and redo log
files based on the values of DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_LOG_DEST_n. You use these two initialization parameters, along with DB_RECOVERY_FILE_DEST, which specifies the location of the flash recovery area
Setting Up Flash Recovery Parameters
Let’s review the procedure for configuring the flash recovery area and look at an example of how to
set up the flash recovery parameters in your initialization file. This example assumes you are using
OMF . OMF files are automatically named and managed by the Oracle database itself. You just provide a directory for the files, and Oracle will take care of the rest.
When you use OMF files, you use two parameters to tell Oracle where to create your datafiles,
online redo log files, and control files. You use the DB_CREATE_FILE_DEST parameter to specify the location for all database files. You use the DB_CREATE_ONLINE_LOG_DEST_n parameter to specify the location of all online redo log and control files. If you don’t specify the second parameter, Oracle will create all three types of files in the directory you specified for the DB_CREATE_FILE_DEST parameter.
For example, here is a set of initialization parameters you might use to create a test database:
DB_CREATE_FILE_DEST = /u02/test/oradata/dbfiles/
LOG_ARCHIVE_DEST_1 = 'LOCATION=/u03/test/arc_dest1'
LOG_ARCHIVE_DEST_2 = 'LOCATION=USE_DB_RECOVERY_FILE_DEST'
DB_RECOVERY_FILE_DEST = '/u03/test/oradata/rcv_area'
DB_RECOVERY_FILE_DEST_SIZE = 10G
This set of initialization parameters will create the following:
• OMF-based datafiles, online redo log files, and control files in the directory specified by the
DB_CREATE_FILE_DEST parameter
• One copy of the current control file in the flash recovery area, since you are using both the
DB_CREATE_FILE_DEST and DB_RECOVERY_FILE_DEST parameters
• One copy of the online redo log files in the flash recovery area, since you are using both the
DB_CREATE_FILE_DEST and DB_RECOVERY_FILE_DEST parameters
• One copy of the archived redo logs in a file system location, indicated by LOG_ARCHIVE_DEST_
1 = 'LOCATION=/u03/test/arc_dest1'
• One copy of the archived redo log files in the flash recovery area, indicated by LOG_ARCHIVE_
DEST_2 = 'LOCATION=USE_DB_RECOVERY_FILE_DEST'
Working with the Flash Recovery Area
When you add a new file to the flash recovery area, Oracle does an update on the list of backup
files it considers eligible for deletion. This list contains files that you’ve backed up to tape or that have become obsolete according to the local retention rules.
You can use the V$FLASH_RECOVERY_AREA_USAGE view to check the space being used by
different types of files, and how much space for each type of file you can reclaim by deleting files that are obsolete, redundant, or already backed up to tape.
No comments:
Post a Comment