Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-01 |
|
|
View PDF |
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:
You must run the RECOVER
command after restoring a backup control file, even if no datafiles have been restored.
You must open the database with the RESETLOGS
option after performing either complete or point-in-time recovery with a backup control file.
If the online redo logs are inaccessible, then you must perform incomplete recovery to an SCN before the earliest SCN in the online redo logs. This limitation is necessary because RMAN does not back up online logs.
During recovery, RMAN automatically searches for online and archived redo logs that are not recorded in the RMAN repository, and catalogs any that it finds so that it can use them in recovery.
RMAN attempts to find a valid archived log in any of the current archiving destinations with the current log format. The current format is specified in the initialization parameter file used to start the instance (or all instances in a Real Application Clusters installation). Similarly, RMAN attempts to find the online redo logs by using the filenames as specified in the control file.
If you changed the archiving destination or format during recovery, or if you added new online log members after the backup of the control file, then RMAN may not be able to automatically catalog a needed online or archived log. In this situation, RMAN reports errors similar to the following:
RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 08/29/2001 14:23:09 RMAN-06054: media recovery requesting unknown log: thread 1 scn 86945
In this case, you must use the CATALOG
command to manually add the required logs to the repository so that recovery can proceed. The cataloging procedure is described in Oracle Database Backup and Recovery Basics.
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 theRESTORE 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:
Start RMAN and connect to the target database. For example, run:
CONNECT TARGET /
Start the target instance without mounting the database. For example:
STARTUP NOMOUNT;
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;
Restore the autobackup control file, then perform recovery. Do the following:
Optionally, specify the most recent backup time stamp that RMAN can use when searching for a control file autobackup to restore.
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.
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.
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.
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.
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
If recovery was successful, then open the database and reset the online logs:
ALTER DATABASE OPEN RESETLOGS;