Thursday, December 17, 2009

How to change Flash Recovery Area to a new location ?


Subject:
How to change Flash Recovery Area to a new location ?

Note:305651.1
Type:
HOWTO

Last Revision Date:
25-NOV-2005
Status:
PUBLISHED
 
PURPOSE
-------
 
This document shows how to change the Flash Recovery Area destination and
how to move the files from old area to new area.
 
 
SCOPE & APPLICATION
-------------------
 
DBA Support
 
 
How to change Flash Recovery Area to a new location ?
-----------------------------------------------------
 
If you need to move the Flash Recovery Area of your database to a new location, 
invoke SQL*Plus to change the DB_RECOVERY_FILE_DEST initialization parameter. 
For example:
 
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='+disk1' SCOPE=BOTH SID='*';
 
After you change this parameter, all new Flash Recovery Area files will be 
created in the new location.
 
The permanent files (control files and online redolog files), flashback logs 
and transient files can be left in the old Flash Recovery Area location. The 
database will delete the transient files from the old Flash Recovery Area 
location as they become eligible for deletion.
 
For the FLASHBACK logfiles to be able to to pick up the new 'db_recovery_file_dest' location, 
the flashback option needs to be toggled off and on.
 
This can be done like this:
- Shutdown the Database
- Startup mount the Database:
  SQL> startup mount;
- Toggle the Flashback off:
  SQL> alter database flashback off;
- Toggle the Flashback on:
  SQL> alter database flashback on;
- Open the Database:
  SQL> alter database open;
 
If you need to actually move your current permanent files, transient files, to the new Flash Recovery Area, then follow the following steps:
 
1) To move the existing backupsets and archived redo log files,use the following 
   command:
 
   RMAN> BACKUP AS COPY ARCHIVELOG ALL DELETE INPUT;
   RMAN> BACKUP DEVICE TYPE DISK BACKUPSET ALL DELETE INPUT;
 
2) To move the datafile copies. Run the below command for each datafile copy:
 
   RMAN> BACKUP AS COPY DATAFILECOPY  DELETE INPUT;
   
   where the  is the datafilecopy name in the old recovery area.
 
3) To move the controlfile from the old Flash Recovery Area to new one. Run the 
   following command with database in NOMOUNT state.
 
   RMAN> RESTORE CONTROLFILE FROM 'filename_of_old_control_file';
 
4) To move the online redo logs. Use the commands to add a a log file stored in 
   the new Flash Recovery Area and drop the logfile in the old Flash Recovery Area 
   for each redo log group.
 
   SQL> alter database add logfile size 100M;
   SQL> alter database drop logfile 'name of the old redo log';
 
Oracle will clean up transient files remaining in the old Flash Recovery Area 
location as they become eligible for deletion.
 
 
REFERENCE
----------
 
Note 305817.1 FAQ - Flash Recovery Area feature of 10G

No comments:

Post a Comment