For example, enter the following command:
% rman NOCATALOG RMAN> CONNECT TARGET /Set the DBID and start the database instance without mounting the database.
For example, run SET DBID to set the DBID, then run STARTUP NOMOUNT:
SET DBID 1340752057; STARTUP NOMOUNTRMAN fails to find the server parameter file, which has not yet been restored, but starts the instance with a "dummy" file. Sample output follows:
startup failed: ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/net/hostb/oracle/dbs/inittrgta.ora' trying to start the Oracle instance without parameter files ... Oracle instance startedRestore and edit the server parameter file.
Because you enabled the control file autobackup feature when making your backups, the server parameter file is included in the backup. If you are restoring an autobackup that has a nondefault format, then use the SET CONTROLFILE AUTOBACKUP FORMAT command to indicate the format.
Allocate a channel to the media manager, then restore the server parameter file as a client-side parameter file and use the SET command to indicate the location of the autobackup (in this example, the autobackup is in /tmp):
RUN { ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS '...'; SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/tmp/%F'; RESTORE SPFILE TO PFILE ' /oradata/test/inittrgta.ora' FROM AUTOBACKUP; SHUTDOWN ABORT; }Edit the restored initialization parameter file.
Change any location-specific parameters, for example, those ending in _DEST, to reflect the new directory structure. For example, edit the following parameters:
- IFILE - LOG_ARCHIVE_DEST_1 - CONTROL_FILESRestart the instance with the edited initialization parameter file.
For example, enter the following command:
STARTUP FORCE NOMOUNT PFILE=' /oradata/test/inittrgta.ora';Restore the control file from an autobackup and then mount the database.
For example, enter the following command:
RUN { ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS '...'; RESTORE CONTROLFILE FROM AUTOBACKUP; ALTER DATABASE MOUNT; }RMAN restores the control file to whatever locations you specified in the CONTROL_FILES initialization parameter.
Catalog the data file copies that you copied in "Restoring Disk Backups to a New Host", using their new file names or CATALOG START WITH (if you know all the files are in directories with a common prefix easily addressed with a CATALOG START WITH command). For example, run:
CATALOG START WITH '/oracle/oradata/trgt/';If you want to specify files individually, then you can execute a CATALOG command as follows:
CATALOG DATAFILECOPY '/oracle/oradata/trgt/system01.dbf', '/oracle/oradata/trgt/undotbs01.dbf', '/oracle/oradata/trgt/cwmlite01.dbf', '/oracle/oradata/trgt/drsys01.dbf', '/oracle/oradata/trgt/example01.dbf', '/oracle/oradata/trgt/indx01.dbf', '/oracle/oradata/trgt/tools01.dbf', '/oracle/oradata/trgt/users01.dbf';Start a SQL*Plus session on the new database and query the database file names recorded in the control file.
Because the control file is from the trgta database, the recorded file names use the original hosta file names. You can query V$ views to obtain this information. Run the following query in SQL*Plus:
COLUMN NAME FORMAT a60 SPOOL LOG '/tmp/db_filenames.out' SELECT FILE# AS "File/Grp#", NAME FROM V$DATAFILE UNION SELECT GROUP#,MEMBER FROM V$LOGFILE; SPOOL OFF EXITWrite the RMAN restore and recovery s