Script for the RMAN Duplicate, which calls an input file, detailed below -->
#!/bin/ksh
BACKUP_DIR=/home/oracle;export BACKUP_DIR
NB_ORA_CLASS=CL_PRODDB_s1;export NB_ORA_CLASS
NB_ORA_SCHED=SCH_PRODDB;export NB_ORA_SCHED
NB_ORA_SERV=vtnthnbkup-bkp;export NB_ORA_SERV
<lots of Oracle params snipped for brevity>
export NSR_CLIENT=vtnthe450
export NSR_SERVER=vtnthnbkup-bkp
/u01/app/oracle/product/8.1.7/bin/rman catalog=username/password@ANGELINA.JOLIE.WORLD target=username/password@NATASHA.HENSTRIDGE.WORLD auxiliary=username/password@JENNIFER.LOVE.HEWITT.WORLD log=/home/oracle/duplicate_train.log cmdfile=/home/oracle/duplicate_train.rcv
Input RCV file (/home/oracle/duplicate_train.rcv) -->
run {
allocate auxiliary channel aux1 type 'sbt_tape' PARMS 'ENV=(NB_ORA_SERV=vtnthnbkup, NB_ORA_CLIENT=vtnthsun01)';
allocate auxiliary channel aux2 type 'sbt_tape' PARMS 'ENV=(NB_ORA_SERV=vtnthnbkup, NB_ORA_CLIENT=vtnthsun01)';
allocate auxiliary channel aux3 type 'sbt_tape' PARMS 'ENV=(NB_ORA_SERV=vtnthnbkup, NB_ORA_CLIENT=vtnthsun01)';
set newname for datafile 1 to '/u02/oradata/TRAIN/systemTRAIN01.dbf';
<blah blah remove other lines for brevity>
set newname for datafile 47 to '/u05/oradata/TRAIN/vartec_austrianTRAIN01.dbf';
duplicate target database to 'TRAIN'
logfile GROUP 1 ('/u02/oradata/TRAIN/redoTRAIN01a.log','/u04/oradata/TRAIN/redoTRAIN01b.log') SIZE 500M,
GROUP 2 ('/u03/oradata/TRAIN/redoTRAIN02a.log','/u02/oradata/TRAIN/redoTRAIN02b.log') SIZE 500M,
GROUP 3 ('/u04/oradata/TRAIN/redoTRAIN03a.log','/u03/oradata/TRAIN/redoTRAIN03b.log') SIZE 500M,
GROUP 4 ('/u06/oradata/TRAIN/redoTRAIN04a.log','/u07/oradata/TRAIN/redoTRAIN04b.log') SIZE 500M;
release channel aux1;
release channel aux2;
release channel aux3;
}
In the rcv file -->
'NB_ORA_CLIENT' is where the ORIGINAL data came from, ie the source database.
'NSR_SERVER' is the backup server.
'NSR_CLIENT' is the server where data is going TO.