Wednesday, July 3, 2013

Oracle EBS R12 Hot Cloning with RMAN



Oracle EBS R12 Hot Cloning with RMAN
Hello Friends,
Today I will disuss about clonning
1.       Pre pare source system
Run adpreclone on respective nodes
2.       Backup Oracle Databae with RMAN
3.       Create Table  this table will hold date & Time Information for clone verification
CREATE TABLE rman_clone (clonedate TIMESTAMP WITH LOCAL TIME ZONE);
4.       Switch Archive  log file
########## Archive Current Redo Log File  ###########
#!/bin/sh
#Before Inserting date & time stepms information to rman_clone table
#truncate it
#
rm -rf /d01/prod/arch/message*.*
#rm -rf /d01/prod/arch/arch_time*.*
LOG_FILE=/data/prod/arch/message.`date +%d%m%y`
echo "Archiving current log file of Oracle DB `date +%H-%M-%S`" >> $LOG_FILE
sqlplus -s "system/manager as sysdba" <<-eof p="">
        SELECT TO_CHAR( systimestamp ,'DD-MM-YYYY HH24:MI:SS') "Date" FROM dual;
        truncate table rman_clone;
        insert into rman_clone (clonedate) values (CURRENT_TIMESTAMP);
        alter system switch logfile ;
        exit;
        EOF
echo "Finished Archive of Oracle DATA" >> $LOG_FILE
5.       Run the above script
/d01/arch_after.sh >> /d01/prod/arch/arch_time.`date +%d%m%y`
Above script will create arch_time.`date +%d%m%y  file which later can be used for RMAN Hot Cloning.
6.       Copy The following folder to target instance  & Change permission accordingly
inst
apps
db/tech_st
RMAN HOT Backup & Archive log
7.       Change  init.ora parameter on Target
db_file_name_convert             = ('/d01 /prod/db/apps_st/data','/d01/test/db/apps_st/data')
log_file_name_convert            = ('/d01/prod/db/apps_st/data','/d01/test/db/apps_st/data')
                Add PRODUCTION TNS Entry to the respective target instance
8.       Shut down Target EBS (Application & Database)
9.       Start Target Database in nomount mode
#!/bin/sh
clear
sqlplus sys/oracle as sysdba <
shutdown immediate
startup nomount;
exit;
END
10.   Run the following script as Oracle User
#!/bin/sh
cd /d01/prod/arch
fname=`ls -ltr |grep arch |awk '{print $9}'`
ndt=`cat /data/prod/arch/$fname |head -4 | tail -1`
#above command will collect date and time value from file generated in step 4 and will assign
#it to ndt variable 
echo "File Name is $fname"
echo "Date time is $ndt"
rm -rf /txis/HOT_CLONE.log
LOGFILE=/txis/HOT_CLONE.log
echo `date "+%Y%m%d"` >> $LOGFILE
rman <> $LOGFILE
CONNECT TARGET sys/oracle@prod;
CONNECT AUXILIARY sys/oracle;
RUN{
set until time "to_date('$ndt','DD-MM-YYYY HH24:MI:SS')";
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL aux3 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE TO TEST1
pfile='/txis/initTEST.ora';
}
EXIT;
EOF  
11.   Add Temporary File
#!/bin/sh
clear
sqlplus sys/oracle as sysdba <
create temporary tablespace temp03 tempfile '/d01/test/db/apps_st/data/temp03.dbf' size 2100M reuse autoextend on;
alter database default temporary tablespace temp03;
exit;
END
12.   Run adcfgclone.pl on database tier
I have taken backup of XML file to /d01/test/dbxml/
adcfgclone.pl dbTier /d01/test/dbxml/TEST_test.xml
13.   Run adcfgclone.pl on application tier
adcfgclone.pl appsTier /d01/test/appsxml/TEST_test.xml
14.   Change profile level values accordingly (Like site_name) and all
Cheers

No comments:

Post a Comment