RMAN - How to restore the controlfile using RMAN [ID 580414.1]

 

RMAN - How to restore the controlfile using RMAN [ID 580414.1]

 Modified 10-JUN-2010     Type HOWTO     Status PUBLISHED 

In this Document
  Goal
  Solution


 

 

Applies to:

Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 11.1.0.6 - Release: 9.2 to 11.1
Oracle Server - Personal Edition - Version: 9.2.0.1 to 11.1.0.6   [Release: 9.2 to 11.1]
Oracle Server - Standard Edition - Version: 9.2.0.1 to 11.1.0.6   [Release: 9.2 to 11.1]
Information in this document applies to any platform.

Goal

There are many ways to restore the controlfile for recovery using RMAN. This note provides several examples of how to get the controlfile back quickly so the restore of the database can be started asap.

Note: If you do not specify where to restore the controlfile to the parameter control_files is used with the respective names and locations listed in the parameter file (init.ora or spfile).

Configuring the Control File Autobackup Format

By default, the format of the autobackup file for all configured devices is the substitution variable %F in the FORMAT clause. This variable format translates into c-IIIIIIIIII-YYYYMMDD-QQ, with the placeholders defined as follows:

 IIIIIIIIII
stands for the DBID.

 YYYYMMDD is a time stamp of the day the backup is generated.

 QQ is the hex sequence that starts with 00 and has a maximum of FF.

Solution

Restoring the Controlfile using RMAN backups using a Recovery Catalog and the Flash Recovery Area.

1. Restore controlfile from autobackup

 RMAN> restore controlfile from autobackup;

2. Restore controlfile from a specific backup piece.

 RMAN> restore controlfile from '/backup_dir/piece_name';

3. Restore controlfile from most recent available controlfile backup.

 RMAN> restore controlfile;

RMAN commands without using the Flash Recovery Area or Recovery Catalog. The big difference is the requirement to set the dbid of the database before executing restore with the instance in a nomount state.

4. The backup used all defaults, This backup should be in $ORACLE_HOME/dbs.

 RMAN> set dbid=xxxxxxxxx;
 RMAN> restore controlfile from autobackup;

5. Restore from autobackup looks at the most recent 7 days backups  by default. If you want to restore an autobackup that's older  then the default you can use the 'maxdays' parameter.

 RMAN> set dbid=xxxxxxxxx;
 RMAN> restore controlfile from autobackup maxdays 20;

6. Restore from autobackup increasing the number of autobackup
sequences looked for restore in case your database generated
many autobackups in a given day.

RMAN> set dbid=xxxxxxxxx;
RMAN> restore controlfile from autobackup maxseq 10;

7. Restoring from autobackup when the backup location is not default.

 RMAN> set dbid=xxxxxxxxx;
 RMAN> set controlfile autobackup format for device type disk to '/tmp/%F';
 RMAN> restore controlfile from autobackup;

8. Restore the controlfile from this specific autobackup.

 RMAN> set dbid=xxxxxxxxx;
 RMAN> restore controlfile from '/tmp/c-1140771490-20080502-03';

9. Restore the controlfile from a specific autobackup file to a
temporary disk location the replicate the temp controlfile to the respective locations and names given in control_files.

 RMAN> set dbid=xxxxxxxxx;
 RMAN> restore controlfile from
 '/tmp/c-1140771490-2008050203'  to '/tmp/control.tmp';
 RMAN> replicate controlfile from '/tmp/control.tmp';

 As you can see there are many ways to get the controlfile from backup onto disk for use. Once you have the controlfile restored and mounted you have access to your previous backup configuration which will also be used during restore as well as the backup information required to restore and recover your database. After you mount the controlfiles from Oracle101g 10.2.x > you can use the RESTORE PREVIEW command to see what backups will be required to restore and recover and what checkpoint you must exceed to open the database resetlogs.


 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值