Tuesday 5 October 2010

Oracle Apps R12 cloning from 2 node RAC ASM to single instance(non-RAC) normal file system


E-Business Suite Cloning
 Red Hat Linux,Oracle Ebusiness suite R12, Oracle RDBMS 10gR2
Application Type: Oracle E-business Application
Target readers: Oracle Apps DBA
 References :

Oracle Metalink ID 406982.1
oracle documentation library (Backup and Recovery Advanced User’s Guide 10g Release 2 (10.2) B14191-01)

              Contents:
ü        Cloning process which includes Creating  a duplicate database using RMAN
ü        Errors occurred during the cloning process and the things to be taken care to avoid issues after cloning process is completed
Cloning process:
The cloning process consists of three phases
  • Prepare the source system
  • Copy the source system to the target system
  • Configure the target system
o        Creating  a duplicate database using RMAN

·        Prepare the source system :
o        Prepare the source system database tier for cloning
Log on to the source system as the ORACLE user, and run the following commands:
$ cd /u01/oraprod/PRODERP/oracle/product/10.2.0/db_1/appsutil/scripts/ PRODERP_samp/
$ perl adpreclone.pl dbTier
o        Prepare the source system application tier for cloning
Log on to the source system as the APPLMGR user, and run the following commands on each node that contains an APPL_TOP:
$ cd /u03/applprod/PRODERP/inst/apps/PRODERP_samp/admin/scripts
$ perl adpreclone.pl appsTier
·        Copy the source system to the target system :
o        nohup tar -czvf apps.tar.zip apps &  (Execute this step as applmgr to copy the apps tier file system)
o        scp apps.tar.zip applmgr@198.111.111.111:/u03

o        nohup tar -czvf oraprod.tar.gz PRODERP &
o        scp oraprod.tar.gz oramgr@198.111.111.111:/u03

·        Configure the target system :
o        Configure the target system database server
§        Log on to the target system as the ORACLE user
§        cd [RDBMS ORACLE_HOME]/appsutil/clone/bin
$ perl adcfgclone.pl dbTechStack
§        Create the target database control files manually and Start the target database in open mode : We have done this using RMAN DUPLICATE command which is described in detail in next sectionCreating  a duplicate database using RMAN
§        Run the library update script against the database
$ cd [RDBMS ORACLE_HOME]/appsutil/install/ src_host1/
$ sqlplus "/ as sysdba" @adupdlib.sql so
§        Configure the target database
The database must be running and open before performing this step.
$ cd [RDBMS ORACLE_HOME]/appsutil/clone/bin
$ perl adcfgclone.pl dbconfig /u03/PRODERP/oracle/product/10.2.0/db_1/appsutil/src_host1.xml
When executing this step make sure you reply with ‘n’ for te following to change the database from RAC to single instance database.
Target Instance is RAC (y/n) [y] : n
o        Configure the target system application tier server nodes
§        Log on to the target system as the APPLMGR user and enter the following commands:
$ cd [COMMON_TOP]/clone/bin
$ perl adcfgclone.pl appsTier


Cloning process is completed with this step.
You may need to execute Post cloning steps like data scrambling, profile options etc as per you project requirements.




Creating a duplicate database using RMAN:
Preparing the Auxiliary Instance for Duplication: Basic Steps:
o        Task 1: Create an Oracle Password File for the Auxiliary Instance
§        Set remote_login_passwordfile= EXCLUSIVE
§        orapwd FILE=acct.pwd PASSWORD=secret ENTRIES=30

o        Task 2: Ensure Oracle Net Connectivity to the Auxiliary Instance
§        Start SQL*Plus to ensure that you can establish a connection to the auxiliary instance. Note that you must connect to the auxiliary instance with SYSDBA privileges, so a password file must exist.
·        sqlplus sys/secret@crp1 as sysdba

o        Task 3: Create an Initialization Parameter File for the Auxiliary Instance
Create a client-side initialization parameter file for the auxiliary instance. The
§        parameters listed below must be set to the values specified:
·        DB_NAME=CRP1
·        CONTROL_FILES
·        DB_BLOCK_SIZE=8192 (should be same as target database PRODERP)
·        cluster_database=FALSE (To change the database from RAC to non-RAC)
·        _no_recovery_through_resetlogs=TRUE
(This parameter is set to TRUE as we got an error during cloning process. Refer to last section for the error details)
o        Task 4: Start the Auxiliary Instance
STARTUP FORCE NOMOUNT
o        Task 5: Mount or Open the Target Database
STARTUP MOUNT;
o        Task 6: Make Sure You Have the Necessary Backups and Archived Redo Logs
$ RMAN target /
CONFIGURE RETENTION POLICY TO REDUNDANCY 30;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
/data1/backup/PRODERP_bkpBKUP240610/%d_%F_ctl.bkup’;
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   ' /data1/backup/PRODERP_bkpBKUP240610/backup_%U';
CONFIGURE MAXSETSIZE TO 3 G;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/data1/backup/PRODERP_bkpBKUP240610/snapcf_UAT.f';
run
{              BACKUP DATABASE PLUS ARCHIVELOG;}
o        Task 7: Allocate Auxiliary Channels if Automatic Channels Are Not Configured
rman target sys/***@proderp1 AUXILIARY sys/secret
run
{
PFILE = /u03/PRODERP/oracle/product/10.2.0/db_1/dbs/initsrc.ora
DB_FILE_NAME_CONVERT=('+PRODERP_DATA/proderp/datafile','/u03/srcdata/')
DUPLICATE TARGET DATABASE TO src
LOGFILE
GROUP1
('/u03/srcdata/redo01.log';) SIZE 200M,
GROUP2
('/u03/srcdata/redo02.log';) SIZE 200M,
GROUP3
('/u03/srcdata/redo03.log';) SIZE 200M;
}


Errors occurred during the cloning process and the things to be taken care to avoid issues after cloning process is completed:

ü        RMAN duplicate using a backup taken from a RAC installation fails on opening the clone instance with
RMAN-06136: ORACLE error from auxiliary database.

Resolution: Set the following parameter in the auxiliary init.ora file:
_no_recovery_through_resetlogs=TRUE

Reference: Metalink Doc ID 334899.1

ü        Better to copy the target server parameter file to auxiliary instance server and Review all initialization parameters that end in _DEST and specify a path name. Some may need to be changed. If you create a new parameter file with default values, many parameters need to be changed once the duplicate instance is started as default values will not suffice in many cases

ü        To convert archive logs from ASM to normal file system storage(if needed), use the command:
convert archivelog '+PRODERP_RSC/proderp/archivelog/2010_06_25/thread_1_seq_38.278.722591117' to '/home/oraprod'

ü        If any archive logs are missed during backup of rman, use the following command to copy the archive log files using log sequence:
Examples:
backup as copy archivelog from logseq=39 until logseq=39 format '/data1/archivelog/%t%r%s%p';
backup as copy archivelog from logseq=43 until logseq=43 thread=2 format '/data1/archivelog/%t%r%s%p';
backup as copy archivelog from logseq=44 until logseq=44 thread=2 format '/data1/archivelog/%t%r%s%p';




I might have missed some steps. Please point out any missed/ which needs to be modified.