The document describes how to create a copy of an Oracle E-Business Suite Release 12.2 system with Oracle Database 19c using Rapid Clone. It is applicable for cloning Oracle single-node as well as Oracle RAC databases.
1.1 Overview
On an Oracle E-Business Suite instance using Oracle Database
19c, the database is a multi-tenant container database with the Oracle
E-Business Suite database being plugged in as a pluggable database (PDB) into a
container database (CDB).
Note:
For Oracle E-Business Suite, the CDB can contain only a
single PDB.
The cloning process can be accomplished by the below 3 major
steps which include sub sections to complete entire Oracle E-Business Suite
Cloning (Application & Database).
- Prepare
Source Oracle E-Business Suite Instance for Cloning
- Clone and
Configure the Database Tier
- Clone and
Configure the Application Tier
1.2 Prerequisites
·
Standalone Database:
Section 2 of below doc:
Cloning Oracle
E-Business Suite Release 12.2 with Rapid Clone (Doc ID 1383621.1)
·
RAC Database:
Section 1 of below doc:
Cloning Oracle
E-Business Suite Release 12.2 RAC Enabled Systems with Rapid Clone (Doc ID
1679270.1)
Important:
We need to have our SOURCE system to be on AD-TXK
codelevel Delta 11 in order to have Oracle Database 19c with our Oracle
E-Business Suite instance.
You may use below queries to determine the
codelevels:
Query to determine the codelevel:
SQL> select * from AD_TRACKABLE_ENTITIES where
abbreviation like '%pf'
SQL> select abbreviation,name,codelevel,baseline
from AD_TRACKABLE_ENTITIES where abbreviation=('ad');
Query to determine the baseline:
Following select will tell you the R12 version:
SQL> select ‘RELEASE ‘||RELEASE_NAME from
APPLSYS.FND_PRODUCT_GROUPS;
Following select will tell you the products and
their corresponding baselines:
SQL> set pages 999
SQL> set long 9999
SQL> column BASELINE format a8
SQL> break on baseline
SQL> select BASELINE,upper(abbreviation),name
from AD_TRACKABLE_ENTITIES order by baseline,abbreviation;
SQL> SELECT app_short_name, MAX(patch_level)
FROM apps.ad_patch_driver_minipks GROUP BY app_short_name;
Section 1: Prepare Source Oracle
E-Business Suite Instance for Cloning
1.1 Prepare the Source System Database
Tier:
Ensure all processes in the source system are up
before proceeding with below steps.
To prepare the source system database tier for
cloning executed below steps:
1. As the oracle user, log on to the source
system.
2. Source the database tier environment file.
$ cd <ORACLE_HOME>
$ source <CONTEXT_NAME>.env
$ echo $CONTEXT_NAME
3. Execute the following commands:
$ cd
<ORACLE_HOME>/appsutil/scripts/<CONTEXT_NAME>
$ perl adpreclone.pl dbTier
4. Create an archive of the source system Oracle
home on the primary node:
$ cd $ORACLE_HOME/..
$ tar -cvzf rac_db_oh.tgz <DATABASE TOP
LEVEL DIRECTORY>
1.2 Prepare the Source System Application
Tier:
1. As the applmgr user, log on to the primary
node of the source system.
2. Source the environment file of the run edition
file system.
You can use the following command to confirm that
the environment variable FILE_EDITION points to the run edition file system:
$ echo $FILE_EDITION
Running this command should return the value:
run
3. Execute the following commands:
$ cd <INST_TOP>/admin/scripts
$ perl adpreclone.pl appsTier
Note:
If you apply a new Rapid Clone or AutoConfig
update to the system, you must run adpreclone.pl again on the database tier and
application tier to apply the new files into the clone directory structures to
be used during the cloning configuration stage. Furthermore, if you patch
Oracle Fusion Middleware or make configuration changes to the Oracle E-Business
Suite WebLogic Server domain, you must run adpreclone.pl again on the
application tier to rebuild the Oracle Fusion Middleware home.
The adpreclone.pl process on the application tier
creates the following files that collectively form a complete archive of the
Oracle Fusion Middleware components:
A compressed archive of the Oracle WebLogic Server home,
Oracle Web Tier Utilities home, Oracle common utilities home, and the Oracle
E-Business Suite home:
<COMMON_TOP>/clone/FMW/FMW_Home.jar
A compressed archive of the Oracle WebLogic Server domain:
<COMMON_TOP>/clone/FMW/WLS/EBSdomain.jar
The Oracle WebLogic domain's configuration template:
<COMMON_TOP>/clone/FMW/WLS/plan/moveplan.xml
A compressed archive of the Oracle Web Tier/Oracle HTTP
Server configuration instance:
<COMMON_TOP>/clone/FMW/OHS/ohsarchive.jar
The Oracle HTTP Server configuration instance's configuration
template:
<COMMON_TOP>/clone/FMW/OHS/moveplan.xml
Log files for the adpreclone operation are created in the
<INST_TOP>/admin/log/clone directory.
Section 2: Clone and Configure the
Database Tier
Note:
The steps in this section are applicable for both
single-node and Oracle RAC target databases
2.1.1 Copy the ORACLE_HOME archive from the source
system and uncompress it. Choose a suitable location, and rename the extracted
top-level directory name to something meaningful on the new target system.
$ tar -xvzf rac_db_oh.tgz
2.1.2 Create pairsfile.txt File
Create a <NEW_ORACLE_HOME>/appsutil/clone/pairsfile.txt
text file.
Note:
For single-node database, if you want to generate the context
file non-interactively, use the following content as shown:
Standalone (SingleNode)
s_undo_tablespace=<Source (PDB) system undo tablespace
name>
s_db_oh=<Location of new ORACLE_HOME>
s_dbhost=<Target hostname>
s_dbSid=<Target PDB name>
s_pdb_name=<Target PDB name>
s_cdb_name=<Target CDB SID>
s_base=<Base directory for DB Oracle Home>
s_dbuser=<DB User>
s_dbgroup=<DB group> (Not applicable on Windows)
s_dbhome1=<Data directory>
s_display=<Display>
s_dbCluster=false
s_isDBCluster=n
s_dbport=<DB port>
s_port_pool=<Port pool number>
Note:
If there are data tops other than the one defined in s_dbhome1,
they should be defined by adding the context variables s_dbhome2, s_dbhome3 and
s_dbhome4.
For the first node of an Oracle RAC database, use the
following content as shown:
RAC (MultiNode)
s_undo_tablespace=<Source (PDB) system primary instance
undo tablespace name>
s_dbClusterInst=<Total number of Instances in a cluster
e.g. 2>
s_db_oh=<Location of new ORACLE_HOME>
2.1.3 Create Context File
You will now run the adclonectx.pl utility to create a new
target context file, responding to the prompts as applicable.
Standalone (SingleNode)
2.1.3.1 Create the Context File for a Single-Node
Database
Execute the following commands when the target database is a
single-node database being cloned from a single-node source database.
$ cd <NEW ORACLE_HOME>/appsutil/clone/bin
$ perl adclonectx.pl \
contextfile=<Source database context file>\
template=<NEW
ORACLE_HOME>/appsutil/template/adxdbctx.tmp \
[pairsfile=<Pairs file generated in Section 4.1.2>]
Note:
A new and unique global database name (DB name) must be
selected when creating the new target system context file. Do not use the
source system global database name or sid name during any of the context file
interview prompts as shown in the following example.
If the pairsfile.txt file is not passed, you will be
presented with the following questions:
Provide the values required for creation of the new Database
Context file.
Target System Hostname (virtual or normal) [<Current
hostname] :
Do you want the inputs to be validated (y/n) [n] ? :
Target Instance is RAC (y/n) [n] : n
Target System CDB Name : <Name of the Container
database>
Target System PDB Name : <Name of the EBS PDB database>
Target System Base Directory : <Complete path to the base
directory for the target system>
Oracle OS User [<Current OS User>]] :
Oracle OS Group [<Current OS User group] :
Role separation is supported y/n [n] ? : <If the answer to
this prompt is 'y', enter values for the next two prompts also>
Specify value for OSOPER group [<Oracle OS Group>] :
Specify value for OSASM group [ ] :
Number of DATA_TOP's on the Target System [<Number of data
tops on the source database>] : <Number of data tops for the target
database>
Target System DATA_TOP Directory 1 [<data top
directory>] : <If there is more than one data top, there will be additional
prompts for the remaining data tops>
Specify value for OSBACKUPDBA group [<Oracle OS group>]
:
Specify value for OSDGDBA group [<Oracle OS group>] :
Specify value for OSKMDBA group [<Oracle OS group>] :
Specify value for OSRACDBA group [<Oracle OS group>] :
Target System RDBMS ORACLE_HOME Directory[]:
Do you want to preserve the Display [localhost:10.0] (y/n) :
n
Target System Display [<Target hostname>:0.0] :
Do you want the target system to have the same port values as
the source system (y/n) [y] ? : <If the answer to this prompt is 'n' or if
the source port pool is not free on the current node, enter the value for the
next prompt>
Target System Port Pool [0-99] : <Port pool>
New context path and file name
[<ORACLE_HOME>/appsutil/<CONTEXT_NAME>.xml] :
RAC (MultiNode)
2.1.3.2 Create the Context file for the Oracle RAC
Database Initial Node
Execute the following steps to create the context file for
the initial node of the target Oracle RAC database.
$ cd <NEW ORACLE_HOME>/appsutil/clone/bin
$ perl adclonectx.pl contextfile=<Source database
context file> \
template=<NEW
ORACLE_HOME>/appsutil/template/adxdbctx.tmp \
pairsfile=<Pairs file generated in Section 4.1.2>
initialnode
You will be presented with the following questions:
Target System Hostname (virtual or normal) [Current hostname]
:
Target System Base Directory : <Complete path to the base
directory for the target system>
Do you want the inputs to be validated (y/n) [n] ? :
Target Instance is RAC (y/n) [y] : y
Target System CDB Name : <Name of the Container database
(CDB)>
Target System PDB Name : <Name of the EBS PDB >
Do you want to enable SCAN addresses (y/n) [y] ? : <If y,
answer the next two questions>
Specify value for Scan Name : <Target system SCAN name, if
SCAN addresses enabled>
Specify value for Scan Port : <Target system SCAN port, if
SCAN addresses enabled>
Do you want the target system to have the same port values as
the source system (y/n) [y] ? : <If the answer to this prompt is 'n' or if
the source port pool is not free on the current node, enter the value for the
next prompt>
Target System Port Pool [0-99] : <Port pool>
Provide information for the initial RAC node:
Host name [<Current hostname>] :
Virtual Host name [null] : <Virtual hostname>
Instance number [1] : 1
Private interconnect name : <Private interconnect name>
Target System Base Directory : <Complete path to the base
directory for the target system>
Oracle OS User [<Current OS User>] :
Oracle OS Group [<Current OS User group>] :
Role separation is supported y/n [n] ? : <If the answer to
this prompt is 'y', enter values for the next two prompts also>
Specify value for OSOPER group [<Oracle OS Group>] :
Specify value for OSASM group [ ] :
Specify value for OSBACKUPDBA group [<Oracle OS Group>]
:
Specify value for OSDGDBA group [<Oracle OS Group>] :
Specify value for OSKMDBA group [<Oracle OS Group>] :
Specify value for OSRACDBA group [<Oracle OS Group>] :
Number of DATA_TOP's on the Target System [2] : 1
Target System DATA_TOP Directory 1 [<Source datatop
directory path>] : <Complete path to the data top directory on the target
node>
Do you want to preserve the Display [localhost:10.0] (y/n) :
Target System Display [<Target Hostname>:0.0] :
New context path and file name
[<ORACLE_HOME>/appsutil/<CONTEXT_NAME>.xml] :
Note:
If cloning to Oracle Automatic Storage Management (ASM), a
full path is required. For example, at the "Target System DATA_TOP
Directory 1" prompt, enter: +DATA/dbfile/VISION. This path must be
manually created on the ASM target system.
2.1.4 Configure the Database Technology Stack
Configure the database technology stack copied by running the
following steps:
1. Navigate to <ORACLE_HOME>/appsutil/clone/bin and run
Rapid Clone (adcfgclone.pl utility) with the following parameters to configure
the database technology stack:
$ perl adcfgclone.pl dbTechStack <Complete path to the
target context file>
Note:
The above command will also create the <s_outbound_dir>
directory. Hence, ensure that the value of the <s_outbound_dir> is
set correctly before running the above command.
If there is any issue with the directory creation in the
above step, review the issue to create the directory manually or to change the <s_outbound_dir>
context variable value as required.
2. If database role separation is implemented,
correct the permission/group of <ORACLE_HOME>/bin/oracle binary by
running the following commands as the grid user:
$ cd <Grid Home>/bin
$ ./setasmgidwrap -o <Target database Oracle
Home>/bin/oracle
2.1.5 Create the listener.ora and tnsnames.ora for the
Target Database
Create the listener.ora and tnsnames.ora files for the target
CDB by running the following commands:
1. Set the environment.
$ cd <ORACLE_HOME>/appsutil
$ source ./txkSetCfgCDB.env
-dboraclehome=<ORACLE_HOME>
2. Generate the listener.ora and tnsnames.ora.
$ cd <ORACLE_HOME>/appsutil/bin
$ perl txkGenCDBTnsAdmin.pl
-dboraclehome=<ORACLE_HOME> -cdbname=<Name of the target container
database> \
-cdbsid=<SID of the target container database>
-dbport=<Target DB port> -outdir=$ORACLE_HOME/appsutil/log \
-israc=<yes/no> [-virtualhostname=<virtual
hostname>]
where:
Parameter |
Description |
cdbname |
Name of the target container
database. |
cdbsid |
Oracle
SID of the target container database instance. o For single-node database, the
value is same as the cdbname. o For Oracle RAC database, it is
the Instance name of the target database. |
israc |
o Provide the value 'yes' for an
Oracle RAC database. o Provide the value 'no' for a
single-node database. |
virtualhostname |
Virtual
hostname for the Oracle RAC database. For a single-node database, this
parameter should not be used. |
3. Start the listener for the target container database as
follows:
$ cd
<ORACLE_HOME>/appsutil/scripts/<CONTEXT_NAME>
$ ./adcdblnctl.sh start <CDB SID>
Note:
In case the source Oracle E-Business Suite instance has
R12.TXK.C.DELTA.12 applied, the above commands may exit with status 1, waiting
for the PDB service to come up. This error can be ignored as the database is
not yet restored.
2.1.6 Restore and Start the Target Database
1. Copy and restore the database using RMAN as shown below:
@@@@@@@@@@ RMAN DATABASE CLONING @@@@@@@@@
We will follow below steps for RMAN database backup
restore:
Below are some commands and steps to restore database
using conventional RMAN restore steps:
Note:
These steps are to be performed on TARGET server and
before dropping the TARGET instance.
SQL> spool DB_NAME_bef_drop_DATE.txt
SQL> select instance_name,status,name,database_role,open_mode,
from gv$instance,gv$database;
SQL> select name from v$datafile order by file#;
SQL> select name from v$controlfile;
SQL> select member from v$logfile;
SQL> select file_name from dba_temp_files;
SQL> archive log list;
SQL> show parameter dump;
SQL> show parameter spfile;
---Control file trace
SQL> alter database backup controlfile to trace as
'PATH/cntrl/before_drp/cntrl.txt';
SQL> create pfile='PATH/pfile_DB_NAME.ora' from spfile;
SQL> spool off
Drop TARGET database:
edit pfile and make .cluster_database=FALSE
---- To drop RAC database
Shut down RAC database and then follow below steps:
$ srvctl status database -d DBNAME -v
$ srvctl stop database -d DBNAME
$ srvctl status database -d DBNAME -v
SQL> startup mount restrict
pfile='PATH/pfile_DB_NAME.ora';
SQL> select
instance_name,status,name,database_role,open_mode, from gv$instance,gv$database;
SQL> show parameter spfile;
SQL> drop database;
Note:
Please keep the alert log open to monitor database drop.
Login to asm and check the diskgroups for the
datafiles,controlfiles,parameter files, redo logs, temp files,
They should be empty as the database has been ddropped.
Edit the above created pfile with DB_NAME='PROD'
$ export ORACLE_SID=PROD
$ sqlplus / as sysdba
SQL> startup nomount pfile='PATH/pfile_DB_NAME.ora';
SQL> select instance_name from v$instance;
Restore controlfile from backup piece:
$ rman target /
rman> restrore controlfile from 'CNTRL_FILE_BKP_PIECE';
$ sqlplus / as sysdba
SQL> select instance_name from v$instance;
SQL> alter database mount;
SQL> select name,open_mode from v$database;
Catalog backup pieces:
$ rman target /
rman> catalog start with 'BKP_PIECE_PATH';
Set new name command on TARGET node after mount:
$ sqlplus / as sysdba
SQL> select name,open_mode from v$database;
SQL> set page size 900
SQL> set line size 900
SQL> select ' set newname for datafile ' || '' || FILE#
|| '' || ' to ''+DISK_GRP' ||reverse
(substr(reverse(name),0,instr(reverse(name),'/')-1)) || ''';' from v$datafile;
The above command will set the new name for the datafiles
as per TARGET node env, Copy the output and paste it in the run block.
restore the database using set new name run block:
Eg:
{
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;
set new name output paste here
restore database;
switch datafile all;
recover database;
release channel ch1 device type disk;
release channel ch2 device type disk;
release channel ch3 device type disk;
release channel ch4 device type disk;
}
Check rman restore progress using below commands:
TTITLE LEFT '% Completed. Aggregate is the overall
progress:'
SET LINE 132
SELECT opname, round(sofar/totalwork*100) "% Complete"
FROM gv$session_longops
WHERE opname LIKE 'RMAN%'
AND totalwork != 0
AND sofar <> totalwork
ORDER BY 1;
TTITLE LEFT 'Channels waiting:'
COL client_info FORMAT A15 TRUNC
COL event FORMAT A20 TRUNC
COL state FORMAT A7
COL wait FORMAT 999.90 HEAD "Min waiting"
SELECT s.sid, p.spid, s.client_info, status, event, state,
seconds_in_wait/60 wait
FROM gv$process p, gv$session s
WHERE p.addr = s.paddr
AND client_info LIKE 'rman%';
TTITLE LEFT 'Files currently being written to:'
COL filename FORMAT a50
SELECT filename, bytes, io_count
FROM v$backup_async_io
WHERE status='IN PROGRESS'
/
Once recovery done, backup the control file to trace:
SQL> alter database backup controlfile to trace as
'PATH/cntrl/after_restore/cntrl.txt';
SQL> select name,free_mb,total_mb from v$asm_diskgroup;
SQL> select name,open_mode from v$database;
SQL> shutdown immediate
Change the DB_NAME in pfile to the instance that you are
cloning to.
Login to asm:
Take bkp of all the existing control files then, remove
them and follow below steps:
From the control file trace modify the control file as per
the requirement.
$ export ORACLE_SID=INST_NAME
$ sqlplus / as sysdba
SQL> startup nomount pfile='PATH/pfile_DB_NAME.ora';
SQL> select instance_name from v$instance;
SQL> @run_cntrl.txt
----
Modified trace file run
SQL> select name,open_mode,log_mode from v$database;
SQL> alter database open resetlogs;
Note:
Keep the alert log open and check which temp tablespaces
are empty and add temp files accordingly.
Add temp files:
SQL> alter tablespace TEMP1 add temp files '+DISK_GROUP'
size 4G;
SQL> alter tablespace TEMP2 add temp files
'+DISK_GROUP' size 4G;
SQL> select name,open_mode,log_mode from v$database;
SQL> shutdown immediate
Edit pfile and make .cluster_database=TRUE
---- To enable RAC database
$ export ORACLE_SID=INST_NAME
SQL> startup nomount pfile='PATH/pfile_DB_NAME.ora';
SQL> select instance_name from v$instance;
SQL> alter database mount;
SQL> alter database open;
SQL> select name,open_mode,log_mode from v$database;
SQL> select
instance_name,status,name,database_role,open_mode, from gv$instance,gv$database;
SQL> select INST_ID,group#,thread#,members,bytes from
gv$log;
SQL> select INST_ID,group#,member from gv$logfile;
If required enable thread:
SQL> alter database enable public thread 2;
Create spfile from pfile:
SQL> select instance_name,status,name,database_role,open_mode,
from gv$instance,gv$database;
SQL> create spfile='+DISK_GROUP' from
pfile='PATH/pfile_DB_NAME.ora';
SQL> shutdown immediate
Start the RAC database:
$ srvctl status database -d DBNAME -v
$ srvctl start database -d DBNAME
$ srvctl status database -d DBNAME -v
Start the new target RAC database in open mode.
Run the library update script against
the RAC database.
$ cd [RDBMS ORACLE_HOME]/appsutil/install/[CONTEXT_NAME]
$ sqlplus "/ as sysdba" @adupdlib.sql [libext]
Where [libext] should be set to 'sl' for HP-UX, 'so' for
any other UNIX platform, or 'dll' for Windows.
2. Set the environment variable ORACLE_SID to the CDB SID as
follows:
$ export ORACLE_SID=<CDB SID>
3. If the Target PDB name needs to be changed to a value
different from the Source PDB Name, perform the following steps:
Verify if any service already exists with the Target PDB
name.
Run the following commands:
$ sqlplus / as sysdba
SQL> alter session set container="<SOURCE
PDB_NAME>";
SQL> select count(*) from cdb_services c, service$ s
where upper(s.name) = upper('<TARGET PDB_NAME>')
and s.deletion_date is null
and s.name = c.name;
If any service already exists with the Target PDB name,
delete it as follows:
$ sqlplus / as sysdba
SQL> alter session set container="<SOURCE
PDB_NAME>";
SQL> dbms_service.delete_service('<TARGET
PDB_NAME>');
Run the following steps to rename the PDB.
$ sqlplus / as sysdba
SQL> alter pluggable database "<SOURCE PDB
NAME>" close;
SQL> alter pluggable database "<SOURCE PDB
NAME>" unplug into '<ORACLE_HOME>/dbs/<SOURCE PDB
NAME>.xml';
SQL> drop pluggable database "<SOURCE PDB
NAME>";
SQL> create pluggable database "<TARGET PDB
NAME>" using '<ORACLE_HOME>/dbs/<SOURCE PDB NAME>.xml'
NOCOPY SERVICE_NAME_CONVERT=('ebs_<SOURCE PDB NAME>','ebs_<TARGET PDB
NAME>');
SQL> alter pluggable database "<TARGET PDB
NAME>" open read write;
Note:
The PDB should be renamed only using the above approach to
retain the case of the PDB name.
4. Startup the PDB and save its state by running the
following commands:
$ sqlplus / as sysdba
SQL> alter pluggable database all open; (in case of a
single-node database)
SQL> alter pluggable database all open instances=all;
(in case of an Oracle RAC database)
SQL> alter pluggable database all save state
instances=all;
5. Run the library update script against the Oracle database.
$ cd <ORACLE_HOME>/appsutil/install/<CONTEXT_NAME>
$ sqlplus / as sysdba @adupdlib.sql <libext>
Where <libext> should be set to sl for HP-UX, so for
any other UNIX platform, or dll for Windows.
Note:
If the Grid listener is being used with the database, edit
the <GRID ORACLE_HOME>/network/admin/listener.ora file to add the
following parameter: USE_SID_AS_SERVICE_<LISTENER_NAME>=ON and reload the
listener. This step is required to ensure that database connections are
established successfully with multitenant database. This setting will not work
with non-multitenant databases. Hence, if the grid listener is being used,
ensure that no other non-multi-tenant databases are using the same Grid
listener.
2.1.7 Set the Target UTL_FILE_DIR Values in Oracle
Database
Perform the following steps to set the target UTL_FILE_DIR
values in the database.
1. Source the environment file.
$ cd <ORACLE_HOME>
$ source <CONTEXT_NAME>.env
2. Obtain the existing value for the UTL_FILE_DIR using the
following commands:
$ perl
<ORACLE_HOME>/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=<DB
Context File> \
-oraclehome=<ORACLE_HOME>
-outdir=<ORACLE_HOME>/appsutil/log -mode=getUtlFileDir
This will create a text file <DB_NAME>_utlfiledir.txt
under the <ORACLE_HOME>/dbs directory with references to the target
Oracle home.
3. Review the <DB_NAME>_utlfiledir.txt directory and
edit the values, if required.
4. Execute the following command to store the updated values
for UTL_FILE_DIR in the database:
$ cd <ORACLE_HOME>/appsutil/bin
$ perl
<ORACLE_HOME>/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=<DB
Context File> \
-oraclehome=<ORACLE_HOME>
-outdir=<ORACLE_HOME>/appsutil/log \
-mode=setUtlFileDir
This command will validate the directory paths provided in
the <DB_NAME>_utlfiledir.txt for existence and will also create directory
objects for all the physical directory paths.
5. Execute the below command to create the directory object
for the outbound directory (pointed to by the s_outbound_dir context variable
in the database tier context file).
$ perl
<ORACLE_HOME>/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=<DB
Context File> \
-oraclehome=<ORACLE_HOME>
-outdir=<ORACLE_HOME>/appsutil/log -mode=createDirObject
When prompted for the OS path for the directory object to be
created, enter the value of the s_outbound_dir context variable in the database
tier context file.
6. Sync up the value of UTL_FILE_DIR in the database tier
context file by running the following command:
$ perl
<ORACLE_HOME>/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=<DB
Context File> \ -oraclehome=<ORACLE_HOME>
-outdir=<ORACLE_HOME>/appsutil/log -mode=syncUtlFileDir \
-skipautoconfig=yes
2.1.8 Configure the Target Database
Execute the adcfgclone utility to configure the target
database.
$ cd <ORACLE_HOME>/appsutil/clone/bin
$ perl adcfgclone.pl dbconfig <Target Database context
file>
The target database context file is
<ORACLE_HOME>/appsutil/<Target context_name>.xml.
Note:
The dbconfig option will configure the database with the
required settings for the new target, but it will not recreate the control
files.
2.2 Clone and Configure the Target System Secondary
Database Nodes (Clone Additional Nodes)
2.2 Clone and Configure the Target System Secondary Database
Nodes (Clone Additional Nodes)
This section is optional as it only applies when the target
database is an Oracle RAC database.
Use the following steps to clone the secondary nodes (for
example, Node 2) on to the target system.
2.2.1 Add Secondary Oracle RAC Node Information to
sqlnet.ora
This is a two-node Oracle RAC example.
1. Go to the primary node and add the secondary node information
to the sqlnet.ora file:
RAC node 1: host1.example.com
RAC node 1 vip:
host1-vip.example.com
RAC node 2:
host2.example.com
RAC node 2 vip:
host2-vip.example.com
2. Open the
$ORACLE_HOME/network/admin/<context>/sqlnet.ora file for editing, and add
the Oracle RAC Node 2 information by changing the line shown.
FROM:
tcp.invited_nodes=(host1.example.com, host1-vip.example.com)
TO:
tcp.invited_nodes=(host1.example.com, host1-vip.example.com, host2.example.com,
host2-vip.example.com)
3. Then reload the listener to reflect the change.
Note:
The host1 entries should be already there in the sqlnet.ora
after a successful clone of Oracle RAC Node 1.
2.2.2 Uncompress the Archived ORACLE_HOME Transferred
from Source System
Uncompress the source system ORACLE_HOME archive to a
location matching that on your target system primary node. The directory
structure should match that present on the newly created target system primary
node.
$ tar -xvzf rac_db_oh.tgz
2.2.3 Archive <ORACLE_HOME>/appsutil Directory
Structure from New Primary Node
Log in to the new target system primary node, and run the
following commands:
$ cd <ORACLE_HOME>
$ zip -r appsutil_node1.zip appsutil
2.2.4 Copy appsutil_node1.zip to the Secondary Target
Node
Transfer and then expand the appsutil_node1.zip into the
secondary target Oracle RAC node <NEW ORACLE_HOME>.
$ cd <NEW ORACLE_HOME>
$ unzip -o appsutil_node1.zip
2.2.5 Update pairsfile.txt for Secondary Target Node
Alter the existing pairsfile.txt (from the first target node)
and change the s_undo_tablespace parameter.
The <NEW_ORACLE_HOME>/appsutils/clone/pairsfile.txt
will look like this example:
s_undo_tablespace=<Source system secondary node undo
tablespace name>
s_dbClusterInst=<Total number of Instances in a cluster
e.g. 2>
s_db_oh=<Location of new ORACLE_HOME>
2.2.6 Create Context File for Secondary Node
Navigate to <ORACLE_HOME>/appsutil/clone/bin and run
the adclonectx.pl utility as follows:
$ cd <ORACLE_HOME>/appsutil/clone/bin
$ perl adclonectx.pl \
contextfile=<Full Path to Existing Context File on First
Node> \
template=<ORACLE_HOME>/appsutil/template/adxdbctx.tmp \
pairsfile=<ORACLE_HOME>/appsutil/clone/pairsfile.txt
addnode
Where:
Parameter |
Description |
contextfile |
Absolute path to
the existing context file from the first (primary) node. |
template |
Absolute path to
the existing database context file template. |
pairsfile |
Absolute path to
the pairsfile created in last step. |
Several of the interview prompts are the same as on Node 1.
However, there are some new questions which are specific to the
"addnode" option used when on the second node.
Note:
When answering the following questions, review your responses
carefully before entering them. The rest of the inputs (not shown) are the same
as those encountered during the context file creation on the initial node
(primary node).
Target Instance is RAC (y/n) [y] : y
Please provide the details to connect to one of live RAC
nodes
Host name of the live RAC node : <Hostname of RAC Node
1>
Domain name of the live RAC node : <Domain name of RAC
Node 1>
Database SID of the live RAC node : <PDB name>
Listener port number of the live RAC node : <Database
Listener port of RAC Node 1>
Provide information for the new Node:
Host name :
Virtual Host name : <Virtual hostname of current node>
Instance number : 2
Private interconnect name : <Private interconnect name>
Current Node:
Host Name : <Current hostname>
SID : <PDB Name>
Instance Name : <CDB Instance name>
Instance Number : 2
Instance Thread : 2
Undo Table Space: <Undo tablespace name, if set>
Listener Port : <DB Listener port provided in above
prompt>
Notes:
At the conclusion of these "interview" questions
related to the context file creation, look carefully at the generated context
file and ensure that the values contained therein compare to the values entered
during context file creation on Node 1. The values should be almost identical,
a small but important exception being the local instance name will have a
number 2 instead of a 1.
The value of the context variables s_db_util_filedir,
s_ecx_log_dir, s_bis_debug_log_dir, and s_outbound_dir will be retained from
Node 1. Hence, review these directory paths and ensure that these directories
are accessible on the current node.
Verify that the value of the context variable
s_undotablespace is set correctly in the context file. If not, you must edit it
manually.
2.2.7 Configure Oracle Home
Run the commands below to move to the correct directory and
continue the cloning process:
$ cd <ORACLE_HOME>/appsutil/clone/bin
$ perl adcfgclone.pl dbTechStack <Full path to the
database context file created in previous step>
Note:
Ensure to add the following line in your sqlnet_ifile.ora
after the adcfgclone.pl execution completes:
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 10 (since SEC_CASE_SENSITIVE_LOGON is set
to TRUE)
Note:
If this secondary node uses Oracle ASM with database job role
separation, run the following commands as the grid user to set correct
permissions and group for the oracle executable in the database Oracle home.
$ cd <Grid Home>/bin
$ ./setasmgidwrap o=<ORACLE_HOME>/bin/oracle
2.2.8 Create the listener.ora and tnsnames.ora Files
for the Target CDB
Create the listener.ora and tnsnames.ora files for the target
CDB by running the following commands:
$ cd <ORACLE_HOME>/appsutil
$ source ./txkSetCfgCDB.env
-dboraclehome=<ORACLE_HOME>
$ cd <ORACLE_HOME>/appsutil/bin
$ perl txkGenCDBTnsAdmin.pl
-dboraclehome=<ORACLE_HOME> -cdbname=<Name of the target container
database> \
-cdbsid=<SID of the target container database>
-dbport=<Target DB port> -outdir=$ORACLE_HOME/appsutil/log \
-israc=<yes/no> [-virtualhostname=<virtual hostname>]
Where:
Parameter |
Description |
cdbname |
Name of the
target container database |
cdbsid |
Oracle SID of the target CDB instance.
|
israc |
|
virtualhostname |
Virtual hostname for the Oracle RAC database. For a single-node
database, this parameter should not be used. |
The files that are a result of running the previous command
are created in the <ORACLE_HOME>/network/admin directory. Once this is
complete, start the listener for the target CDB.
2.2.9 Source the New Environment File in ORACLE_HOME
Run the commands below to move to the correct directory and
source the environment:
$ cd <NEW ORACLE_HOME>
$ source <CDB_SID>_<Hostname>.env
2.2.10 Start the Oracle RAC Database
Create the init file or spfile for the secondary database
node, as desired.
Start the target container database using the following
commands:
$ export ORACLE_SID=<CDB SID>
$ sqlplus / as sysdba
SQL> startup
Startup the pluggable database and save its state by running
the following command:
$ export ORACLE_SID=<CDB SID>
$ sqlplus / as sysdba
SQL> alter pluggable database all open instances=all;
(if an Oracle RAC database)
SQL> alter pluggable database all save state
instances=all;
2.2.11 Set the UTL_FILE_DIR value
1. Execute the following command to create the directory
object for the outbound directory (pointed to by the s_outbound_dir context
variable in the database tier context file).
$ cd <ORACLE_HOME>
$ source <CONTEXT_NAME>.env
$ perl
<ORACLE_HOME>/appsutil/bin/txkCfgUtlfileDir.pl
-contextfile=<CONTEXT_FILE> \
-oraclehome=<ORACLE_HOME>
-outdir=<ORACLE_HOME>/appsutil/log -mode=createDirObject
When prompted for the OS path for the directory object to be
created, enter the value of the s_outbound_dir context variable in the database
tier context file.
Note:
Ensure that the directory path set for the s_outbound_dir
value already exists on the node. If not, create the directory before running
the above step.
2.Sync up the value of UTL_FILE_DIR in the database tier
context file by running the following command:
$ perl
<ORACLE_HOME>/appsutil/bin/txkCfgUtlfileDir.pl
-contextfile=<CONTEXT_FILE> \
-oraclehome=<ORACLE_HOME>
-outdir=<ORACLE_HOME>/appsutil/log -mode=syncUtlFileDir \
-skipautoconfig=yes
2.2.12 Execute AutoConfig
Run AutoConfig to generate the correct listener.ora and
tnsnames.ora files:
$ cd
<ORACLE_HOME>/appsutil/scripts/<CONTEXT_NAME>
$ ./adautocfg.sh
If AutoConfig fails and you see any type of "TNS"
errors in the AutoConfig log files, you should ensure the listeners are
registered properly. After doing so, re-run AutoConfig on the second node.
2.2.13 Carry Out Target System (Primary Node) Final
Oracle RAC Configuration Tasks
2.2.14.1 Recreate the listener.ora and tnsnames.ora Files
Log in to the target primary node (Node 1) and run AutoConfig
to perform the final Oracle RAC configuration. Create a new listener.ora and
tnsnames.ora file for the PDB. This is needed as the FND_NODES table did not
contain the second node host name until AutoConfig was run on the secondary
target Oracle RAC node.
$ cd
<ORACLE_HOME>/appsutil/scripts/<CONTEXT_NAME>
$ ./adautocfg.sh
Note:
This AutoConfig run on the primary target Oracle RAC Node 1
will add the second Oracle RAC Node connection information to the first node's
tnsnames.ora, such that listener load balancing can occur. If you have more
than two nodes in your new target system cluster, you must repeat Section 4.2
and Section 4.3 for all subsequent nodes.
Section 5: Clone and Configure the
Application Tier
5.1 Copy the Application
Tier File System from the Source Node to the Target Node
Configure
Application Tier:
Cleanup TARGET application tier file system
Note:
If any of the above ORACLE_HOME entries are already
registered in Oracle Inventory, run the following command to de-register or
detach that ORACLE_HOME:
$ ./runInstaller -detachhome
ORACLE_HOME=<Oracle Home Location> [-invPtrLoc <s_invPtrLoc>]
Here,
-invPtrLoc argument needs to be specified only if
the 'EBS installation central' inventory is being used.
s_invPtrLoc is the context variable that stores the
inventory pointer location.
For example:
$ cd
/u02/r122/fs1/FMW_Home/oracle_common/oui/bin
$ ./runInstaller -detachhome \
ORACLE_HOME=/s0/r122/at1/FMW_Home/oracle_common
-silent
Remove application directory structure from under
$RUN_BASE and $PATCH_BASE in the target application tier system.
Untar the tar backup of SOURCE Application tier and
then proceed with configuration.
$ nohup tar -xvzf
/backup/apps_<date>3.tar.gz &
Note:
In Release 12.2, you can set the base directory to
any desired location. However, the subdirectory structure cannot be changed
because of dependencies on both the WLS domain and the dual file system
required for online patching. Also, the base directory must be the same across
all nodes in multi-node configurations.
Note:
As Rapid Clone will create a replica of the source
node, if the source run edition file system is the first file system (fs1),
the target run edition file system will also be the first file system (fs1).
Similarly, if the source run edition file system is the second file system (fs2),
then the target run edition file system will also be the second file system (fs2).
Therefore, when you perform a cloning task, you always clone and copy the
source run edition file system to create the target run edition file system,
but the directory location of the run edition file system can be pointing
either to <s_base>/<sid>/fs1 or <s_base>/<sid>/fs2 based
on the source run edition file system base directory.
When copying the files, use the values of $RUN_BASE
and $PATCH_BASE variables to determine if the run edition file system should be
copied to fs1 or fs2.
For example, the source run edition file system has
the following values:
$RUN_BASE=/u01/122/prod/fs2
$PATCH_BASE=/u01/122/prod/fs1
The target <s_base> directory will be
/d05/test. Copy the source run edition file system into the target
/d05/test/fs2 directory to initially act as run edition file system.
$ perl adcfgclone.pl
appsTier dualfs
When prompted for the following, answer
as shown:
"Do you want to add a node
(yes/no)", enter a value of 'no'.
Target System Database SID, enter the
name of the EBS pluggable database.
"Target System Base
Directory", enter the location of the base directory. For example:
/u02/r122.
Provide the new port pools for the run
edition file system and the patch edition file system.
"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' 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. 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
Report file located at /test/applebs/inst/fs1/inst/apps/CLOVER_<hostname>/admin/out/portpool.lst
The new APPL_TOP context file has been created:
/test/applebs/inst/fs1/inst/apps/CLOVER_tstebd01/appl/admin/CLOVER_<hostname>.xml
Check Clone Context logfile
/test/applebs/apps/fs2/EBSapps/comn/clone/bin/CloneContextPatch_0226120637.log
for details.
FMW Pre-requisite check log file location:
/test/applebs/apps/fs2/EBSapps/comn/clone/FMW/logs/prereqcheck.log
Running: FMW pre-req check...
Configuring: Run file system....
LogFile located at
/test/applebs/inst/fs2/inst/apps/CLOVER_tstebd01/admin/log/clone/run/RCloneApplyAppstier_02261206.log
Configuring: Patch files system....
LogFile located at
/test/applebs/inst/fs2/inst/apps/CLOVER_tstebd01/admin/log/clone/patch/RCloneApplyAppstier_02261303.log
Do you want to startup the Application Services for
CLOVER? (Y/n) [n] : y
Important:
If adcfglone fails on application tier ensure
ORACLE_HOMES are not already registered in the Oracle inventory.
If it is registered, please follow below steps:
In the event of failure of Rapid Clone during
execution of adcfgclone, the following steps need to be performed before
restarting adcfgclone execution on the application tier:
On application tier:
1. De-register the Oracle Homes on both Run Edition
and Patch Edition file system:
Verify if Oracle Inventory contains the following
Oracle Home entries for the Run Edition or Patch Edition file system:
<FMW_HOME>/oracle_common
<FMW_HOME>/webtier
<FMW_HOME>/Oracle_EBS-app1
If any of the above Oracle Home entries are already
registered in Oracle Inventory, you can run the following command to
de-register or detach that Oracle Home:
$ ./runInstaller -detachhome \
ORACLE_HOME=<Oracle Home
Location> [-invPtrLoc <s_invPtrLoc>]
Here,
-invPtrLoc argument needs to be specified only if
an 'EBS Installation Central' inventory is being used.
s_invPtrLoc is the context variable that stores the
inventory pointer location.
For example:
$ cd
/u02/r122/fs1/FMW_Home/oracle_common/oui/bin
$ ./runInstaller -detachhome \
ORACLE_HOME=/s0/r122/at1/FMW_Home/oracle_common
2. If the FMW_HOME directory structure exists,
delete it as follows:
$ rm -rf <FMW_HOME>
For multi node Application cloning refer below:
https://maharshitrivedidba.blogspot.com/2021/05/cloning-multi-node-oracle-apps-r122x.html
Implement Load Balancing for Oracle E-Business
Suite database connections
The following steps should be run on all
Application tier nodes to implement load balancing across the Oracle E-Business
Suite database connections:
Using the Context Editor (via the Oracle
Applications Manager interface), modify the variables in the Run file system
context file as follows:
To load-balance the Oracle Forms database
connections, set the value of "Tools OH TWO_TASK" (s_tools_twotask)
to point to the ebs_<s_dbSid>_balance alias generated in the tnsnames.ora
file.
To load-balance the Self-Service (HTML-based)
database connections, set the value of "iAS OH TWO_TASK"
(s_weboh_twotask) and "Apps JDBC Connect Alias" (s_apps_jdbc_connect_alias)
to point to the ebs_<s_dbSid>_balance alias generated in the tnsnames.ora
file.
Execute AutoConfig on Run file system by running
the command:
$ sh <AD_TOP>/bin/adconfig.sh
contextfile=<CONTEXT_FILE>
Restart the Oracle E-Business Suite processes using
the new scripts generated by AutoConfig.
Ensure that the value of the profile option
"Application Database ID" is set to the dbc file name generated in
$FND_SECURE.
Reference:
Cloning Oracle E-Business Suite Release 12.2 with Multitenant Database
using Rapid Clone (Doc ID 2552208.1)
https://maharshitrivedidba.blogspot.com/2021/05/cloning-oracle-apps-r122x-rac-2.html
https://maharshitrivedidba.blogspot.com/2021/05/cloning-multi-node-oracle-apps-r122x.html
https://maharshitrivedidba.blogspot.com/2021/05/enable-rac-configurations-on-oracle.html
https://maharshitrivedidba.blogspot.com/2021/06/cloning-oracle-e-business-suite-release_1.html
No comments:
Post a Comment