Oracle EBS 12.2 cloning with version 19c Database
This post discusses the process of step-by-step cloning with on-premise Oracle® E-Business Suite (EBS) R12.2 on a version 19c Database by using Recovery Manager (RMAN) Hot backup on Linux OS servers. These steps also apply to different operating systems.
EBS CloningTo perform EBS
cloning, you need to complete the following high-level steps:
1. Run a
pre-clone utility on the source database and application nodes.
2. Back up the full Container Database (CDB) database with archives by using
RMAN Hot backup and copy it to the target node.
3. Clean up the target database and application node.
4. Copy the source application binaries and database binaries to the target
node.
5. Configure $ORACLE_HOME on the target database node.
6. Restore and recover the databases.
7. Perform post-restore steps on the Target database node.
8. Configure the application on the target application node.
9. Perform post-clone steps on the application node.
10. Start the target application services.
Here are the
steps in detail:
1. Run
pre-clone utility
a. Run the
following commands to source the pluggable database (PDB) environment file on
the database node at $ORACLE_HOME:
cd $ORACLE_HOME
. <PDB_NAME>_hostname.env
cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME
perl adpreclone.pl dbTier
b. Run the
following commands on the application node:
EBSApps run (Source RUN FS)
cd $ADMIN_SCRIPTS_HOME
perl adpreclone.pl appsTier
2. Back up the
CDB
Back up the
full CDB database with archives by using RMAN Hot backup and copy it to the
target node:
a. Run the
following commands to source the CDB environment file at $ORACLE_HOME:
cd
$ORACLE_HOME
. <CDB_NAME>_hostname.env
connect target /
b. Run
the following commands to complete this step:
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;
BACKUP as
compressed backupset FULL FILESPERSET 10 FORMAT '<Backup
location>/<SID>_bk_%s_%p_%t.bak' DATABASE;
BACKUP as compressed backupset filesperset 10 FORMAT
'<Backup location>/<SID>_arch_%s_%p_%t.bak' ARCHIVELOG ALL skip
inaccessible;
BACKUP FORMAT '<Backup
location>/<SID>_cntrl_%s_%p_%t.bak' CURRENT CONTROLFILE;
RELEASE CHANNEL d1;
RELEASE CHANNEL d2;
RELEASE CHANNEL d3;
RELEASE CHANNEL d4;
}
After
completing the backup, either move to the target location or Network File
System (NFS) share the backup mount point to the target node to save time.
3. Clean up
Clean up the
target database and application node.
Run the
following steps on the database node
a. Take a
backup of the following important configuration files and directories before
you clean them up:
-
$CONTEXT\_FILE
- environment files
- dbs
- $TNS\_ADMIN directories.
b. Remove
target OH and drop the database.
c. Remove
contents of oraInventory
Note that
the UTL directories should not have symbolic links. If
symbolic links exist, remove them and create a physical directory structure.
Run the
following steps on the application node:
4. Copy the
binaries
Perform the
following steps to copy the source application binaries and database binaries
to the target node.
a. On the
database node, copy and transfer version 19.0.0(19c) binaries to the target
database server.
b. On the
application node, transfer only the EBSapps directory of RUN
FS from the source to the target node under the target RUN
FS
5. Configure
$Oracle_Home
Configure
$Oracle_Home on the target database node.
Before
running adcfgclone.pl to configure $Oracle_Home, clean up
the oraInventory directory. If you are doing cloning for the
first time on a new server, then run only the following steps and provide
values for all inputs. Perform the following steps:
a. Create the
context file:
cd $ORACLE_HOME/appsutil/clone/bin
perl adclonectx.pl contextfile=<Source database context
file> template=$ORACLE_HOME/appsutil/template/adxdbctx.tmp
[pairsfile=<Pairs file Path>]
perl adcfgclone.pl dbTechStack <Full Path of CONTEXT_FILE>
b.
Create listener.ora and tnsnames.ora
cd $ORACLE_HOME/appsutil
./txkSetCfgCDB.env -dboraclehome=<ORACLE_HOME>
cd $ORACLE_HOME/appsutil/bin
perl txkGenCDBTnsAdmin.pl -dboraclehome=$ORACLE_HOME
-cdbname=<target CDB NAME> \
-cdbsid=<SID> -dbport=<Target DB port>
-outdir=$ORACLE_HOME/appsutil/log \
-israc=<yes/no> [-virtualhostname=<virtual hostname>]
c. If this is a repeated cloned instance, use the
**CONTEXT_FILE** backup to configure the
target database binaries:
cd <RDBMS ORACLE_HOME>/appsutil/clone/bin
perl adcfgclone.pl dbTechStack <Full Path of CONTEXT_FILE
backup location>
d. If this is
a repeated cloned instance, revert the dbs and TNS files
so that all
configuration files and init parameters are intact after
configuration.
e. Start the
listener.
After you
configure $Oracle_Home, start the target database restore by using that backup
that you took earlier:
a. Before
restoring, check that the following parameters are correct in the target node.
- log_file_name_convert
- sec_case_sensitive_logon to false
b. Start the
target database in a `nomount` state and run the following RMAN command to
restore the database:
Rman auxiliary /
run
{
allocate auxiliary channel d1 device type disk;
allocate auxiliary channel d2 device type disk;
allocate auxiliary channel d3 device type disk;
duplicate database to '<CDB NAME>' backup
location '<RMAN backup location>' nofilenamecheck;
release channel d1;
release channel d2;
release channel d3;
}
7. Target post-restore steps
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>_PDBDesc.xml';
SQL> drop pluggable database "<Source PDB
Name>";
SQL> create pluggable database "<Target PDB
Name>" using <ORACLE_HOME>/dbs/<PDB
Name>_PDBDesc.xml NOCOPY SERVICE_NAME_CONVERT=(ebs_<Source
PDB Name>,ebs_<Target PDB Name>,<Source PDB
Name>_ebs_patch,<Target PDB Name>_ebs_patch);
SQL> alter pluggable database "<Target PDB
Name>" open read write;
SQL> alter pluggable database all save state
instances=all;
SQL> sho pdbs
CON_ID CON_NAME
OPEN MODE RESTRICTED
------ ------------------------------ ---------- ----------
2 PDB$SEED
READ ONLY NO
4 <PDB Name>
READ WRITE NO
b. Source the
PDB env file and perform the following command to set the target
UTL_FILE_DIR values in Oracle Database:
perl
$ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=$CONTEXT_FILE
-oraclehome=$ORACLE_HOME -outdir=$ORACLE_HOME/appsutil/log -mode=getUtlFileDir
if you are getting below error while to set the UTL_FILE_DIR values in Oracle Database:
ERROR DESCRIPTION:
(*******FATAL ERROR*******
PROGRAM : (/erp_base/app/oracle/product/19.0.0/appsutil/bin/txkCfgUtlfileDir.pl)
TIME : Thu Mar 2 09:42:50 2023
FUNCTION: main::validateAppsSchemaCredentials [ Level 1 ]
ERRORMSG: Invalid APPS database user credentials.
)
ERRORCODE = 1 ERRORCODE_END
Solution
local_listener parameter value for CDB database and PDB database should be same. please check the local_listener parameter in CDB and PDB database if any mismatch please set the local_listener in CDB and PDB with correct values.
---------------------------------Solution Start ---------------------------------------------------------------------
set the container database and set the local listener
-bash-5.1$ . CDBDEV_dbdev01.env
-bash-5.1$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 2 09:54:05 2023
Version 19.16.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
SQL> show parameter local_listener;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
SQL>
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbdev01)(PORT=1529)))' scope=both;
System altered.
SQL> alter system register;
System altered.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ERPDEV READ WRITE NO
SQL>
SQL> alter session set container=ERPDEV;
Session altered.
SQL> show parameter local_listener;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS=(PROTOCO
L=tcp)(HOST=dbdev01)(PORT=1529
)))
As per Document: 19c Database with Oracle E-Business Suite R12 Known Issues & Solutions (Doc ID 2662860.1)
"Make sure the database parameter local_listener is not set at PDB level . This value should be inherited from CDB. After the change run "alter system register;" command so that services will be registered with the listener."
SQL> alter system set local_listener='';
System altered.
SQL> alter system register;
System altered.
SQL> show parameter local_listener;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
SQL>
Create listener.ora and tnsnames.ora:
cd $ORACLE_HOME/appsutil
. txkSetCfgCDB.env -dboraclehome=/erp_base/app/oracle/product/19.0.0
cd $ORACLE_HOME/appsutil/bin
perl txkGenCDBTnsAdmin.pl -dboraclehome=$ORACLE_HOME -cdbname=CDBDEV -cdbsid=CDBDEV -dbport=1529 -outdir=$ORACLE_HOME/appsutil/log -israc=no
start the listener
lsnrctl start CDBDEV
b. Source the PDB env file and perform the following command to set the target UTL_FILE_DIR values in Oracle Database:
perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=$CONTEXT_FILE -oraclehome=$ORACLE_HOME -outdir=$ORACLE_HOME/appsutil/log -mode=getUtlFileDir
-bash-5.1$ . ERPDEV_dbdev01.env
-bash-5.1$ echo $CONTEXT_FILE
/erp_base/app/oracle/product/19.0.0/appsutil/ERPDEV_dbdev01.xml
-bash-5.1$ perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=$CONTEXT_FILE -oraclehome=$ORACLE_HOME -outdir=$ORACLE_HOME/appsutil/log -mode=getUtlFileDir
Enter the APPS Password:
Script Name : txkCfgUtlfileDir.pl
Script Version : 120.0.12020000.15
Started : Wednesday, March 8, 2023 at 11:35:54 AM +04
Log File : /erp_base/app/oracle/product/19.0.0/appsutil/log/TXK_UTIL_DIR_Wed_Mar_8_11_35_52_2023/txkCfgUtlfileDir.log
Context file: /erp_base/app/oracle/product/19.0.0/appsutil/ERPDEV_dbdev01.xml exists.
Successfully generated the below file with UTL_FILE_DIR content:
/erp_base/app/oracle/product/19.0.0/dbs/ERPDEV_utlfiledir.txt
Completed : Wednesday, March 8, 2023 at 11:36:01 AM +04
Successfully Completed the script
ERRORCODE = 0 ERRORCODE_END
-bash-5.1$
---------------------------------Solution End---------------------------------------------------------------------
c. Run the following command to edit the \<PDB
Name\>\_utlfiledir.txt file under
Oracle_Home/dbs and change the UTL Path
accordingly
perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl
-contextfile=$CONTEXT_FILE -oraclehome=$ORACLE_HOME
-outdir=$ORACLE_HOME/appsutil/log -mode=setUtlFileDir
d. Run the
following script for each path in \<PDB Name\>\_utlfiledir.txt
perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=$CONTEXT_FILE
-oraclehome=$ORACLE_HOME -outdir=$ORACLE_HOME/appsutil/log
-mode=createDirObject
perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=$CONTEXT_FILE
-oraclehome=$ORACLE_HOME -outdir=$ORACLE_HOME/appsutil/log -mode=syncUtlFileDir
-skipautoconfig=yes
cd $ORACLE_HOME/appsutil/install/$CONTEXT_NAME
sqlplus / as sysdba @adupdlib.sql <libext>
clean FND_NODE table
sqlplus apps/<Source Apps password>
EXEC FND_CONC_CLONE.SETUP_CLEAN;
Commit;
e. Use the
following command to run adautocfg.sh:
cd <$ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME>
sh adautocfg.sh
8. Configure
the target application
Configure the
application on the target application node:
a. Before
starting adcfgclone.pl, clean up the PATCH FS, FS_NE,
and oraInventory directories.
b. Run the
following commands to configure the application:
cd <COMMON_TOP>/clone/bin
export TIMEDPROCESS_TIMEOUT=-1
export T2P_JAVA_OPTIONS="-Djava.io.tmpdir=<Temp directory
location>"
perl ./adcfgclone.pl appsTier dualfs
c. Provide all the inputs here.
d. If this is a repeated cloning instance, you can
also use the backup of a CONTEXT_FILE. Run the following command:
perl ./adcfgclone.pl appsTier <location of CONTEXT_FILE backup> dualfs
9. Application
post-clone steps
Perform the
post-clone steps on the Application node:
a. After you
configure the application, change the apps, sysadmin, and custom schema
password, if any, by using the FNDCPASS command.
b. After
changing the apps password, run Autoconfig on the database
node and the application node.
c. Perform
other custom steps, if any, for cloned instances.
10. Start the
target application services
You can now
start all application services of the target clone instance and perform all
sanity checks for the cloned instances.
Conclusion
Using the
preceding steps, you can clone or refresh the PROD instance to non-prod servers
with version 19c databases with a multitenant architecture.