Monday, August 20, 2018

Step by Step Oracle Applications and Database Cloning for Oracle EBS 12.2 Environment

Hi All,

Cloning of Oracle ERP Database and Applications for Oracle EBS 12.2 ( 12.2.x) can be done in several ways. Below I have described one such scenario.  Based on the backup policy and customization you have for your Oracle EBS Environment steps might vary . Here I just documented based on my experiences.


Source :ERP122_Source

DB node:source_db_host
App node:source_apps_host

Target :erp1226

DB node:target_db_host
App node:target_apps_host


Step 1: Running Pre-clone on the Source Apps Tier(ERP122_Source)

To prepare the source environment for cloning we need to run adpreclone.pl script.

cd $ADMIN_SCRIPTS_HOME

perl adpreclone.pl appsTier

apps:welcome1
weblogic:welcome1


Log file located at /erpapp/ERP122_Source/upgrade/fs1/inst/apps/ERP122_Source_uat-

cm2/admin/log/clone/StageAppsTier_02041740.log

  \     20% completed

Completed Stage...

END: Calling StagefmwTechStack...


#############################################################

END: StageAppsTier Finished at Thu Feb 04 18:14:16 GST 2018
Status: Completed Successfully
#############################################################


Step 2: Running Pre-Clone on the Source DB Tier

To prepare the source environment for cloning we need to run adpreclone.pl script.

cd /u01/ERP122_Source/db/dbhome_1/appsutil/scripts/ERP122_Source_host

perl adpreclone.pl dbTier


Log file located at /u01/ERP122_Source/db/dbhome_1/appsutil/log/ERP122_Source_host/StageDBTier_02041853.log

  /     50% completed

Completed Stage...
Thu Feb  4 18:55:58 2018

Step 3: Copying Application Tier from Source to Target

WHAT NEEDS TO BE COPIED
----------------------------
Choose only RUN FILE SYSTEM for copying

Copy EBSapps directory from source(ERP122_Source) to target(erp1226) (no need to copy FMW_Home and inst Directories)


a) EBSapps =>COPY

On Source(ERP122_Source): Take tar backup of EBSapps

cd /erpapp/ERP122_Source/upgrade/fs1
tar -cvf /u04/ERP122_Source/apps/EBSapps.tar

b) FMW_HOME =>DON'T COPY
c) inst =>DON'T COPY

Prepare Target:(erp1226 : 12.2.5)
=========================================

cd /erpapp/
applmgr@orace_erp_host:~$ mkdir erp1226

mkdir -p /erpapp/erp1226/fs1/
mkdir -p /erpapp/erp1226/fs2/
mkdir -p /erpapp/erp1226/fs_ne/

Step 4:Copy the Oracle Home from source(ERP122_Source) to target(erp1226):

Step a:Create Required directory structures on target with 'oracle' ownership and permissions

root@host:~# mkdir -p /u01/erp1226/db
chown -R oracle:oinstall /u01/erp1226/db


Step b: Take tar backup on ERP122_Source(Source Environment)

cd /u01/ERP122_Source/db
 tar -cvf /u04/ERP122_Source/db/dbhome_1.tar dbhome_1 &

drwxr-xr-x  82 oracle   oinstall      87 Jan 18 10:32 dbhome_1
-rw-r--r--   1 oracle   oinstall 3711308097 Jan 18 17:36 dbhome_1.tar.gz

Step 5:On Target: Extract and give required permissions.


APPS:
======
cd /erpapp/erp1226/fs1
tar -xvf /u04/ERP122_Source/apps/EBSapps.tar

DB:
====
cd /u01/erp1226/db
tar -xvf /u04/ERP122_Source/db/dbhome_1.tar

After extracting DB home please give the required permisssion VVIMP

root@host:~# cd /u01/erp1226/db/dbhome_1/bin
root@host:/u01/erp1226/db/dbhome_1/bin# chmod 6751 oracle
root@host:/u01/erp1226/db/dbhome_1/bin# ls -l oracle
-rwsr-s--x   1 oracle   oinstall 258934216 Jan 31 12:51 oracle
root@host:/u01/erp1226/db/dbhome_1/bin#


$ perl adcfgclone.pl dbTechStack

first source perl
--------------------

export

PERL5LIB=/u01/erp1226/db/dbhome_1/perl/lib/5.10.0:/u01/erp1226/db/dbhome_1/perl/lib/site_perl/5.10.0:/u01/erp1226/db/dbhom

e_1/appsutil/perl
export

PATH=/u01/erp1226/db/dbhome_1/perl/bin:/u01/erp1226/db/dbhome_1/perl/bin:/u01/erp1226/db/dbhome_1/bin:/usr/ccs/bin:/usr/sb

in:/u01/erp1226/db/dbhome_1/jdk/jre/bin:/usr/bin:/bin:.:.
export ADPERLPRG=/u01/erp1226/db/dbhome_1/perl/bin/perl


support id: 458653.1 OUICLI.PL Fail while running adcfgclone
-------------------------------------------------------------

Note:Take oraInst.loc backup

I created oraInventory directory in $ORACLE_HOME and updated new location in oraInst.loc and the issue resolved.

-bash-4.1$ cd $ORACLE_HOME
-bash-4.1$ pwd
/u01/erp1226/db/dbhome_1
-bash-4.1$ mkdir oraInventory
-bash-4.1$ cd oraInventory
-bash-4.1$ pwd
/u01/erp1226/db/dbhome_1/oraInventory

-bash-4.1$ mv oraInst.loc oraInst.loc.org (backup oraInst.loc.org)

-bash-4.1$ vi oraInst.loc
-bash-4.1$ cat $ORACLE_HOME/oraInst.loc
inventory_loc=/u01/erp1226/db/dbhome_1/oraInventory
inst_group=oinstall


Step 6: Execute adcfgclone with tech_st for configuring Technology stack on Target DB Tier

/u01/erp1226/db/dbhome_1/appsutil/clone/bin

export

PERL5LIB=/u01/erp1226/db/dbhome_1/perl/lib/5.10.0:/u01/erp1226/db/dbhome_1/perl/lib/site_perl/5.10.0:/u01/erp1226/db/dbhom

e_1/appsutil/perl

perl adcfgclone.pl dbTechStack


practical
=============
(Eg:export

PERL5LIB=/u01/erp1223/db/dbhome_1/perl/lib/5.10.0:/u01/erp1223/db/dbhome_1/perl/lib/site_perl/5.10.0:/u01/erp1223/db/dbhom

e_1/appsutil/perl)

On Target set the perl path:

export

PERL5LIB=/u01/erp1226/db/dbhome_1/perl/lib/5.10.0:/u01/erp1226/db/dbhome_1/perl/lib/site_perl/5.10.0:/u01/erp1226/db/dbhom

e_1/appsutil/perl

-bash-4.1$ perl adcfgclone.pl dbTechStack

                     Copyright (c) 2002, 2015 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 120.63.12020000.56

Enter the APPS password :

Running: Context clone...

Log file located at /u01/erp1226/db/dbhome_1/appsutil/clone/bin/CloneContext_0204213607.log

Provide the values required for creation of the new Database Context file.

Target System Hostname (virtual or normal) [host] :

Target Instance is RAC (y/n) [n] : n

Target System Database SID : erp1226

Target System Base Directory : /u01/erp1226/

Target System utl_file_dir Directory List : /usr/tmp

Number of DATA_TOP's on the Target System [3] : 1

Target System DATA_TOP Directory 1 : /u04/erp1226

Target System RDBMS ORACLE_HOME Directory [/u01/erp1226/db/11.2.0] : /u01/erp1226/db/dbhome_1

Do you want to preserve the Display [host:0.0] (y/n)  : y

Target System Port Pool [0-99] : 20

Checking the port pool 6
done: Port Pool 6 is free
Report file located at /u01/erp1226/db/dbhome_1/appsutil/temp/portpool.lst
The new database context file has been created :
  /u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml
Check Clone Context logfile /u01/erp1226/db/dbhome_1/appsutil/clone/bin/CloneContext_0204213607.log for details.

Running Rapid Clone with command:

Running:
perl /u01/erp1226/db/dbhome_1/appsutil/clone/bin/adclone.pl java=/u01/erp1226/db/dbhome_1/appsutil/clone/bin/../jre

mode=apply stage=/u01/erp1226/db/dbhome_1/appsutil/clone component=dbTechStack method=CUSTOM

dbctxtg=/u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml showProgress contextValidated=true


Beginning rdbms home Apply - Thu Feb  4 21:40:11 2018

/u01/erp1226/db/dbhome_1/appsutil/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -

Doracle.installer.oui_loc=/u01/erp1226/db/dbhome_1/oui -classpath

/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/xmlparserv2.jar:/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/ojdbc6.jar:/u01/

erp1226/db/dbhome_1/appsutil/clone/jlib/java:/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/oui/OraInstaller.jar:/u01/erp122

6/db/dbhome_1/appsutil/clone/jlib/oui/ewt3.jar:/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/oui/share.jar:/u01/erp1226/db/

dbhome_1/appsutil/clone/jlib/oui/srvm.jar:/u01/erp1226/db/dbhome_1/appsutil/clone/jlib/ojmisc.jar 

oracle.apps.ad.clone.ApplyDBTechStack -e /u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml -stage

/u01/erp1226/db/dbhome_1/appsutil/clone   -showProgress
APPS Password : Log file located at /u01/erp1226/db/dbhome_1/appsutil/log/erp1226_host/ApplyDBTechStack_02042140.log
  |      0% completed


Cloning of Database:
===========================
We can use various techniques for cloning depending on the backup policy and availability of Database.
Here I have discussed few approaches. Please follow your own approach depending on backup you have.

Step 7 a:Backup Database:(ERP122_Source)
===========================

run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
allocate channel ch4 device type disk;
allocate channel ch5 device type disk;
allocate channel ch6 device type disk;
backup as copy database format '/u04/ERP122_Source/db/data/%b';
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
}



Note:For inventory issue:ETCC issue:
====
Download the patch 17537119 and Apply

Step 1:
-bash-4.1$ . erp1226_host.env
-bash-4.1$ cd /u01/erp1226/db/dbhome_1/appsutil/
-bash-4.1$ mkdir etcc
-bash-4.1$ cd etcc/
-bash-4.1$ pwd
/u01/erp1226/db/dbhome_1/appsutil/etcc


Step 2:
cd /export/home/oracle/DBA/1225_Patches/

mkdir 17537119

unzip p17537119.zip

-bash-4.1$ ls -ltr
total 1923
-rwxrwxrwx   1 oracle   oinstall   37060 Feb  1 15:53 checkDBpatch.sh
-rwxrwxrwx   1 oracle   oinstall   34675 Feb  1 15:56 txk_R1220_MT_base_bugs.xml
-rwxrwxrwx   1 oracle   oinstall  275560 Feb  1 16:21 txk_R1220_DB_mappings.xml
-rwxrwxrwx   1 oracle   oinstall  228911 Feb  1 16:31 txk_R1220_MT_mappings.xml
-rwxrwxrwx   1 oracle   oinstall   45408 Feb  1 17:04 checkMTpatch.cmd
-rwxrwxrwx   1 oracle   oinstall   41856 Feb  1 17:28 checkMTpatch.sh
-rwxrwxrwx   1 oracle   oinstall   25103 Feb  1 19:14 txk_R1220_DB_base_bugs.xml
-rw-r--r--   1 oracle   oinstall   23546 Feb  1 19:39 README.txt
-rwxrwxrwx   1 oracle   oinstall   40266 Feb  2 13:08 checkDBpatch.cmd
-rw-r--r--   1 oracle   oinstall   70609 Feb  5 13:28 p17537119_R12_GENERIC.zip
-bash-4.1$ pwd
/export/home/oracle/DBA/1225_Patches/17537119


Step 3:

-bash-4.1$ cp *.* /u01/erp1226/db/dbhome_1/appsutil/etcc
-bash-4.1$ cd /u01/erp1226/db/dbhome_1/appsutil/etcc
-bash-4.1$


step 4:Execute checkdbpatch.sh

-bash-4.1$ ./checkDBpatch.sh

 +===============================================================+
 |    Copyright (c) 2005, 2018 Oracle and/or its affiliates.     |
 |                     All rights reserved.                      |
 |             Oracle E-Business Suite Release 12.2              |
 |          Database EBS Technology Codelevel Checker            |
 +===============================================================+

Using context file from currently set database environment:
/u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml

Starting Database EBS Technology Codelevel Checker, Version 120.31
Fri Feb  5 15:40:05 GST 2018
Log file for this session : ./checkDBpatch_25691.log

Bugfix XML file version: 120.0.12020000.28
This file will be used for identifying missing bugfixes.

Mapping XML file version: 120.0.12020000.1
This file will be used for mapping bugfixes to patches.

Identifying database release.
Database release set to 11.2.0.4.

Connecting to database.



on 170 DB node:
==========

Verify the backup location :(/u04/ERP122_Source/db/data)

/u04/ERP122_Source/db/onlinelog

mkdir -p /u04/ERP122_Source/db/onlinelog

-bash-4.1$ cp initERP122_Source.ora initERP122_Source.ora
-bash-4.1$ ps -ef|grep smno
  oracle  5639 20586   0 15:57:39 pts/8       0:00 grep smno
-bash-4.1$ ps -ef|grep smon
  oracle 16818 16642   0   Jan 06 ?           2:27 ora_smon_obieedb
    grid 17823  5568   0   Jan 06 ?           1:22 asm_smon_+ASM
  oracle 16301 17091   0   Feb 03 ?           4:54 ora_smon_erp1223
  oracle  5759 20586   0 15:57:42 pts/8       0:00 grep smon
  oracle 13428 13320   0   Feb 03 ?           6:09 ora_smon_erp1224
-bash-4.1$ pwd
/u01/erp1226/db/dbhome_1/dbs
-bash-4.1$ export ORACLE_SID=ERP122_Source

-bash-4.1$ du -sh .
 2.1T   .


Note: IN SOURCE ENV:
===================

-bash-4.1$ . ERP122_Source_host.env

-bash-4.1$ pwd
/export/home/oracle
-bash-4.1$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Feb 5 16:39:55 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            5570036984 bytes
Database Buffers         2.0804E+10 bytes
Redo Buffers              355704832 bytes
Database mounted.
Database opened.
SQL> select name from v$database;

NAME
---------
ERP122_Source

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

once copy archives and than shut down ERP122_Source(source)

SQL> shut immediate


create archivelog destination and copy archives

mkdir -p /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05

Login as 'grid' os user and do below:

chmod -R 777 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05

Eg:
===

cp thread_1_seq_1425.13277.902885815 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1426.13275.902889561 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1427.13273.902892401 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1428.13267.902894711 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1429.13265.902894727 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1430.13263.902894743 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05
cp thread_1_seq_1431.13261.902894755 /u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05



SQL> startup nomount pfile='/u01/erp1226/db/dbhome_1/dbs/initERP122_Source.ora'
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            3221226744 bytes
Database Buffers         2.3153E+10 bytes
Redo Buffers              355704832 bytes
SQL> show parameter db_recover%

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
db_recovery_file_dest                string
/u04/ERP122_Source/db/data/erp122
5/archivelog
db_recovery_file_dest_size           big integer
2000G
SQL> alter database mount;

Database altered.

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u04/ERP122_Source/db/data/contro
                                                 l1.dbf, /u04/ERP122_Source/db/dat
                                                 a/control2.dbf
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-bash-4.1$ echo $ORACLE_SID
ERP122_Source
-bash-4.1$ rman target /


RMAN> recover database;

Starting recover at 05-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5429 device type=DISK

starting media recovery

RMAN-08187: WARNING: media recovery until scN 9814470450787 complete
Finished recover at 05-FEB-16



SQL> recover database using backup controlfile;
ORA-00279: change 9814470450787 generated at 02/04/2018 21:30:22 needed for
thread 1
ORA-00289: suggestion :
/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/o1_mf_1
_1559_%u_.arc
ORA-00280: change 9814470450787 for thread 1 is in sequence #1559


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}






NAME
---------
ERP122_Source

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u04/ERP122_Source/db/data/contro
                                                 l1.dbf, /u04/ERP122_Source/db/dat
                                                 a/control2.dbf
SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-bash-4.1$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Feb 5 17:49:55 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ERP122_Source (DBID=3882746714, not open)

RMAN> recover database;

Starting recover at 05-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5429 device type=DISK

starting media recovery

archived log for thread 1 with sequence 1559 is already on disk as file

/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1559.12972.903026451
archived log for thread 1 with sequence 1560 is already on disk as file

/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1560.12971.903026455
archived log file

name=/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1559.12972.90302

6451 thread=1 sequence=1559
archived log file

name=/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1560.12971.90302

6455 thread=1 sequence=1560
RMAN-08187: WARNING: media recovery until scN 9814470462883 complete
archived log file

name=/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1560.12971.90302

6455 thread=1 sequence=1561
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/05/2018 17:50:35
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile

'/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05/thread_1_seq_1560.12971.903026455

'
ORA-00283: recovery session canceled due to errors
ORA-01112: media recovery not started
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 1561 and starting scN of

9814470462883

RMAN> exit


Recovery Manager complete.
-bash-4.1$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Feb 5 17:50:56 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$database;

NAME
---------
ERP122_Source

SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> alter database open resetlogs;

Database altered.



-bash-4.1$ cd /u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05
-bash-4.1$ ls -l *1559*
*1559*: No such file or directory
-bash-4.1$ pwd
/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05
-bash-4.1$ ls -ltr
total 0
-bash-4.1$ pwd
/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05
-bash-4.1$ cd /u04/ERP122_Source/db/data/ERP122_Source/archivelog
-bash-4.1$ ls



Original defined:
================

/u04/ERP122_Source/db/data/ERP122_Source/archivelog/2018_02_05

As per recommendation:

/u04/ERP122_Source/db/data/ERP122_Source/archivelog/ERP122_Source/archivelog/2018_02_05



NOW bring up the database as erp1226:
------------------------------------

alter database backup controlfile to trace as '/export/home/oracle/CLONE_erp1226/trace_cont_05Feb2018_u04_up_trc';

shut immediate the ERP122_Source database which is running already.

shut immediate

SQL> select name from v$database;

NAME
---------
ERP122_Source

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> show parameter %CONTROL%

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /u04/rman/01Jan2015/cnt1.db
                                                 f, /u04/rman/01Jan2015/cnt2
                                                 .dbf, /u04/rman/01Jan2015/c
                                                 nt3.dbf
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u04/rman/01Jan2015/system.272.845039815


export ORACLE_SID=erp1226

-bash-4.1$ mv initerp1226.ora initerp1226.ora_orig
-bash-4.1$ cp initERP122_Source.ora initerp1226.ora
-bash-4.1$ vi initerp1226.ora
-bash-4.1$ grep -i control_files initerp1226.ora
*.control_files='/u04/ERP122_Source/db/data/control1_erp1226.dbf','/u04/ERP122_Source/db/data/control2_erp1226.dbf'
-bash-4.1$ grep -i db_name initerp1226.ora
*.db_name='erp1226'
-bash-4.1$



b. Rename trace file to ctrl.sql
vi ctrl.sql
Change “REUSE” to “SET”
Change “ERP122_Source” to “erp1226”
Change “noresetlogs” to “resetlogs”
Change “archivelog” to “noarchivelog”

after rename cont_01Jan2015_u04_dev.sql

c. cp initERP122_Source.ora initerp1226.ora

VVIMP

Change db_name=erp1226 in initerp1226.ora
change the controlfile names in initerp1226.ora

racle@erp3client01:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$ grep -i control_file initerp1226.ora
*.control_files='/u04/rman/01Jan2015/cnt_d1.dbf','/u04/rman/01Jan2015/cnt_d2.dbf','/u04/rman/01Jan2015/cnt_d3.dbf'

oracle@erp3client01:/u01/app/oracle/product/11.2.0/dbhome_1/dbs$ grep -i db_name initerp1226.ora
*.db_name='erp1226'


d. export ORACLE_SID=erp1226

(Eg controlfile erp1226
CREATE CONTROLFILE SET DATABASE "erp1226" RESETLOGS FORCE LOGGING NOARCHIVELOG
    MAXLOGFILES 32
    MAXLOGMEMBERS 5
    MAXDATAFILES 512
    MAXINSTANCES 8
    MAXLOGHISTORY 20157
LOGFILE
)


SQL> startup nomount pfile='/u01/erp1226/db/dbhome_1/dbs/initerp1226.ora'
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            3221226744 bytes
Database Buffers         2.3153E+10 bytes
Redo Buffers              355704832 bytes
SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/ERP122_Source/db/data/contro
l1_erp1226.dbf, /u04/erp122
5/db/data/control2_erp1226.dbf



SQL> startup nomount pfile='/u01/erp1226/db/dbhome_1/dbs/initerp1226.ora'
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            3221226744 bytes
Database Buffers         2.3153E+10 bytes
Redo Buffers              355704832 bytes
SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/ERP122_Source/db/data/contro
l1_erp1226.dbf, /u04/erp122
5/db/data/control2_erp1226.dbf
SQL> !pwd
/export/home/oracle/CLONE_erp1226

SQL> @cont_05Feb2018_u04_erp1226.sql

Control file created.

SQL> alter database open resetlogs;

Database altered.

SQL> select name from v$database;

NAME
---------
erp1226

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/ERP122_Source/db/data/contro
l1_erp1226.dbf, /u04/erp122
5/db/data/control2_erp1226.dbf



SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u04/ERP122_Source/db/onlinelog/group_17.9627.902761661
/u04/ERP122_Source/db/onlinelog/group_17.9626.902761663
/u04/ERP122_Source/db/onlinelog/group_16.9629.902761653
/u04/ERP122_Source/db/onlinelog/group_16.9628.902761655
/u04/ERP122_Source/db/onlinelog/group_15.9631.90276164

e. sqlplus "/as sysdba"

startup nomount

SQL> startup nomount
ORACLE instance started.

Total System Global Area 7484866560 bytes
Fixed Size                  2196112 bytes
Variable Size            1627397488 bytes
Database Buffers         5519704064 bytes
Redo Buffers              335568896 bytes
SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/rman/01Jan2015/cnt_dev
1.dbf, /u04/rman/01Jan2015/
cnt_dev2.dbf, /u04/rman/08D
ec2015/cnt_dev3.dbf


SQL> @contr_01Jan2015_u04_DEV.sql

Control file created.




alter database open resetlogs;


SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/u04/rman/erp1226/data/contro
l_d1.dbf, /u04/rman/erp1226/d
ata/control_d2.dbf
SQL> select status from v$instance;

STATUS
------------------------------------
STARTED

SQL> @contr_dev_u04_03Jan2018.sql

Control file created.



SQL> alter database open resetlogs;

Database altered.

SQL> select name from v$database;

NAME
---------
erp1226

SQL> select status from v$instance;

STATUS
------------
OPEN

Once the Database is recovered verify the Datafiles,Redolog files.


SQL> select name from v$database;

NAME
---------
erp1226

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u04/ERP122_Source/db/onlinelog/group_17.9627.902761661
/u04/ERP122_Source/db/onlinelog/group_17.9626.902761663
/u04/ERP122_Source/db/onlinelog/group_16.9629.902761653
/u04/ERP122_Source/db/onlinelog/group_16.9628.902761655
/u04/ERP122_Source/db/onlinelog/group_15.9631.902761641
/u04/ERP122_Source/db/onlinelog/group_15.9630.902761643
/u04/ERP122_Source/db/onlinelog/group_14.9633.902761631
/u04/ERP122_Source/db/onlinelog/group_14.9632.902761631
/u04/ERP122_Source/db/onlinelog/group_13.9635.902761623
/u04/ERP122_Source/db/onlinelog/group_13.9634.902761623
/u04/ERP122_Source/db/onlinelog/group_12.9637.902761701

MEMBER
--------------------------------------------------------------------------------
/u04/ERP122_Source/db/onlinelog/group_12.9636.902761701
/u04/ERP122_Source/db/onlinelog/group_11.9639.902761589
/u04/ERP122_Source/db/onlinelog/group_11.9638.902761591

14 rows selected.



SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u04/ERP122_Source/db/data/system.9939.902760745
/u04/ERP122_Source/db/data/system.10052.902761115
/u04/ERP122_Source/db/data/system.9931.902761091
/u04/ERP122_Source/db/data/system.10016.902761093
/u04/ERP122_Source/db/data/system.10050.902761123
/u04/ERP122_Source/db/data/system.10007.902761093
/u04/ERP122_Source/db/data/system.10048.902761123
/u04/ERP122_Source/db/data/system.10040.902761139
/u04/ERP122_Source/db/data/system.10049.902761107
/u04/ERP122_Source/db/data/system.9998.902761021
/u04/ERP122_Source/db/data/system.10042.902761123



Create temporary tablespace and make it default.


Once the Database is recovered verify the Datafiles,Redolog files.

select member from v$logfile;
select name from v$datafile;


SQL> select * from v$tempfile;

no rows selected

SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';

TABLESPACE_NAME
------------------------------
TEMP11
TEMP8


create temporary tablespace and make it default.


select  name from v$datafile;
create temporary tablespace temp12 tempfile '/u04/ERP122_Source/db/data/temp12_01.dbf' size 20g;
alter database default temporary tablespace temp12;

drop tablespace temp11 including contents and datafiles;
drop tablespace temp8 including contents and datafiles;

SQL> select PROPERTY_NAME,PROPERTY_VALUE from database_properties where property_name like '%DEFAULT%';

PROPERTY_NAME
------------------------------
PROPERTY_VALUE
--------------------------------------------------------------------------------
DEFAULT_TEMP_TABLESPACE
TEMP12


CREATE SPFILE:
===============

create spfile from pfile;

SQL> create spfile from pfile;


File created.

shut immediate

Migrate Database from Filesystem to ASM location:
====================================================

Startup with SPFILE

shut immediate
startup

SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/erp1226/db/dbhome_1/dbs/s
                                                 pfileerp1226.ora


Migrate to ASM:
==================

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks

Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576  25165824  6296220            65536         3115342              0       

   N  DATA/

ASMCMD> cd DATA/
ASMCMD> ls
ASM/
DB_UNKNOWN/
DEVOATS/
erp1223/
erp1224/
ERP122_Source/
UPGUAT1/
spfileerp1224.ora

ASMCMD> pwd
+DATA


ASMCMD> mkdir erp1226
ASMCMD> ls
ASM/
DB_UNKNOWN/
DEVOATS/
erp1223/
erp1224/
ERP122_Source/
erp1226/
UPGUAT1/
spfileerp1224.ora

ASMCMD> cd erp1226/
ASMCMD> pwd
+DATA/erp1226

+DATA/erp1226
ASMCMD> mkdir CONTROLFILE
ASMCMD> ls
CONTROLFILE/


B. Migrate Database from Filesystem to ASM location

Startup with SPFILE
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/erp1226/db/dbhome_1/dbs/s
                                                 pfileerp1226.ora
                             

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u04/ERP122_Source/db/data/contro
                                                 l1_erp1226.dbf, /u04/erp122
                                                 5/db/data/control2_erp1226.dbf


alter system set db_recovery_file_dest='+DATA';
alter system set db_create_file_dest='+DATA';

alter system set control_files='+DATA/erp1226/CONTROLFILE/ctrlerp1226_05Feb2018.dbf' scope=spfile;
SQL> show parameter control_files

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u04/ERP122_Source/db/data/contro
                                                 l1_erp1226.dbf, /u04/erp122
                                                 5/db/data/control2_erp1226.dbf

             
shut immediate
startup nomount

SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
+DATA/erp1226/controlfile/ctrl
erp1226_05feb2018.dbf





(WE HAVE TO DO THIS STEP AFTER DB CLONE)

(optionally workaround step

SQL> alter system set local_listener='erp1226' scope=spfile;

System altered.

SQL> shut immediate
ORA-01507: database not mounted


ORACLE instance shut down.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 2.6732E+10 bytes
Fixed Size                  2194184 bytes
Variable Size            3556771064 bytes
Database Buffers         2.2817E+10 bytes
Redo Buffers              355704832 bytes
SQL> show parameter %LOCAL%

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
local_listener                       string
ERP122_Source
log_archive_local_first              boolean
TRUE
parallel_force_local                 boolean
FALSE


)

SQL> alter system register;

System altered.

-bash-4.1$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       host           STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       host           STABLE
ora.asm


)

Registering listener:
========================

-bash-4.1$ srvctl status listener -l listener
srvctl stop listener -l listener

srvctl modify listener -l listener -endpoints 1521,1596,1548,1561,1701
srvctl start listener -l listener

-bash-4.1$ srvctl status listener -l listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): host



Restore controlfile using RMAN from backup location taken earlier.


rman target /


RMAN> restore controlfile from '/u04/ERP122_Source/db/data/control1_erp1226.dbf';

-bash-4.1$ echo $ORACLE_SID
erp1226
-bash-4.1$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Feb 5 19:17:54 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: erp1226 (not mounted)

RMAN> restore controlfile from '/u04/ERP122_Source/db/data/control1_erp1226.dbf';

Starting restore at 05-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6373 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=+DATA/erp1226/controlfile/ctrlerp1226_05feb2018.dbf
Finished restore at 05-FEB-16



RMAN> alter database mount;

ASMCMD> cd CONTROLFILE/
ASMCMD> ls -l
Type         Redund  Striped  Time             Sys  Name
CONTROLFILE  HIGH    FINE     FEB 05 19:00:00  N    ctrlerp1226_05feb2018.dbf =>

+DATA/erp1226/CONTROLFILE/current.3903.903035901
CONTROLFILE  HIGH    FINE     FEB 05 19:00:00  Y    current.3903.903035901
ASMCMD> pwd
+DATA/erp1226/CONTROLFILE



Note:Eg: Test with 1 datafile:
======

RMAN> backup as copy datafile 1 format '+DATA';

Starting backup at 05-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6137 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u04/ERP122_Source/db/data/system.9939.902760745
output file name=+DATA/erp1226/datafile/system.10315.903036027 tag=TAG20180205T192025 RECID=1 STAMP=903036055
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=+DATA/erp1226/controlfile/backup.10316.903036061 tag=TAG20180205T192025 RECID=2 STAMP=903036062
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 05-FEB-16
channel ORA_DISK_1: finished piece 1 at 05-FEB-16
piece handle=+DATA/erp1226/backupset/2018_02_05/nnsnf0_tag20180205t192025_0.10317.903036063 tag=TAG20180205T192025

comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-FEB-16



verify:
=========

DATAFILE/
ASMCMD> cd DATAFILE/
ASMCMD> ls -l
Type      Redund  Striped  Time             Sys  Name
DATAFILE  MIRROR  COARSE   FEB 05 19:00:00  Y    SYSTEM.10315.903036027
ASMCMD> pwd
+DATA/erp1226/DATAFILE

Remove the file tested:
========================

ASMCMD> pwd
+DATA/erp1226/DATAFILE
ASMCMD> ls -ltr
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type      Redund  Striped  Time             Sys  Name
DATAFILE  MIRROR  COARSE   FEB 05 19:00:00  Y    SYSTEM.10315.903036027
ASMCMD> rm SYSTEM.10315.903036027
ASMCMD> pwd
+DATA/erp1226/DATAFILE
ASMCMD> cd ..
ASMCMD> pwd
+DATA/erp1226
ASMCMD> ls
BACKUPSET/
CONTROLFILE/


Now start the Migration of erp1226 Db from filesystem to ASM:
================================================================

rman target / log rman_05Feb2018.log trace rman_05Feb2018.trc debug
set echo on;
debug on;

run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
allocate channel ch4 device type disk;
allocate channel ch5 device type disk;
allocate channel ch6 device type disk;
allocate channel ch7 device type disk;
backup as copy database format  '+DATA';
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
release channel ch7;
}


RMAN> exit

rman target /


RMAN> switch database to copy;



RMAN> alter database open;

Create the temporary tablespace and make it default

create temporary tablespace temp14 tempfile '+DATA03' size 30g;
alter database default temporary tablespace temp14;

drop tablespace temp12 including contents and datafiles;

set lines 200
col member for a60
select member,group# from v$logfile;
select group#,status from v$log;

Drop the unused groups and Drop the Thread2 groups

select group#,thread#,status from v$log;
alter system switch logfile;
alter database drop logfile group 12;


select group#,thread#,status from v$log;
alter database disable thread 2;
alter database drop logfile group 13;
alter database drop logfile group 14;


Verify and add groups:
select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         1          1 ACTIVE
         2          1 CURRENT
         3          1 UNUSED

alter database add logfile group 1 size 500m;
alter database add logfile group 6 size 500m;
alter database add logfile group 13 size 500m;
alter system switch logfile;

Drop the inactive group

SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         1          1 INACTIVE
         2          1 ACTIVE
         3          1 CURRENT
         4          1 UNUSED
         5          1 UNUSED
         6          1 UNUSED

6 rows selected.

 alter database drop logfile group 1;
alter system switch logfile;


Verify 3 Redo logs Groups exists.

SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         2          1 ACTIVE
         3          1 ACTIVE
         4          1 CURRENT
         5          1 UNUSED
         6          1 UNUSED


alter database open

Check the status of Redolog files and make sure all are active

select group#,thread#,status from v$log;
SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         2          1 INACTIVE
         3          1 INACTIVE
         4          1 CURRENT
         5          1 UNUSED
         6          1 UNUSED

SQL> alter database drop logfile group 2;

Database altered.

SQL> alter database drop logfile group 3;

Database altered.

SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         4          1 CURRENT
         5          1 UNUSED
         6          1 UNUSED

SQL> alter system switch logfile;

System altered.

SQL> select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
         4          1 ACTIVE
         5          1 CURRENT
         6          1 UNUSED

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
+DATA/erp1226/onlinelog/group_6.12953.903043737
+DATA/erp1226/onlinelog/group_6.12952.903043739
+DATA/erp1226/onlinelog/group_7.12951.903043757
+DATA/erp1226/onlinelog/group_7.12950.903043757
+DATA/erp1226/onlinelog/group_8.12949.903043759
+DATA/erp1226/onlinelog/group_8.12948.903043761
+DATA/erp1226/onlinelog/group_9.12947.903043763
+DATA/erp1226/onlinelog/group_9.12946.903043765
+DATA/erp1226/onlinelog/group_10.12945.903043767
+DATA/erp1226/onlinelog/group_10.12944.903043769
+DATA/erp1226/onlinelog/group_1.12963.903043559

MEMBER
--------------------------------------------------------------------------------
+DATA/erp1226/onlinelog/group_1.12962.903043561
+DATA/erp1226/onlinelog/group_2.12961.903043579
+DATA/erp1226/onlinelog/group_2.12960.903043581
+DATA/erp1226/onlinelog/group_3.12959.903043583
+DATA/erp1226/onlinelog/group_3.12958.903043583
+DATA/erp1226/onlinelog/group_4.12957.903043587
+DATA/erp1226/onlinelog/group_4.12956.903043589
+DATA/erp1226/onlinelog/group_5.12955.903043591
+DATA/erp1226/onlinelog/group_5.12954.903043593

20 rows selected.

select group#,status from v$log;

This completes the database restore and recovery.

Step 7 b:Post Clone Steps on Database node

Now the Database is up. We need to Source the Environment and complete the post clone steps.


a.Execute FND_CONC_CLEAN to cleanup nodes entries of source Database.( as 'apps' user)
                           exec fnd_conc_clone.setup_clean;

b.Run Autoconfig
$ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME
./adautocfg.sh


-bash-4.1$ ./adautocfg.sh
Enter the APPS user password:
The log file for this session is located at: /u01/erp1226/db/dbhome_1/appsutil/log/erp1226_host/02052136/adconfig.log

AutoConfig is configuring the Database environment...

AutoConfig will consider the custom templates if present.
        Using ORACLE_HOME location : /u01/erp1226/db/dbhome_1
        Classpath                   :

:/u01/erp1226/db/dbhome_1/jdbc/lib/ojdbc6.jar:/u01/erp1226/db/dbhome_1/appsutil/java/xmlparserv2.jar:/u01/erp1226/db/dbhom

e_1/appsutil/java:/u01/erp1226/db/dbhome_1/jlib/netcfg.jar:/u01/erp1226/db/dbhome_1/jlib/ldapjclnt11.jar

        Using Context file          : /u01/erp1226/db/dbhome_1/appsutil/erp1226_host.xml

Context Value Management will now update the Context file

        Updating Context file...COMPLETED

        Attempting upload of Context file and templates to database...COMPLETED

Updating rdbms version in Context file to db112
Updating rdbms type in Context file to 64 bits
Configuring templates from ORACLE_HOME ...

AutoConfig completed successfully.



c.Execute post clone script on Database for Data Masking


--VIMP check fnd_nodes uat-cm2
--Change the node name
update fnd_concurrent_queues set node_name='orace_erp_host' WHERE node_name in 'uat-CM2';
commit;

UPDATE XXerp_MISSN_CAPABILITY_DTLS set MISSION_CAP_STATUS_CODE = '1234';
commit;

--For Faster adcfgclone Execution
Execute package body APPS.WF_CLONE .


This completes the Database Cloning


(Note :Before starting application run cmclean.sql and than start applications )

Before starting Application cloning, modify FND Template as below for faster application tier cloning:
cd $FND_TOP/admin/driver/
vi fndtmpl.drv
txkWfClone.sh INSTE8_SETUP to txkWfClone.sh INSTALL_SETUP


Step 8: APPS CLONING:(erp1226 :12.2.5)
=======
Log on to the Run Edition File System in the Target System as the applmgr user and enter the following commands:
$ cd <COMMON_TOP>/clone/bin


cd /erpapp/erp1226/fs1/EBSapps/comn/clone/bin
total 561
-rwxr-xr-x   1 applmgr  dba         5101 Feb  2 15:22 adchkutl.sh
-rwxr-xr-x   1 applmgr  dba        95774 Feb  4 17:44 adclone.pl
-rwxr-xr-x   1 applmgr  dba        47194 Feb  4 17:44 adclonectx.pl
-rwxr-xr-x   1 applmgr  dba       125060 Feb  4 17:44 adcfgclone.pl
-rwxr-xr-x   1 applmgr  dba        10050 Feb  4 17:44 adaddnode.pl
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ pwd

*******NOTE BELOW STEP of adcfgclone should be done in VNC SESSION to avoid disconnection of session ***************

$ perl adcfgclone.pl appsTier dualfs

At the prompt:
"Do you want to add a node (yes/no)", enter the value as 'no'.
At the prompt:
"Target System Base Directory", enter the location of the base directory. =>/erpapp/erp1226
Provide:
the new port pools for the Run Edition File System and the Patch Edition File System need to be provided.



When asked the question:
"Do you want to startup the Application Services for <TWO_TASK>? (y/n)" you should answer 'y' if you do not need

to perform any further actions and 'n'  =>choose n

if there are other pending actions which need the Application services to be down.

Different logs are created for Run Edition and Patch Edition Cloning. The log files are created in the following

directories in the Run Edition File System:
<INST_TOP>/admin/log/clone/run
<INST_TOP>/admin/log/clone/patch



applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ pwd
/erpapp/erp1226/fs1/EBSapps/comn/clone/bin
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ uname -a
SunOS orace_erp_host 5.11 11.1 sun4v sparc sun4v
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ echo $TWO_TASK

You have new mail in /var/mail/applmgr
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ ls -ltr
total 561
-rwxr-xr-x   1 applmgr  dba         5101 Feb  2 15:22 adchkutl.sh
-rwxr-xr-x   1 applmgr  dba        95774 Feb  4 17:44 adclone.pl
-rwxr-xr-x   1 applmgr  dba        47194 Feb  4 17:44 adclonectx.pl
-rwxr-xr-x   1 applmgr  dba       125060 Feb  4 17:44 adcfgclone.pl
-rwxr-xr-x   1 applmgr  dba        10050 Feb  4 17:44 adaddnode.pl
applmgr@orace_erp_host:~/erp1226/fs1/EBSapps/comn/clone/bin$ perl adcfgclone.pl appsTier dualfs

                     Copyright (c) 2002, 2015 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 120.63.12020000.56

Enter the APPS password :

Enter the Weblogic AdminServer password :

Do you want to add a node (yes/no) [no] : no


Running: Context clone...

Log file located at /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContext_0205214743.log

Provide the values required for creation of the new APPL_TOP Context file.

Target System Hostname (virtual or normal) [orace_erp_host] :

Target System Database SID : erp1226

Target System Database Server Node [orace_erp_host] : host

Target System Database Domain Name [erpdom.local] :

Target System Base Directory : /erpapp/erp1226

Target System Base Directory set to /erpapp/erp1226

Target System Current File System Base set to /erpapp/erp1226/fs1

Target System Other File System Base set to /erpapp/erp1226/fs2

Target System Fusion Middleware Home set to /erpapp/erp1226/fs1/FMW_Home
Target System Other File System Fusion Middleware Home set to /erpapp/erp1226/fs2/FMW_Home

Target System Web Oracle Home set to /erpapp/erp1226/fs1/FMW_Home/webtier
Target System Other File System Web Oracle Home set to /erpapp/erp1226/fs2/FMW_Home/webtier

Target System Appl TOP set to /erpapp/erp1226/fs1/EBSapps/appl
Target System Other File System Appl TOP set to /erpapp/erp1226/fs2/EBSapps/appl

Target System COMMON TOP set to /erpapp/erp1226/fs1/EBSapps/comn
Target System Other File System COMMON TOP set to /erpapp/erp1226/fs2/EBSapps/comn

Target System Instance Home Directory [/erpapp/erp1226] :

Target System Base Directory set to /erpapp/erp1226

Target System Current File System Base set to /erpapp/erp1226/fs1

Target System Other File System Base set to /erpapp/erp1226/fs2

Target System Fusion Middleware Home set to /erpapp/erp1226/fs1/FMW_Home
Target System Other File System Fusion Middleware Home set to /erpapp/erp1226/fs2/FMW_Home

Target System Web Oracle Home set to /erpapp/erp1226/fs1/FMW_Home/webtier
Target System Other File System Web Oracle Home set to /erpapp/erp1226/fs2/FMW_Home/webtier

Target System Appl TOP set to /erpapp/erp1226/fs1/EBSapps/appl
Target System Other File System Appl TOP set to /erpapp/erp1226/fs2/EBSapps/appl

Target System COMMON TOP set to /erpapp/erp1226/fs1/EBSapps/comn
Target System Other File System COMMON TOP set to /erpapp/erp1226/fs2/EBSapps/comn

Target System Instance Home Directory [/erpapp/erp1226] :

Target System Current File System Instance Top set to /erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host

Do you want to preserve the Display [uat-cm2:0.0] (y/n)  : n

Target System Display [orace_erp_host:0.0] :

Target System Root Service [enabled] :

Target System Web Entry Point Services [enabled] :

Target System Web Application Services [enabled] :

Target System Batch Processing Services [enabled] :

Target System Other Services [disabled] :

Do you want the target system to have the same port values as the source system (y/n) [y] ? : n

Target System Port Pool [0-99] : 20

Checking the port pool 20
done: Port Pool 20 is free
Report file located at /erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host/admin/out/portpool.lst

UTL_FILE_DIR on database tier consists of the following directories.

1. /usr/tmp
2. /usr/tmp
3. /u01/app/oracle/product/11.2.0/dbhome_1/appsutil/outbound/
4. /u04/oradata/utl_dir
Choose a value which will be set as APPLPTMP value on the target node [1] :

Choose a value which will be set as APPLPTMP value on the target node [1] :
The new APPL_TOP context file has been created :
  /erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host/appl/admin/erp1226_orace_erp_host.xml
Check Clone Context logfile /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContext_0205214743.log for details.

Creating Patch file system context file.....

Log file located at /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0205215144.log

Target System Other File System Instance Top set to /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host

Target System Port Pool [0-99] : 21

Checking the port pool 21
done: Port Pool 21 is free
Report file located at /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host/admin/out/portpool.lst
The new APPL_TOP context file has been created :
  /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host/appl/admin/erp1226_orace_erp_host.xml
Check Clone Context logfile /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0205215144.log for details.

FMW Pre-requisite check log file location : /erpapp/erp1226/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: FMW pre-req check...

Configuring: Run file system....
LogFile located at /erpapp/erp1226/fs1/inst/apps/erp1226_erp3-dev-zc1/admin/log/clone/run/RCloneApplyAppstier_02052152.log



Checking the port pool 21
done: Port Pool 21 is free
Report file located at /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host/admin/out/portpool.lst
The new APPL_TOP context file has been created :
  /erpapp/erp1226/fs2/inst/apps/erp1226_orace_erp_host/appl/admin/erp1226_orace_erp_host.xml
Check Clone Context logfile /erpapp/erp1226/fs1/EBSapps/comn/clone/bin/CloneContextPatch_0205215144.log for details.

FMW Pre-requisite check log file location : /erpapp/erp1226/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: FMW pre-req check...

Configuring: Run file system....
LogFile located at /erpapp/erp1226/fs1/inst/apps/erp1226_erp3-dev-zc1/admin/log/clone/run/RCloneApplyAppstier_02052152.log

Configuring: Patch file system....
LogFile located at /erpapp/erp1226/fs1/inst/apps/erp1226_erp3-dev-

zc1/admin/log/clone/patch/RCloneApplyAppstier_02052237.log

AutoConfig has completed with errors for .patch

Do you want to startup the Application Services for erp1226? (y/n) [n] : n

Services not started


Step 9:Validation steps:
====================

applmgr@orace_erp_host:~/erp1226$ pwd
/erpapp/erp1226
applmgr@orace_erp_host:~/erp1226$ ls -ltr
total 23
drwxr-xr-x   5 applmgr  dba            5 Feb  5 21:55 fs1
drwxr-xr-x   4 applmgr  dba            4 Feb  5 22:19 fs_ne
drwxr-xr-x   5 applmgr  dba            5 Feb  5 23:17 fs2
-rw-r--r--   1 applmgr  dba         6465 Feb  5 23:36 EBSapps.env
applmgr@orace_erp_host:~/erp1226$ . EBSapps.env run

  E-Business Suite Environment Information
  ----------------------------------------
  RUN File System           : /erpapp/erp1226/fs1/EBSapps/appl
  PATCH File System         : /erpapp/erp1226/fs2/EBSapps/appl
  Non-Editioned File System : /erpapp/erp1226/fs_ne


  DB Host: host.erpdom.local  Service/SID: erp1226


  Sourcing the RUN File System ...




applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin$ cp tnsnames.ora

tnsnames.ora_05Feb2018bkup
applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin$ vi tnsnames.ora
applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin$ tnsping erp1226

TNS Ping Utility for Solaris: Version 10.1.0.5.0 - Production on 05-FEB-2018 23:56:33

Copyright (c) 1997, 2003, Oracle.  All rights reserved.

Used parameter files:
/erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin/sqlnet_ifile.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DEscRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=host.erpdom.local)(PORT=1541)) (CONNECT_DATA=

(SERVICE_NAME=erp1226) (INSTANCE_NAME=erp1226)))
OK (0 msec)
applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/ora/10.1.2/network/admin$ sqlplus apps

SQL*Plus: Release 10.1.0.5.0 - Production on Fri Feb 5 23:56:44 2018

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select name from v$database;

NAME
---------
erp1226

SQL> select status from v$instance;

STATUS
------------
OPEN




applmgr@orace_erp_host:~$ cd /erpapp/erp1226
applmgr@orace_erp_host:~/erp1226$ pwd
/erpapp/erp1226
applmgr@orace_erp_host:~/erp1226$ ls -ltr
total 23
drwxr-xr-x   5 applmgr  dba            5 Feb  5 21:55 fs1
drwxr-xr-x   4 applmgr  dba            4 Feb  5 22:19 fs_ne
drwxr-xr-x   5 applmgr  dba            5 Feb  5 23:17 fs2
-rw-r--r--   1 applmgr  dba         6465 Feb  5 23:36 EBSapps.env
applmgr@orace_erp_host:~/erp1226$ . EBSapps.env run

  E-Business Suite Environment Information
  ----------------------------------------
  RUN File System           : /erpapp/erp1226/fs1/EBSapps/appl
  PATCH File System         : /erpapp/erp1226/fs2/EBSapps/appl
  Non-Editioned File System : /erpapp/erp1226/fs_ne


  DB Host: host.erpdom.local  Service/SID: erp1226


  Sourcing the RUN File System ...



Step 10: Start the Target Applications after cloning 
======================================

a. Take a backup of context file
b. vi $CONTEXT_FILE
c. Change the load balancing related parameters
d. adstrtal.sh apps/<password>

Step 11:Post Cloning Steps on Application node:
=====================================

a)Change Logo

Upload the below logo to $OA_MEDIA/erp_logo.jpg

/erpapp/apps/apps_st/comn/java/classes/oracle/apps/media
-bash-4.1$ ls -ltr erp_sc.jpg
-rw-r--r--   1 applmgr  dba         6008 Mar 14  2014 erp_logo.jpg
-bash-4.1$ mv erp_logo.jpg erp_logo.jpg_old
-bash-4.1$ cp /erpapp/erp_sc.jpg .
-bash-4.1$ ls -ltr erp_logo.jpg
-rw-r--r--   1 applmgr  dba        16907 Apr 16 12:33 erp_logo.jpg


b)Execute below wfntfqup.sql from apps node:
==============================================

Disable Workflow Notification Mailer. Set the override address from OAM. Purge pending notifications.

sqlplus apps/apps @$FND_TOP/patch/115/sql/wfntfqup.sql apps apps applsys

cd $FND_TOP/patch/115/sql

cd /erpapp/apps/apps_st/appl/fnd/12.0.0/patch/115/sql/
sqlplus apps/apps

@wfntfqup.sql



-bash-4.1$ cd $FND_TOP/patch/115/sql/
-bash-4.1$ ls -l wfntfqup.sql
-rwxr-xr-x   1 applmgr  dba        11862 Oct 28  2010 wfntfqup.sql
-bash-4.1$ sqlplus apps

SQL*Plus: Release 10.1.0.5.0 - Production on Fri Jan 16 12:34:19 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> @wfntfqup.sql



Take backup of context file before configuring load balancing in APPS NODE

c) Change the URLs previously in Context File configured for Load Balancing in PROD and run autoconfig.

s_external_url http://erpdev.erp.ae:8020
s_login_page http://erpdev.erp.ae:8020/OA_HTML/AppsLogin
s_webentryhost erpdev
s_webentrydomain erp.ae



If we are working in Oracle SuperCluster Environment we need to start the application with the below commands:
=====================================================================================================================

We need to start the erpuat applications with 'clrg' command as 'root' user from APPS NODE1:


# clrg online cm-rg
# clrg online opmn-rg
#cluster status

(OR)
Source the Apps Environment.

cd $ADMIN_SCRIPTS_HOME
./adstral.sh

Step 12: Post clonning steps after Application Tier cloning. 

Changing password:
======================

a)system and sys database users:
----------------------------------

alter user system identified by welcome1;

alter user sys identified by welcome1;


FNDCPASS apps/welcome1 0 Y system/welcome1 SYSTEM APPLSYS new_pass


b)sysadmin password:
=========================

FNDCPASS apps/welcome1 0 Y system/welcome1 USER SYSADMIN welcome6

FNDCPASS apps/welcome1 0 Y system/welcome1 USER rafi welcome6


FNDCPASS apps/welcome1 0 Y system/welcome1 USER sysadmin Welcome789


c)Postclone steps for to clean up FND_NODES entries for concurrent Manager:
==========================

Execute cmclean.sql by connecting with 'apps' user.

To make sure all the Database and Applications service comes up smoothly follow below approach

Shut down the Application tier services.

On App node:
------------

cd $ADMIN_scRIPTS_HOME
./adstpall.sh


d) Execute autoconfig on apps node than on db node and than again on apps node

On DB node:
----------
cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME

./adautocfg.sh

On App node:
------------

cd $ADMIN_scRIPTS_HOME
./adautocfg.sh

ONLY if require do below steps:

C ) Update the Node information for all Concurrent Managers from Concurrent Manager Define to current node name and

Restart concurrent managers using adcmctl.sh


d) Postclone steps for discoverer:
====================================


1)Update Discoverer URL in Context File ( Application Tier - s_disco_url):


2)For Discoverer Copy the new DBC file and change the name in lower case on Discoverer Server


/erpapp/erp1226/fs1/inst/apps/erp1226_orace_erp_host/appl/fnd/12.0.0/secure

applmgr@orace_erp_host:~/erp1226/fs1/inst/apps/erp1226_orace_erp_host/appl/fnd/12.0.0/secure$ scp erp1226.dbc

oracle@198.17.18.142:/u01/app/oracle/Middleware/fmw11gr1/discodom_1/config/discovererr/discovererr_discodom_1
Password:
erp1226.dbc          100% |*********************************************************************************



e)Postclone steps for Colour change at site level:
===================================================

1) Change the profile options:
Site Name to “DEV Instance”
Java Color schme to a color which is not same as PROD


IN POST CLONE FOR UPGRADE ENV Please do cutom sync driver steps:

add Below to adop_sync.drv

applmgr@uat-cm2:/erpapp/ERP122_Source/upgrade/fs_ne/EBSapps/appl/ad/custom$ view adop_sync.drv
applmgr@uat-cm2:/erpapp/ERP122_Source/upgrade/fs_ne/EBSapps/appl/ad/custom$ pwd
/erpapp/ERP122_Source/upgrade/fs_ne/EBSapps/appl/ad/custom



f) Begin Customization

##Customization for erp
rsync -zr %s_current_base%/EBSapps/comn/java/classes/xxadat %s_other_base%/EBSapps/comn/java/classes
rsync -zr %s_current_base%/EBSapps/comn/java/classes/xxad %s_other_base%/EBSapps/comn/java/classes
rsync -zr %s_current_base%/EBSapps/comn/java/classes/xxerp %s_other_base%/EBSapps/comn/java/classes


#Copy Starts
mkdir -p %s_other_base%/EBSapps/comn/java/classes/com/excel4apps
rsync -zr %s_current_base%/EBSapps/comn/java/classes/com/excel4apps %s_other_base%/EBSapps/comn/java/classes/com
rsync -zr %s_current_base%/EBSapps/appl/xxe4a %s_other_base%/EBSapps/appl
rsync -zr %s_current_base%/EBSapps/appl/xxe4arw %s_other_base%/EBSapps/appl
rsync -zr %s_current_base%/EBSapps/appl/fnd/12.0.0/admin/template/custom %s_other_base

%/EBSapps/appl/fnd/12.0.0/admin/template
cp %s_current_base%/EBSapps/comn/java/classes/customall.jar %s_other_base%/EBSapps/comn/java/classes



*****Now Login in separate putty session,source the Envrionmement for APPS DEV and Start all the application services:


applmgr@orace_erp_host:~$ . APPSERPDEV_orace_erp_host.env
applmgr@orace_erp_host:~$ cd $ADMIN_scRIPTS_HOME
applmgr@orace_erp_host:~/inst/apps/ERPDEV_orace_erp_host/admin/scripts$ ./adstrtal.sh

You are running adstrtal.sh version 120.15.12010000.3




f)Postclone steps for Colour change at site level:
===================================================

Change the profile options:
Site Name to “DEV Instance”
Java Color scheme to a color which is not same as PROD



g) Validation steps  and Sanity checks after Doing ERP Cloning:
=============================================================

1)Check all the Concurrent managers are up and reduce the number of processes for Standard managers.

2)Submit the Active user or Active Responsibilities Concurrent request.

3)Check the discovererer URL for viewer and Desktop and share DBC file with team.

4)Make sure to verify logs after starting the ERP Applications


5)Submit Gather schema stats request for all schemas to improve performance of ERP applications


This completes clonning of Database and Applications for Oracle EBS 12.2 .

Enjoy Apps DBA Tasks...

Thanks,

Rafi

“Two useful technologies for working from anywhere – Cloud Desktop and Cloud SharePoint.”

https://www.apps4rent.com