How to clone EBS and Database using rman backup

Introducton:-

In this post we will discuss ‘How to clone EBS and Database clone using rman backup’. Here we will perform rapid clone for ebs and restore database using rman

How to clone EBS and Database?

Follow the below steps carefully to complete ‘rapid clone using rman’ backup for the EBS & Database

 

First Steps: 1

NOTE:-  When you are planning for cloning, before taking backup, you have to run preclone on database and application.


Running Preclone on dbTier :-


1)Login on 197.0.0.511 as oracle user.

 

root@prod# su – oracle

 

oracle@prod$


oracle@prod$pwd


/oracle/home/oracle

 

oracle@prod$cd ora10g

 

oracle@prod$pwd             

/oracle/home/oracle/ora10g

 

oracle@prod$. ./*.env

 

oracle@prod$echo $ORACLE_SID


PROD


oracle@prod$cd appsutil/scripts/PROD_prod

 

oracle@prod$ls -ltr adpreclone.pl

 

-rwx——   1 oracle   dba        14345 Dec 19  2009 adpreclone.pl

 


oracle@prod$perl adpreclone.pl dbTier

 

 

 

It will prompt you for the apps user’s password. Give the password and enter. The preclone process will run for 3-5 minutes. Once it is complete and you get the prompt, run Preclone on APPSTIER as follows: –

 

Running Preclone on appsTier :–

 
2) Login on 197.0.0.11 as applmgr user.
 
root@appsprd # su – applmgr

 

 
applmgr@appsprd$pwd
/apps/home/applmgr

applmgr@appsprd$cd prodappl
 
applmgr@appsprd$pwd
/apps/home/applmgr/prodappl

 


applmgr@appsprd$. ./*.env
 
applmgr@appsprd$cd $COMMON_TOP/admin/scripts/PROD_appsprd

 

 

 

applmgr@appsprd$pwd

/apps/home/applmgr/prodcomn/admin/scripts/PROD_appsprd

 


applmgr@appsprd$ls -ltr adpreclone.pl
 
-rwx——   1 applmgr  oaa        14271 Dec 19  2009 adpreclone.pl
 
 
 
applmgr@appsprd$perl adpreclone.pl appsTier

The above command will run for around 10 minutes. You can shutdown the Application and Database, when the adpreclone is completed on dbTier and appsTier.
 
 

Second Steps : 2

 
 
NOTE : After running the preclone successfully.  Now you can shut down the services for APPS and DB. 
 
 

Procedure for Shutting down the Oracle EBS Applications:-

 
1)Login on 197.0.0.11 (APPSPRD) from Power Term Software or X-manager.
 
2)Login as application user.
 
   root@appsprd #  su – applmgr
 
3)Then list the files
 
applmgr@appsprd$  ls
 
4)Go to prodappl directory
 
applmgr@appsprd$ cd prodappl
 
      5)   Run the environment file
 
applmgr@appsprd$.  ./*.env
 
      6)   Check the environment
 
applmgr@appsprd$ env
 
(Note: It must show all the TOPS after running the env command)
 
      7)   Then type
 
applmgr@appsprd$ cd  $COMMON_TOP/admin
 
      8)   Run pwd
 
applmgr@appsprd$ pwd
 
          The result should be following
 
/apps/home/applmgr/prodcomn/admin
 
9)   Then list the files
 
applmgr@appsprd$ ls
 
10)   Go to the following Directory
 
applmgr@appsprd$ cd scripts
 
11)   Then list the files
 
applmgr@appsprd$ ls
 
12)   Go to PROD_appsprd directory
 
                      applmgr@appsprd$ cd  PROD_appsprd
 
13)   Check the path
 
                      applmgr@appsprd$ pwd
 
         The result should be following
 
        /apps/home/applmgr/prodcomn/admin/scripts/PROD_appsprd
 
14)  Then list the files
 
applmgr@appsprd$ ls
 
15)   Now check the processes of applmgr user
 
applmgr@appsprd$ ps –fu  applmgr
 
          It will show all the processes under the applmgr user.
 
16)   Then run the following script
 
applmgr@appsprd$ sh  adstpall.sh  apps/password
 
 17)   Now wait till the prompt comes.
 
18)   Check the status of all the scripts. Theexit status should show the value of 0.
 
18. (a) Now go to the path as below :
 
applmgr@appsprd$ cd   $ORACLE_HOME/discwb4/util

The output of the above command should be as follows:

applmgr@appsprd$ pwd /apps/home/applmgr/9iAS/8.0.6/discwb4/util

applmgr@appsprd$  ls

It will show many different scripts.

18. (b) Now run the following script :
 
applmgr@appsprd$./stopall.sh
 
19)   Now wait till all the applmgr processes are finished. This will be going to take some             time.
 
applmgr@appsprd$ ps  –fu  applmgr

20)Run the above command again and again till there are none of the processes remain.

(Note: You may have to kill some processes which are not killed by itself. For e.g. Processes
 

 Starting with FNDLIBR, /usr/j2se, f60webmx etc. Kill the processes very carefullyif required.)

 

This completes the procedure for Shutting down the Oracle Applications.
 

To start the EBS application, using adstral.shscript.

 
 
 
$sh  adstral.sh  apps/<password>
 
 
 

Procedure for Shutting down the Oracle Database:-

 
 
Once the Oracle Applications is closed and all the processes are finished, the next step is to shutdown the Oracle Database.
 
 
1)Open a new window at 197.0.0.51 (Prod) console.
 
2)Login with oracle user
 
root@prod # su  –  oracle
 
3)Then go to oracle home directory
 
oracle@prod$ cd ora10g

oracle@prod$pwd  /oracle/home/oracle/ora10g
 
 
4)Run the environment file
 
oracle@prod$.  ./*.env
 
 
5)Check the environment
 
oracle@prod$ env
 
 
6)Then shutdown the database by the following steps on SQL prompts.
 
oracle@prod$sqlplus ‘/as sysdba’
 
SQL> alter system checkpoint;
 
SQL> shutdown immediate
 
Then wait till it comes back to SQL prompt.
 
SQL> exit
 
NOTE:– ( It may take sometimes, 10-15 minutes for the database to get down.Wait till then.)
 
 
7) Check the alert.log for any error messages.
 
8)Now run the listener utility to stop the listener processes.
 
      oracle@prod$lsnrctl
 
LSNRCTL> stop PROD  
 
                       Then wait till it comes back to LSNRCTL prompt.
 
LSNRCTL> exit
 
9)Now check the processes for oracle
 
oracle@prod$ps –fu oracle.
 
 
10) Make sure no oracle processes exists on the Oracle server.
 
 
 
This completes the procedure for Shutting down the Oracle Database.
 
 
 

Third Steps: 3

 
 
 
Part A:
 
 
 
We have to copy the database Backup files from Venuss to appstst (197.0.0.24).
 
 
Or simply restore database directly from /Backup/RMAN_HOTBACKUP/PROD_DB.
 
 
 
Login in to Venuss server:
 
 
Login as : root
 
Password: **********
 
root@venuss # cd /backup03/TEST/RMAN_HOTBACKUP/PROD_DB
 
root@venuss # rcp –pr PROD* 197.0.0.24:/data01
 
root@venuss # cd /backup01/cold_backup/binaries
 
root@venuss # time rcp –pr ora10g 197.0.0.24: /oracle/home/oracle
 
Part B:
 
We have to copy the application files from Venuss to appstst (197.0.0.24).
 
 
root@venuss # cd /backup01/appsprd_backup
 
root@venuss # time rcp –pr prodappl 197.0.0.24: /backup/home/applmgr
 
root@venuss # time rcp –pr prodcomn 197.0.0.24: /backup/home/applmgr
 
root@venuss # time rcp –pr 9iAS 197.0.0.24: /backup/home/applmgr
 
 

Fourth Steps: 4

 
 
Change the ownership of datafiles.
 
 
Login in to Appstst server:
 
 
Login as : root
 
 
 
Password: **********
 
 
 
    root@appstst # cd  /data03/test
 
 
root@appstst # chown –R oracle:dba dbfiles
 
 
root@appstst # chown –R oracle:dba sysdbfiles
 
root@appstst # chown –R oracle:dba controlfiles
 
root@appstst # chown –R oracle:dba undofiles
 
root@appstst # chown –R oracle:dba logfiles
 
root@appstst # ls –ltr
 
root@appstst # cd  /archive/TEST
 
root@appstst # chown –R oracle:dba ndxfiles
 
root@appstst # cd  /oracle/home/oracle
 
root@appstst # chown –R oracle:dba ora10g
 
root@appstst # ls –ltr
 
Change the ownership of Application files.
 
root@appstst # cd /backup/home/applmgr
 
root@appstst # chown –R applmgr:oaa prodcomn
 
root@appstst # chown –R applmgr:oaa prodappl
 
root@appstst # chown –R applmgr:oaa 9iAS
 
root@appstst # ls –ltr
 
Rename the directory.
 
 
root@appstst # cd /backup/home/applmgr
 
 
mv prodcomn testcomon
 
mv prodappl testappl
 
root@appstst # ls –ltr
 
 

Fifth  Steps: 5

 
Login in to Appstst server:
 
Login as : oracle
Password: **********
 
 
Or  if you loging by root :
 
su – oracle
 
RMAN restoration on target database.
 
$cd /Backup/RMAN_HOTBACKUP/PROD_DB
 
Prepared pfile on target database. Start database in nomount mode.
 
$sqlplus / as sysdba
 
$sql>startup nomount
 
$sql>select name,open_mode from v$database;
 
Restore controlfile from backup (/Backup/RMAN_HOTBACKUP/PROD_DB)
 
$rman target /
 
$RMAN> restore controlfile from
 
‘/Backup/RMAN_HOTBACKUP/PROD_DB/PROD_CTL_ctq1rplm_8605_1’;
 
$RMAN>sql ‘alter database mount’;
 
Update catalog to restore database.
 
$RMAN>catalog start with ‘Backup/RMAN_HOTBACKUP/PROD_DB’;
 
Restore Database:-
 
$RMAN> @/oracle/home/oracle/restoretestdb.sql
 
After successful restoration open database with resetlogs. Add tempfile and rename redo logs file.
 


To change DB name follow the below steps:-


To change the database name in addition to the DBID, specify the DBNAME parameter. This example changes the name to test_db:
 
Ensure that the target database is mounted but not open, and that it was shut down consistently prior to mounting. For example:
 

Note:- Ensure tempfile and redo file available before going to rename Database name.
 
 
SHUTDOWN IMMEDIATE
 
STARTUP MOUNT
 
$nid TARGET=SYS/xxxxx DBNAME=test_db

 

 

 

 
 

SQL>ALTER DATABASE OPEN RESETLOGS;

After that modify the parameter file as db_name
 
nid target=sys@M3RPT REVERT=Y
 
Database clone using adcfgclone.pl:-
 
Note:- dbTechStack for Hot Backup
 
oracle@appstst$  cd  /oracle/home/oracle/ora10g/appsutil/clone/bin
 
oracle@appstst$  perl adcfgclone.pl dbTier
 
Enter the APPS password [APPS]:
 
apps1234
 
(user input  : apps1234)
 
First Creating a new context file for the cloned system.
 
The program is going to ask you for information about the new system:
 
Provide the values required for creation of the new Database Context file.
 
Do you want to use a virtual hostname for the target node (y/n) [n] ?:
(Press Enter)
 
Target instance is a Real Application Cluster (RAC) instance (y/n) [n]:
(Press Enter)
 
Target System database name [PROD]:TEST
(User Input: TEST)
 
Target system RDBMS ORACLE_HOME directory
 
[/oracle/home/oracle/ora10g]:/oracle/home/oracle/ora10g
(User Input: /oracle/home/oracle/ora10g)
 
 
Target system utl_file accessible directories list [/usr/tmp]:
(Press Enter)
 
Number of DATA_TOP’s on the target system [7]:6
 
 
Target system DATA_TOP 1:/data03/TEST/dbfiles
(User Input: /data03/TEST/dbfiles)
 
Target system DATA_TOP 2:/data03/TEST/sysdbfiles
(User Input: /data03/TEST/SYSdbfiles)
 
Target system DATA_TOP 3:/data03/TEST/tempfiles
(User Input: /data03/TEST/tempfiles)
 
 
Target system DATA_TOP 4:/data03/TEST/undofiles
(User Input: /data03/TEST/undofiles)
 
Target system DATA_TOP 5:/data03/TEST/logfiles
(User Input: /data03/TEST/logfiles)
 
Target system DATA_TOP 6:/archive/TEST/ndxfiles
(User Input: /archive/TEST/ndxfiles)
 
Do you want to preserve the Display set to prod:0.0 (y/n) [y] ?:n
(User Input: n)
 
Target system Display [appstst:0.0]:appstst
(User Input: appstst)
 
Perl executable location is set to:
/bin/perl
 
Do you want to preserve the port values from the source system on the target system (y/n) [y] ?:n
(User Input: n)
 
 
 
Clone Context uses the same port pool mechanism as the Rapid Install
 
Once you choose a port pool, Clone Context will validate the port availability.
 
 
Enter the port pool number [0-99]:
1
(User Input: 1)
Checking the port pool 1
 
done: Port Pool 1 is free
 
Database port is 1522
 
Creating the new Database Context file from :
 
  /oracle/home/oracle/ora10g/appsutil/template/adxdbctx.tmp
 
The new database context file has been created :
 
  /oracle/home/oracle/ora10g/appsutil/TEST_appstst.xml
 
Log file located at /oracle/home/oracle/ora10g/appsutil/clone/bin/CloneContext_07080811.log
 
Running Rapid Clone with command:
 
perl /oracle/home/oracle/ora10g/appsutil/clone/bin/adclone.pl
 
java=/oracle/home/oracle/ora10g/appsutil/clone/bin/../jre mode=apply
 
stage=/oracle/home/oracle/ora10g/appsutil/clone/bin/.. component=dbTier method=CUSTOM
 
dbctxtg=/oracle/home/oracle/ora10g/appsutil/TEST_appstst.xml  showProgress
 
contextValidated=true
Beginning database tier Apply – Sun Jul  8 08:15:33 2012
 
Log file located at
 
/oracle/home/oracle/ora10g/appsutil/log/TEST_appstst/ApplyDBTier_07080815.log
 
If error come at 70%
 
oracle@appstst$ cd /oracle/home/oracle/ora10g
 
oracle@appstst$ ls –ltr
 
oracle@appstst$ . ./ TEST_appstst.env
 
oracle@appstst$ sqlplus  ‘/as sysdba’
 
SQL> select name from v$database;
 
SQL> shutdown immediate;
 
SQL>startup;
 
LSNRCTL > stop TEST
 
Note : Copy the listener file from production to target .
 
LSNRCTL > start TEST
 
LSNRCTL > exit
 
Copy extproc from ora10g prod to test in ora10g.
 

Sixth  Steps: 6

 
Login in to Appstst server:
 
Login as : applmgr
 
Password: **********
 
Or  if you loging by root :
 
su – applmgr
 
applmgr@appstst$ cd  /backup/home/applmgr/prodcomn/clone/bin
 
applmgr@appstst$  ls
 
applmgr@appstst$ perl adcfgclone.pl appsTier
 
Enter the APPS password [APPS]:
 
apps1234
First Creating a new context file for the cloned system.
 
 
The program is going to ask you for information about the new system:
 
Provide the values required for creation of the new APPL_TOP Context file.
 
 
 
Do you want to use a virtual hostname for the target node (y/n) [n] ?:
(Press Enter)
 
Target system database SID [PROD]:TEST
(User Input: TEST)
 
Target system database server node [prod]:appstst
(User Input: appstst)
 
 
Target system database domain name [punjlloyd.com]:
(Press Enter)
 
Does the target system have more than one application tier server node (y/n) [y] ?:n
(User Input: n)
 
Is the target system APPL_TOP divided into multiple mount points (y/n) [n] ?:
(Press Enter)
 
Target system APPL_TOP mount point
[/apps/home/applmgr/prodappl]:/backup/home/applmgr/prodappl
(User Input: /backup/home/applmgr/prodappl)
 
 
Target system COMMON_TOP directory [/apps/home/applmgr/prodcomn]:/backup/home/applmgr/prodcomn
(User Input: /backup/home/applmgr/prodcomn)
 
 
Target system 8.0.6 ORACLE_HOME directory [/apps/home/applmgr/9iAS/8.0.6]:/backup/home/applmgr/9iAS/8.0.6
(User Input: /backup/home/applmgr/9iAS/8.0.6)
 
 
Target system iAS ORACLE_HOME directory [/apps/home/applmgr/9iAS/iAS]:/backup/home/applmgr/9iAS/iAS
(User Input: /backup/home/applmgr/9iAS/iAS)
 
 
Do you want to preserve the Display set to appsprd:0.0 (y/n) [y] ?:n
(User Input: n)
 
 
Target system Display [appstst:0.0]:
(Press Enter)
 
 
 
Location of the JDK on the target system [/usr/j2se]:
(Press Enter)
 
 
 
Do you want to preserve the port values from the source system on the target system (y/n) [y] ?:n
(User Input: n)
 
Clone Context uses the same port pool mechanism as the Rapid Install
 
 
Once you choose a port pool, Clone Context will validate the port availability.
 
 
Enter the port pool number [0-99]:
1
(User Input: 1)
 
Checking the port pool 1
 
done: Port Pool 1 is free
 
Web Listener port is 8001
 
Complete port information available at
 
/backup/home/applmgr/prodappl/admin/out/TEST_appstst/portpool.lst
 
Database Connection on Port 1522: Successful
 
 
UTL_FILE_DIR on database tier consists of the following directories.
1. /usr/tmp
2. /usr/tmp
3. /oracle/home/oracle/ora10g/appsutil/outbound/TEST_appstst
4. /usr/tmp
Choose a value which will be set as APPLPTMP value on the target node [1]:
 
Backing up /backup/home/applmgr/prodappl/admin/TEST_appstst.xml to
 
/backup/home/applmgr/prodappl/admin/TEST_appstst.xml.bak
 
Creating the new APPL_TOP Context file from :
 
  /backup/home/applmgr/prodappl/ad/11.5.0/admin/template/adxmlctx.tmp
 
The new APPL_TOP context file has been created :
 
  /backup/home/applmgr/prodappl/admin/TEST_appstst.xml
 
Log file located at /backup/home/applmgr/prodcomn/clone/bin/CloneContext_07080844.log
 
Running Rapid Clone with command:
 
        perl /backup/home/applmgr/prodcomn/clone/bin/adclone.pl
 
java=/backup/home/applmgr/prodcomn/clone/bin/../jre mode=apply
 
stage=/backup/home/applmgr/prodcomn/clone/bin/.. component=appsTier method=CUSTOM
 
appctxtg=/backup/home/applmgr/prodappl/admin/TEST_appstst.xml  showProgress
 
contextValidated=true
 
rm: /backup/home/applmgr/9iAS/iAS/6iserver is a directory
 
rm: /backup/home/applmgr/9iAS/iAS/Apache/jdk is a directory
 
ln: cannot create /backup/home/applmgr/9iAS/iAS/Apache/jdk/j2se: File exists
 
 
Beginning application tier Apply – Sun Jul  8 08:47:07 2012
 
 
Log file located at
 
/backup/home/applmgr/prodappl/admin/TEST_appstst/log/ApplyAppsTier_07080847.log
 
applmgr@appstst$  ps –ef |grep http
 
applmgr@appstst$  ps –fu applmgr
 
applmgr@appstst$  ps –ef |grep FNDLIBR
 
applmgr@appstst$ cd  prodappl
 
applmgr@appstst$ ls –ltr
 
applmgr@appstst$ . ./APPSORA.env
 
applmgr@appstst$adadmin
 
When it will run, then you have to press the ctrl + c key.
 
applmgr@appstst$cd
 
applmgr@appstst$cd prodcomn/admin/scripts/TEST_appstst/
 
applmgr@appstst$ls
 
applmgr@appstst$sh adstpall.sh apps/punj1234
 
applmgr@appstst$ls
 
applmgr@appstst$sh adautocfg.sh
 
 
 
applmgr@appstst$sh adstrtal.sh apps/punj1234
 
applmgr@appstst$sh adstpall.sh apps/punj1234
 
applmgr@appstst$ps -fu applmgr
 
applmgr@appstst$kill -9 15671
 
 
 

Seventh  Steps: 7

 
 
 
 
 
 
Login in to Appstst server:
 
Login as : oracle
 
Password: **********
 
Or  if you loging by root :
 
su – oracle
 
oracle@appstst$  cd  ora10g
 
 oracle@appstst$ . ./T*
 
oracle@appstst$ pwd
 
 /oracle/home/oracle/ora10g
 
oracle@appstst$ ls
 
oracle@appstst$ cd appsutil
 
oracle@appstst$ ls
 
oracle@appstst$ cd scripts
 
oracle@appstst$ cd TEST_appstst
 
oracle@appstst$ ls
 
oracle@appstst$ sh adautocfg.sh
 
oracle@appstst$ sqlplus /nolog
 
SQL> connect  apps/punj1234
 
SQL> EXEC FND_CONC_CLONE.SETUP_CLEAN;
 
 
SQL> /
 
 
SP2-0103: Nothing in SQL buffer to run.
 
SQL> commit;
 
 
 
 
 
 

Eighth  Steps: 8

 
Login in to Appstst server:
 
Login as : applmgr
 
Password: **********
 
Or  if you loging by root :
 
su – applmgr
 
applmgr@appstst$ps -ef | grep FNDLIBR
 
 
 
Apps password reset:-
 
 
############################################################################
#
# HOW TO CHANGE APPS PASSWORD BY FNDCPASS COMMMAND
#
############################################################################
 
Here is Steps to Change Apps Password:
 
 
1- Shutdown all the application Services.(and start the database and its listener)
 
3- Issue the commands at the Unix command line similar to the following:
 
 
 
 
 
FNDCPASS apps/apps12345 0 Y system/prodmgr SYSTEM APPLSYS <new password>
 
 
 
NOTE : VERY IMPORTANT! (on appsprd(application server)
 
Sqlplus /nolog
 
Sql> connect apps/<New Passwd>
 
Sql> show User
 
Run the autoconfig on db and appsTier.
 
 
5- Start all the Application services with New APPS Password
 
 
 
6-Submit a Active User request and check that request completes successfully.
 
 
 
Note :- Before changing the password your database and listener should be up.
 
 
 
 
Note:- Above steps will work with EBS R12.1.*. For R12.2 follow the below steps to clone.

 

 

 

Cloning procedure for Oracle E-Business Suite Release 12.2 with Rapid Clone.

 

 

The cloning of EBS consist of the following three phase.

1. Prepare the source system for the apps Tier.

 
2. Copy both APPS Tier nodes from source to target system.
 
3. Configure the Target System for apps Tier.

Configure target system application tier server.

 

 

Make sure below file system have correct ownership, if not please change it as below.

root# mkdir -p /oracle/apps/fs1/

 
root# mkdir -p /oracle/apps/fs2/
 
root# mkdir -p /oracle/apps/fs_ne/

 

 

root#chown -R applmgr:dba /oracle/apps/fs1/ /oracle/apps/fs2/ /oracle/apps/fs_ne/

root#chmod -R 775 /oracle/apps/fs1/ /oracle/apps/fs2/ /oracle/apps/fs_ne/

Login run edition file system in the target system as applmgr user.

$cd $COMMON_TOP/clone/bin

$perl adcfgclone.pl appTier 

Note:- Provide the currect input while prompt after execution of adcfgclone.pl. Do the same as previor release (R12.1.1).

Once cloning of fs1 file system completed. Check the opmn status.


$sh adopmnctl.sh status

Now we will clone the fs2 file system. Source the patch file system.

$cd $COMMON_TOP/clone/bin

 

$perl adcfgclone.pl appTier 

 

 

Note:- Once completed it. Do the post steps as below.


1. Change the system password.


2. Change APPS password.
 
3. Change the site name.

4. Change the Form Colour .
 
5. Run cmclean.sql
 
6. Clear the unwanted schedule program.
 
7. Deactivate the Workflow service.

 

 

Related/References:-

R11i / R12.0 / R12.1 : Cloning Oracle Application with Rapid 

Leave a Comment