Latest Updates

Post Top Ad

18 June, 2013

Performing Recovery with a Backup Control File and No Recovery Catalog

This section assumes that you have RMAN backups of the control file, but do not use a recovery catalog. It also assumes that you enabled the control file autobackup feature for the target database and can restore an autobackup of the control file.
Because the autobackup uses a well-known 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 that contains the control file (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 database 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, then add them to the control file RMAN repository with the CATALOG command.
To recover the database with a control file autobackup in NOCATALOG mode:
Start RMAN and connect to a target database.
Start the target database 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 a target database. You can also obtain it by inspecting saved RMAN log files, querying the catalog, or looking at the filenames of control file autobackup. For example, run:
SET DBID 676549873;
Write an RMAN command file to restore the autobackup control file and perform recovery.
The command file should contain the following steps:
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 an SBT channel created the control file autobackup, then allocate one or more SBT channels. Because no recovery catalog 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 and the initial sequence number that it should use in its search for the first day.
If you know that the control file contained information about configured channels that will be useful to you in the rest of the restore process, then you can exit RMAN to clear manually allocated channels from step c.
If you restart the RMAN client and mount the database, then these configured channels are available for your use. If you do not care about using configured channels from your control file, then you can simply mount the database.
This step depends on whether the online redo logs are available. Note that OPEN RESETLOGS is always required after recovery with a backup control file, regardless of whether logs are available.
If the online redo logs are usable, then RMAN can find and apply these logs. Perform a complete restore and recovery as described in "Performing Complete Database Recovery".
If the online redo logs are unusable, then perform DBPITR as described in "Performing Database Point-in-Time Recovery". An UNTIL clause is required to specify a target time, SCN or log sequence number for the recovery prior to the first SCN of the online redo logs (otherwise, RMAN issues the RMAN-6054 error).
Note:
When specifying log sequences, if the last created archived redo log has sequence n, then specify UNTIL SEQUENCE n+1 so that RMAN will apply n and then stop.
In the following example, the online redo log files have been lost, and the most recent archived redo log sequence number is 13243. This example shows how to restore the control file autobackup and recover through the latest log.

RUN 
{
  # Optionally, set upper limit for eligible time stamps of control file 
  # backups
  # SET UNTIL TIME '09/10/2007 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;
}
# Now use automatic channels configured in restored control file
RESTORE DATABASE UNTIL SEQUENCE 13244;
RECOVER DATABASE UNTIL SEQUENCE 13244;
If recovery was successful, then open the database and reset the online logs:
ALTER DATABASE OPEN RESETLOGS;

No comments:

Post Top Ad

Your Ad Spot

Pages