Databases Reference
In-Depth Information
Now, type in YES (if everything looks okay). You should be able to use the RMAN list backup command now to
view the newly cataloged backup pieces:
RMAN> list backup;
Step 11: Rename and Restore the Data Files to Reflect New Directory Locations
If your destination server has the exact same directory structure as the original server directories, you can issue the
restore command directly:
RMAN> restore database;
However, when restoring data files to locations that are different from the original directories, you'll have to use
the set newname command. Create a file that uses an RMAN run{} block that contains the appropriate set newname
and restore commands. We like to use a SQL script that generates SQL to give a starting point. Here is a sample
script:
set head off feed off verify off echo off pages 0 trimspool on
set lines 132 pagesize 0
spo newname.sql
--
select 'run{' from dual;
--
select
'set newname for datafile ' || file# || ' to ' || '''' || name || '''' || ';'
from v$datafile;
--
select
'restore database;' || chr(10) ||
'switch datafile all;' || chr(10) ||
'}'
from dual;
--
spo off;
After you run the script, the newname.sql script that was generated contains the following:
run{
set newname for datafile 1 to '/u01/dbfile/o12c/system01.dbf';
set newname for datafile 2 to '/u01/dbfile/o12c/sysaux01.dbf';
set newname for datafile 3 to '/u01/dbfile/o12c/undotbs01.dbf';
set newname for datafile 4 to '/u01/dbfile/o12c/users01.dbf';
restore database;
switch datafile all;
}
 
Search WWH ::




Custom Search