Oracle Database migration to a remote Data Protector cell--Best practices

35
Appendix C: Sample RMAN script to duplicate the Database
In this case, we assume the backup contains a Control File autobackup and we are using a
Recovery Catalog:
Set the DBID of your database
Set the until clause (either time or sequence)
rman catalog rman/xxx@RCVCAT << EOF
set dbid = 38758237 ;
connect target / ;
startup nomount force;
run {
allocate channel dev_0 type sbt_tape;
restore spfile from autobackup;
release channel dev_0;
}
startup nomount force;
run {
allocate channel dev_0 type sbt_tape;
restore controlfile from autobackup;
}
startup mount;
run {
allocate channel dev_0 type sbt_tape;
allocate channel dev_1 type sbt_tape;
# choose one of the following:
# set until time "to_date( '19-03-2008 16:00:00', 'DD-MM-RRRR HH24:MI:SS')";
# set until sequence 6 ;
restore database;
recover database;
alter database open resetlogs;
}
EOF