Oracle Rman Restore and Recovery Tutorial (ii) How to restore control files

Source: Internet
Author: User
Tags backup

1. Recover control files from automatic backup using Rman (without Fra)

ORACLE will default to create server parameter files and control files in the $oracle_home/dbs or $ORACLE _home/database directory.

Assuming that the instance parameter file has been restored and the instance is started, the general process of restoring the control file is to set up Oracle_sid and log on Rman first, and then set up dbid to let RMAN know which database control file to look for.

If you use the default location to store automatic backups of control files, you can simply execute: Restore controlfile from autobackup so that Rman can find the control file backup set containing the latest control files. Once the control file is restored, you must close the Restart database instance. If you are using a non-default location, you need to assign a channel to that location, and then use the same method to restore the control file.

When the restore Controlfile from autobackup command is executed, Oracle finds automatic control file backup sets in the default location (or in the location defined by using the Allocate channel command). Through dbid, RMAN uses this dbid to find the most recent control file backup set in the directory that contains the control file backup. By applying the MAXSEQ and maxdays parameters of the Restore command, you can modify the time period for the Rman lookup to control the automatic backup of files.

Examples of using the default settings:

Set ORACLE_SID=ORCL

Rman Target Sys/pwd

Set dbid=1247395743

Startup Nomount;

Restore Controlfile from Autobackup;

Shutdown immediate;

Examples that do not use the default settings:

Set ORACLE_SID=ORCL

Rman Target Sys/pwd

Set dbid=1247395743

Startup Nomount;

Run

{

Set controlfile autobackup format for device type disk to ' f:/backup/%f ';

Allocate channel C1 device type disk;

Restore SPFile from Autobackup;

}

Shutdown immediate;

Use the MAXSEQ and maxdays parameters to look backward for the control file backup set within a time period that exceeds the default number of days (10 days):

Set ORACLE_SID=ORCL

Rman Target Sys/pwd

Set dbid=1247395743

Startup Nomount;

Run

{

Set controlfile autobackup format for device type disk to ' f:/backup/%f ';

Allocate channel C1 device type disk;

Restore Controlfile from Autobackup maxseq maxdays 1000;

}

Shutdown immediate;

Restore the parameter file to a different location and to an example in a file (assuming the database is starting and running):

Set ORACLE_SID=ORCL

Rman Target Sys/pwd

Set dbid=1247395743

Startup Nomount;

Restore Controlfile to ' f:/backup/ctl.restore ' from autobackup;

Shutdown immediate;

2. Recover control files from automatic backup using Rman and FRA

The process of using the FRA recovery control file is very simple, first ensuring that the FRA position parameters are set correctly. Then start the instance, execute: Restore Controlfile from Autobackup;

Set ORACLE_SID=ORCL

Rman Target Sys/pwd

Startup Nomount;

Restore Controlfile from Autobackup;

Shutdown immediate;

You can also set using the Maxseq and Maxdays parameters:

Restore controlfile from Autobackup maxseq maxdays 100;

3, restore the earlier control file backup

Sometimes it may be necessary to restore a control file backup that was established over a period of time, so that the control file is not from the most recent backup (as is often the case with execution resetlogs). Combined with the until time parameter, the restore controlfile from autobackup command enables this operation. Such as:

Restore Controlfile from Autobackup until Time "to_date (' 2010-6-27 13:25:00 ', ' yyyy-mm-dd hh24:mi:ss ')";

If you want to use this command, you need to know which control file backups are available for operation. You can use the list backup of Controlfile command to determine which backup control files can be used for restore operations.

Rman> list Backup of Controlfile;

Backup set list

===================

BS keyword type LV size device type after time completion time

------- ---- -- ---------- ----------- ------------ ----------

113 Full 16.00M sbt_tape 00:00:05 1 August-June-10

BP keywords: 116 status: AVAILABLE compressed: NO mark: tag20100618t085926

Handle: 07lghd6e_1_1 Media:/,07lghd6e_1_1

Included control files: CKP scn:1403939 Ckp Time: 1 August-June-10

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.