Skip Headers
Oracle® Database Backup and Recovery Advanced User's Guide
10g Release 2 (10.2)

Part Number B14191-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Performing Recovery with a Backup Control File

If all copies of the current control file are lost or damaged, then you must restore and mount a backup control file before you can perform recovery. When using a backup control file, and using a recovery catalog, the process is identical to recovery with a current control file, as the RMAN repository information missing from the backup control file is available from the recovery catalog. There are special considerations when using a backup controlfile and not using a recovery catalog.

The following notes and restrictions apply regardless of whether you use a recovery catalog:

Performing Recovery with a Backup Control File and No Recovery Catalog: Scenario

This section assumes that you have RMAN backups of the control file, but do not use a recovery catalog.

Assuming that you enabled the control file autobackup feature for the target database, you can restore an autobackup of the control file. Because the autobackup uses a default format, RMAN can restore it even though it does not have a repository available that lists the available backups. You can restore the autobackup to the default or a new location. RMAN replicates the control file to all CONTROL_FILES locations automatically.

Note:

If you know the backup piece name (for example, from the media manager or because the piece is on disk), then you can specify the piece name using the RESTORE CONTROLFILE FROM 'filename' command. The server records the location of every autobackup in the alert log.

Because you are not connected to a recovery catalog, the RMAN repository contains only information about available backups at the time of the control file backup. If you know the location of other usable backup sets or image copies, add them to the control file RMAN repository with the CATALOG command.

Because the repository is not available when you restore the control file, you must use the SET DBID command to identify the target database. The DBID is used to determine the location of control file autobackups. Use SET DBID command only in the following special circumstances:

  • You are not connected to a recovery catalog and want to restore the control file or server parameter file.

  • You are connected to a recovery catalog and want to restore the control file, but the database name is not unique in the recovery catalog.

  • The server parameter file is lost and you want to restore it.

To recover the database with an autobackup of the control file without a recovery catalog:

  1. Start RMAN and connect to the target database. For example, run:

    CONNECT TARGET /
    
    
  2. Start the target instance without mounting the database. For example:

    STARTUP NOMOUNT;
    
    
  3. Set the database identifier for the target database with SET DBID. RMAN displays the DBID whenever you connect to the target. You can also obtain it by inspecting saved RMAN log files, querying the catalog, or looking at the filenames of control file autobackup. (refer to "Restoring Control File When Databases in the Catalog Have the Same Name: Example"). For example, run:

    SET DBID 676549873;
    
    
  4. Restore the autobackup control file, then perform recovery. Do the following:

    1. Optionally, specify the most recent backup time stamp that RMAN can use when searching for a control file autobackup to restore.

    2. If you know that a different control file autobackup format was in effect when the control file autobackup was created, then specify a nondefault format for the restore of the control file.

    3. If the channel that created the control file autobackup was device type sbt, then you must allocate one or more sbt channels. Because no repository is available, you cannot use preconfigured channels.

    4. Restore the autobackup of the control file, optionally setting the maximum number of days backward that RMAN can search (up to 366) and the initial sequence number that it should use in its search for the first day.

    5. If you know that your control file contained information about configured channels that will be useful to you in the rest of the restore process, you can exit the RMAN client at this point, to clear manually allocated channels from step "c". If you then restart the RMAN client and mount the database those configured channels become available for your use in the rest of the restore and recovery process.

      If you do not care about using configured channels from your control file, then you can simply mount the database at this point.

    6. If the online logs are usable, then perform a complete restore and recovery as described in Oracle Database Backup and Recovery Basics.

      Otherwise, restore and perform incomplete recovery of the database, as described in Oracle Database Backup and Recovery Basics Use an UNTIL clause to specify a target time , SCN or log sequence number for the recovery prior to the first SCN of the online redo logs.

    In this example, the online redo logs have been lost, and the most recent archived log sequence number is 13243. This example shows how to restore the control file autobackup, then performs recovery of the database to log sequence 13243.

    RUN 
    {
      # Optionally, set upper limit for eligible time stamps of control file 
      # backups
      # SET UNTIL TIME '09/10/2000 13:45:00';
      # Specify a nondefault autobackup format only if required
      # SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK 
      #   TO '?/oradata/%F.bck';
      ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='...'; # allocate manually
      RESTORE CONTROLFILE FROM AUTOBACKUP
        MAXSEQ 100           # start at sequence 100 and count down
        MAXDAYS 180;         # start at UNTIL TIME and search back 6 months
      ALTER DATABASE MOUNT DATABASE;
    }
    # uses automatic channels configured in restored control file
    RESTORE DATABASE UNTIL SEQUENCE 13243;
    RECOVER DATABASE UNTIL SEQUENCE 13243; # recovers to latest archived log
    
    
  5. If recovery was successful, then open the database and reset the online logs:

    ALTER DATABASE OPEN RESETLOGS;