###########CREATE FLAG FILE ########
--pidname=oracle
--pidnum=1002
--bindir=/usr/local/avamar/bin
--vardir=/usr/local/avamar/var
--sysdir=/usr/local/avamar/etc
--id=Farhat
--ap=mypassword
--path=/DOMAIN_Servers/PROD_DB/drfrsdb-scan (This should be source database details in data domain)
--expires=60
--ddr
--ddr-index=1
###########BACKUP############
run {
set dbid=351264473;
allocate channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
send '"--prefix=11g/PROD/" "--flagfile=/u03/erp/temp/flagfile.txt" "--bindir=/usr/local/avamar/bin"';
backup as compressed backupset database;
}
########## RESTORE #######
run {
set dbid=351264473;
allocate channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
send '"--prefix=11g/PROD/" "--flagfile=/u03/erp/temp/flagfile.txt" "--bindir=/usr/local/avamar/bin"';
restore controlfile from 'CONTROLFILE.PROD.c-351264473-20170412-00';
}
###########RESTORE DATABSE TO NEW LOCATION / SERVER#####
run {
allocate channel c1 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c2 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c3 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c4 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c5 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c6 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c7 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c8 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c9 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
allocate channel c10 type sbt PARMS="SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so" format '%d_%U';
send '"--prefix=11g/PROD/" "--flagfile=/u03/erp/temp/flagfile.txt" "--bindir=/usr/local/avamar/bin"';
SET NEWNAME FOR DATABASE TO '/u03/erp/test/db/apps_st/data/PROD/datafile/%b';
restore database;
switch datafile all;
recover database;
}
Creating Duplicate database
Set up your environment (see 1st reply), execute RMAN, connecting to target (TEST), aux (NEW) and catalog:
# rman target sys/SYS_PASSWORD@TEMP auxiliary / catalog CAT_USER/CAT_PASSWORD@CATALOG
DUPLICATE the backed up TEMP instance to NEW, renaming the files/paths (ASM in this example) appropriately. ----------------START RMAN DUPLICATE SCRIPT---------------- RUN {ALLOCATE auxiliary channel x1 type sbt_tape PARMS 'SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)'SEND '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/x1_NEW_avoracle.log" "--bindir=/usr/local/avamar/bin"';ALLOCATE auxiliary channel x2 type sbt_tape PARMS 'SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)'SEND '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/x2_NEW_avoracle.log" "--bindir=/usr/local/avamar/bin"'; DUPLICATE TARGET DATABASE TO NEW db_file_name_convert=('+ASMDISKGROUP/TEMP','+ASMDISKGROUP/NEW')logfile group 1 ('+ASMDISKGROUP') size 1g, group 2 ('+ASMDISKGROUP') size 1g, group 3 ('+ASMDISKGROUP') size 1g, group 4 ('+ASMDISKGROUP') size 1g;}
DUPLICATE the backed up TEMP instance to NEW, renaming the files/paths (ASM in this example) appropriately. ----------------START RMAN DUPLICATE SCRIPT---------------- RUN {ALLOCATE auxiliary channel x1 type sbt_tape PARMS 'SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)'SEND '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/x1_NEW_avoracle.log" "--bindir=/usr/local/avamar/bin"';ALLOCATE auxiliary channel x2 type sbt_tape PARMS 'SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so ENV=(PATH=/bin:/usr/local/avamar/bin)'SEND '"--flagfile=/usr/local/avamar/etc/avtar-flags.txt" "--logfile=/var/avamar/x2_NEW_avoracle.log" "--bindir=/usr/local/avamar/bin"'; DUPLICATE TARGET DATABASE TO NEW db_file_name_convert=('+ASMDISKGROUP/TEMP','+ASMDISKGROUP/NEW')logfile group 1 ('+ASMDISKGROUP') size 1g, group 2 ('+ASMDISKGROUP') size 1g, group 3 ('+ASMDISKGROUP') size 1g, group 4 ('+ASMDISKGROUP') size 1g;}
No comments:
Post a Comment