Rman使用catalog start with恢复
RMAN> startup nomount;
RMAN> restore controlfile from '/data01/testdb_CF_c-3148051840-20110813-00'; # 从控制文件备份集恢复控制文件
RMAN> alter database mount;
catalog start with '/data01/'; (一定要用“/”结尾,不然找不到真实的路径)
allocate channel c2 type disk;
allocate channel c3 type disk;
run{
allocate channel c1 type disk;
set newname for datafile '/oracle/wk/data/wk001/system01.dbf' to '/oradata/wk001/system01.dbf';
set newname for datafile '/oracle/wk/data/wk001/sysaux01.dbf' to '/oradata/wk001/sysaux01.dbf';
set newname for datafile '/oracle/wk/data/wk002/undotbs01.dbf' to '/oradata/wk002/undotbs01.dbf';
set newname for datafile '/oracle/wk/data/wk002/ppdbptcindex01.dbf' to '/oradata/wk002/ppdbptcindex01.dbf';
set newname for datafile '/oracle/wk/data/wk001/ppdbptcdata01.dbf' to '/oradata/wk001/ppdbptcdata01.dbf';
set newname for datafile '/oracle/wk/data/wk002/PP_DATA_1M01.dbf' to '/oradata/wk002/PP_DATA_1M01.dbf';
set newname for datafile '/oracle/wk/data/wk002/pp_data_10m01.dbf' to '/oradata/wk002/pp_data_10m01.dbf';
set newname for datafile '/oracle/wk/data/wk002/pp_data_10m02.dbf' to '/oradata/wk002/pp_data_10m02.dbf';
set newname for datafile '/oracle/wk/data/wk001/pp_index_1m01.dbf' to '/oradata/wk001/pp_index_1m01.dbf';
set newname for datafile '/oracle/wk/data/wk001/pp_index_10m01.dbf' to '/oradata/wk001/pp_index_10m01.dbf';
set newname for datafile '/oracle/wk/data/wk002/pp_data_128k01.dbf' to '/oradata/wk002/pp_data_128k01.dbf';
set newname for datafile '/oracle/wk/data/wk001/pp_index_128k01.dbf' to '/oradata/wk001/pp_index_128k01.dbf';
set newname for datafile '/oracle/wk/data/wk002/aq_data01.dbf' to '/oradata/wk002/aq_data01.dbf';
set newname for tempfile '/oracle/wk/data/wk001/temp01.dbf' to '/oradata/wk001/temp01.dbf';
logfile
group 1 ('/oradata/wk001/redo01a.dbf','/oradata/wk002/redo01b.dbf') size 50m,
group 2 ('/oradata/wk001/redo02a.dbf','/oradata/wk002/redo02b.dbf') size 50m,
group 3 ('/oradata/wk001/redo03a.dbf','/oradata/wk002/redo03b.dbf') size 50m;
restore database force;
switch datafile all;
}