How to change Flash Recovery Area to a new location ? (文档 ID 305651.1)

来源:互联网 发布:欧文16年数据 编辑:程序博客网 时间:2024/05/16 09:27

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Information in this document applies to any platform.
***Checked for relevance on 14-Oct-2013***

GOAL

This document shows how to change the Flash Recovery Area destination and
how to move the files from old area to new area.

SOLUTION

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:

SQL> 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    
  SQL> shutdown immediate

- Startup mount the Database:
  SQL> startup mount; 

- Drop the garanteed restore points    
  SQL> select * from v$restore_point;
       drop restore point <name>;

- 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 <name> DELETE INPUT;


   
   where the <name> is the datafilecopy name in the old recovery area.

3) To move the controlfile from the old Flash Recovery Area to new one. 
   Change the location in the parameter CONTROL_FILES to the new location
   and restart the instance in NOMOUNT.

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.

REFERENCES

NOTE:833663.1 - Flash Recovery Area - FAQ
NOTE:460145.1 - Space Usage Figures in V$flash_recovery_area_usage Misleading When FRA Location is Changed
  

相关内容

   
 

产品

   
  • Oracle Database Products > Oracle Database > Oracle Database > Oracle Database - Enterprise Edition > Flashback Recovery > Flash Recovery Area
原创粉丝点击