Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Cloning EBS R12

A Step By Step Detailing


By Orazer Technologies
www.orazer.com
Cloning oracle ebusiness suite R12 using hot backup.
Source : PROD
Target : TEST

Pre-Tasks:
• Bring down taget system’s services.

•Backup parameter file, CONTEXT_FILEs of both application and database.

•Remove Application files(apps_st, tech_st and INST_TOP) of target


system
•Unregister db from RMAN catalog if registered and drop the database.

•Verify space on the database node and applications node.

•On source, run adpreclone.pl ( if not executed recently)


$ cd $INST_TOP/admin/scripts
$ perl adpreclone.pl appsTier
www.orazer.com 2
Copying files:
On DB Node
Copy the latest DB backups from source to target (Including
archivelog backup and controlfile backup)
e.g.:
$ cd /backup/PROD/
$ scp * oratest@dmdev01:/backup/clone/PROD/
On Apps Node

Copy apps_st and tech_st from source application node to


target application node.
e.g.:
$ cd /u01/oracle/PROD
$ tar –cvf – apps_st | gzip | ssh –l appltest dmdev02 “( cd
/u01/oracle/TEST/apps && gunzip | tar –xvf – )”
www.orazer.com 3
Steps to Clone Database
1. Change the db_name parameter in pfile that is backed up (eg: TEST to
PROD)

2. Start the target db using modified pfile


Sql > startup nomount pfile=’/backup/clone/initTEST.ora’

3. Restore the controlfile from the backup of PROD


RMAN> restore controlfile from ‘/backup/clone/PROD/PROD.ctl’

4. Mount the database


Sql> alter database mount

5. Once db is mounted catalog the backups copied from source.


RMAN > catalog start with ‘/backup/clone/PROD/’;

www.orazer.com 4
6. Once the backups are cataloged we can restore the database usig the
PROD’s backup. But the database files are pointing to PROD’s location so it
will try to restore the datafiles to PROD’s location which may not exist in
target.
Ex: /u01/oracle/PROD/data/system01.dbf

Hence we will have to rename the datafiles to point to new(TEST) location


before restoring. We can rename the files or use SET NEWNAME in RMAN
before restoring.
Ex: set newname for datafile 1 to ‘/u01/oracle/TEST/system.dbf’;

Note : Below script can be used to create the script for “SET NEWNAME”.
Change the path of target datafile location and run the script in source.

select ‘set newname for datafile ‘ || file_id || ‘ to ”/u01/oracle/TEST/’ ||


substr(file_name,instr(file_name,’/’,-1)+1) || ”’;’
from dba_data_files;

www.orazer.com 5
7. Restore and recover the database
Ex:
Rman>run {
set until time “to_date(’16/07/2015 23:20:00′,’dd/mm/yyyy hh24:mi:ss’)”;
set newname for datafile 1 to ‘/u01/oracle/TEST/system.dbf’;
set newname for datafile 44 to ‘/u01/oracle/TEST/apps_ts_tx_data_01.dbf’;
set newname for datafile 76 to ‘/u01/oracle/TEST/apps_ts_tx_idx01.dbf’;
set newname for datafile 35 to ‘/u01/oracle/TEST/sysaux_01.dbf’;
set newname for datafile 37 to ‘/u01/oracle/TEST/undotbs1_01.dbf’;
allocate channel ch1 type disk;
allocate channel ch2 type disk;
restore database;
switch datafile all;
recover database;
release channel ch1;
release channel ch2;
}

After the database is restored and recovered then open the database using
resetlogs.
SQL> alter database open resetlogs;www.orazer.com 6
Post Steps:

1. Recreate ALL the temp tablespaces. If not done then DB will not be
opened after renaming.
Sql> select tablespace_name from dba_tablespaces where
tablespace_name like ‘%TEMP%’;
TEMP
TEMP1
Create a new temp tablespace
create TEMPORARY TABLESPACE temp2 tempfile
‘/u01/oracle/TEST/temp2.dbf’ size 2048M;

2. Make the newly created temp tablespace as DEFAULT


ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

3. Drop the old temp tablespaces


DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE temp1 INCLUDING CONTENTS AND DATAFILES;
www.orazer.com 7
4. Recreate the dropped temps
create TEMPORARY TABLESPACE temp tempfile
‘/u01/oracle/TEST/temp.dbf’ size 20G;
create TEMPORARY TABLESPACE temp1 tempfile
‘/u01/oracle/TEST/temp1.dbf’ size 2048M;

5. Change the default temp again to old


ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

6. Drop TEMP2

6.1 Stop the database and startup in mount mode using same modified pfile
Sql> shutdown immediate;
Sql > startup mount pfile=’/backup/clone/initTEST.ora’

6.2 Change the database name to TEST


nid TARGET=SYS/welcome123 DBNAME=TEST

www.orazer.com 8
6.3 Once the database is renamed the nid command will bring down the
database. Start it using the old pfile in ORACLE_HOME/dbs. (which has
db_name as TEST)
Sql>startup mount
Sql>alter database open resetlogs;
Note : Disable archive log if needed.

6.4 After db is opened, cleanup the FND NODE details using below script.
Run it as apps user.
SQL> conn apps/<appspwd>
Connected.
SQL> show user
USER is “APPS”
SQL> EXEC FND_CONC_CLONE.SETUP_CLEAN;
commit;

6.4 Run auto-config on DB Tier after ensuring that the DB and listener are up
and running.
$ cd $ORACLE_HOME/appsutil/scripts/TEST_dmdev02/./ adautocfg.sh
www.orazer.com 9
Steps to Clone Application:

1. Ensure the file system copy completed successfully on the application tier.
Compare the size (du –sh) output with production for same content.
$ pwd
/u01/oracle/TEST/apps
$ du -sh apps_st tech_st
39303540 apps_st
9237724 tech_st

2. Set Primary and secondary nodes and set all Pending requests on hold.
update fnd_concurrent_queues set node_name=’DMDEV02′ where
node_name is not null;

3. Check the old $INST_TOP is removed completely before starting the next
step.
cd /u01/oracle/TEST/apps/apps_st/comn/clone/bin
perl adcfgclone.pl appsTier <Path of the context_file that was saved in Pre
Task B>
www.orazer.com 10
4. Stop the concurrent managers and workflow.

5. Stop the Applications.

6. Change Apps password:


FNDCPASS apps/xxx 0 Y system/xx SYSTEM APPLSYS XXX

7. Change Sysasmin password:


FNDCPASS apps/xxx 0 Y system/xxx USER SYSADMIN xxx

8. Point all the fndcpesr soft links in $XX_TOP/bin to


$FND_TOP/bin/fndcpesr
for i in `ls -l | grep “^l” | awk ‘{print $9}’`
do
ln -sf $FND_TOP/bin/fndcpesr $i
Done

www.orazer.com 11
10. Run cmclean.sql

11. Run adautocfg.sh

12. Start all the services except the concurrent managers. CM’s should not be
started until Security team complete their post clone activities.

13. Login to the application using login page and launch the forms.

14. Change the Site Name to the name of the current environment with
information of the Refreshed time

www.orazer.com 12
Issues

R12: “FRM-92101: There was a failure in the Forms Server during startup”
Error When Attempting to Launch Forms
(Doc ID 454427.1)

The $ORACLE_HOME/lib32/ldflags was pointing to source instance(PROD)


1. Change is to point to target instance.

2. Bring down the application services.

3. Relink the forms executables.


cd $ORACLE_HOME/forms/lib32
make -f ins_forms.mk install

4. Start the services

www.orazer.com 13

You might also like