Script to setup RMAN active duplicate

Script to setup RMAN active duplicate

#In Production

running from primary DB server

ORCLPROD ==> Prod Database name
ORCLNP ==> Nonprod database name

mkdir -p /tmp/DUP
cd /tmp/DUP


vi rman-Active-Duplicate.sh

############################################# Start of script ###########################
export ORACLE_SID=ORCLPROD

export ORACLE_HOME=/u00/app/oracle/product/19.0.0/dbhome_1

export PATH=$PATH:$ORACLE_HOME/bin

/u00/app/oracle/product/19.0.0/dbhome_1/bin/rman << EOF

connect target /

connect target sys/*********@ORCLPROD

connect auxiliary sys/**********@ORCLNP

spool log to ‘/tmp/DUP/ORCLPROD_NonProd.log’

show all;

run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
allocate channel ch4 device type disk;
allocate channel ch5 device type disk;
allocate channel ch6 device type disk;
allocate channel ch7 device type disk;
allocate channel ch8 device type disk;
allocate channel ch9 device type disk;
allocate channel ch10 device type disk;
allocate auxiliary channel st1 type disk;
allocate auxiliary channel st2 type disk;
allocate auxiliary channel st3 type disk;
allocate auxiliary channel st4 type disk;
allocate auxiliary channel st5 type disk;
DUPLICATE TARGET DATABASE TO ‘ORCLNP’ FROM ACTIVE DATABASE NOFILENAMECHECK;
}

EOF
exit
##################### End of Script ##################################


How to run the script?
$nohup ./rman-Active-Duplicate.sh &

 

See Also: