改变 Flash Recovery Area (FRA)到一个新路径的方法

改变 Flash Recovery Area (FRA)到一个新路径的方法。

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

目标:
本文描述了改变FRA目的地的方法和从老的FRA中move file到新FRA的方法

解决方案:
如果你需要改变你的FRA到新的路径,需要从sqlplus里边改变DB_RECOVERY_FILE_DEST初始化参数:

SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='+disk1' SCOPE=BOTH SID='*';

当你改变这个参数之后,新的所有的FRA file 将会建立在新的路径下

永久的file(控制文件和在线日志文件),闪回日志和临时文件可以放在老的FRA区里边。当这些临时文件可以被删除时,数据库将会从老的FRA区里边删除这些临时文件.

为了闪回日志能使用新的'db_recovery_file_dest'位置,数据库的闪回选项需要off掉再on

类似如下的方法:

- 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;

如果你需要move你的永久文件、临时文件到新的FRA区中,请使用下面的步骤:
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.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值