Friday, November 1, 2024

Rman duplicate script

 [oracle@hostvm01 ORAQA]$ cat ORAQA_dup.sh
#!/bin/ksh
export ORACLE_SID=ORAQA1
export ORACLE_HOME=/u02/app/oracle/product/12.1.0/dbhome_3
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
rman log "rman_dup_ORAQA_20210807.log" <<EOF 
connect target "dbadmin/Use_1t_wisely@oraprd" 
connect auxiliary "dbadmin/Use_1t_wisely@ORAQAr"
run
{
allocate channel c1 device type disk; 
allocate channel c2 device type disk; 
:
:
allocate channel c16 device type disk;
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK; 
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK; 
:
:
ALLOCATE AUXILIARY CHANNEL aux15 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux16 DEVICE TYPE DISK;
 set newname for datafile 1 to "+DATAC1/ORAQA/datafile/system1.dbf"; 
 set newname for datafile 2 to "+DATAC1/ORAQA/datafile/sysaux1_dbf";
 :
 :
 set newname for datafile 1676 to "+DATAC1/ORAQA/datafile/orastg_data136_dbf";
 set newname for datafile 1677 to "+DATAC1/ORAQA/datafile/orastg_data137_dbf"; 
 set newname for tempfile 1 to "+RECOC1/ORAQA/tempfile/temp_1.dbf"; 
 set newname for tempfile 2 to "+RECOC1/ORAQA/tempfile/temp_2.dbf";
 :
 set newname for tempfile 61 to "+RECOC1/ORAQA/tempfile/temp3_34.dbf";
 set newname for tempfile 62 to "+RECOC1/ORAQA/tempfile/temp3_35.dbf";
 duplicate target database to ORAQA from active database nofilenamecheck;
}
EOF

No comments:

Post a Comment

Questions

  Skip to content ChatGPT Log in You said: I need to take interview of 14 year experienced Oracle RAC database administrator, can you please...