07 December 2024

Oracle E-Business Suite R12.2.14 Clone with Oracle 19c Database

Oracle E-Business Suite R12.2.14 Clone with Oracle 19c Database

Oracle E-Business Suite R12.2.14 Clone with Oracle 19c Database

Source System

  • Hostname: prodr12.githesh.com
  • Base Directory: /u03/oracle/PROD
  • 19C_ORACLE_HOME: /u03/oracle/PROD/19.0.0/
  • DATAFILE LOCATION: /u01/oracle/
  • CDB NAME: PRODCDB
  • PDB NAME: PROD

Oracle EBS and Database Version Information

SQL> select release_name from apps.fnd_product_groups;

RELEASE_NAME
--------------------------------------------------
12.2.14

SQL> SELECT version, version_full FROM v$instance;

VERSION           VERSION_FULL
----------------- -----------------
19.0.0.0.0        19.19.0.0.0
    

Pre-Clone Steps

Application Tier

cd $ADMIN_SCRIPTS_HOME
./adpreclone.pl appsTier
        

Database Tier

cd /u03/oracle/PROD/19.0.0/appsutil/scripts/PROD_prodr12/
./adpreclone.pl dbTier
        

Backup Steps

  • RDBMS ORACLE HOME: /u03/oracle/PROD/19.0.0
  • Backup Command:
    tar cfvz /backup/19c_home.tz /u03/oracle/PROD/19.0.0
  • RMAN Backup Script:
    #!/bin/bash
    # Source the Oracle environment
    if [ -f ~/.bash_profile ]; then
      source ~/.bash_profile
    fi
    
    LOG_FILE="/home/oraprod/backup_PRODCDB_${DATE}.log"
    BACKUP_DIR="/backup/"
    mkdir -p ${BACKUP_DIR}
    
    ${ORACLE_HOME}/bin/rman target / log=${LOG_FILE} <<EOF
    run {
      allocate channel d1 type disk;
      allocate channel d2 type disk;
      allocate channel d3 type disk;
      backup AS COMPRESSED BACKUPSET format '${BACKUP_DIR}/PRODCDB_bu_db_%d_t%t_s%s_p%p' database;
      sql 'alter system archive log current';
      backup AS COMPRESSED BACKUPSET format '${BACKUP_DIR}/PRODCDB_bu_al_t%t_s%s_p%p' archivelog all skip inaccessible delete input;
      backup format '${BACKUP_DIR}/PRODCDB_control%U' current controlfile;
      release channel d1;
      release channel d2;
      release channel d3;
      allocate channel d1 type disk;
      crosscheck backup;
      release channel d1;
    }
    EOF
    
    if [ $? -eq 0 ]; then
      echo "RMAN backup completed successfully. Backup files are stored in ${BACKUP_DIR}."
    else
      echo "RMAN backup failed. Check the log file: ${LOG_FILE}" >&2
      exit 1
    fi
                    
  • Application File System Backup:
    tar cfvz /backup/appliation_file.tz /u03/oracle/PROD/fs1/EBSapps

Target System

  • Hostname: cloner12.githesh.com
  • Base Directory: /u03/oracle/PROD
  • 19C_ORACLE_HOME: /u03/oracle/PROD/19.0.0/
  • DATAFILE LOCATION: /u01/oracle/
  • CDB NAME: DEVCDB
  • PDB NAME: DEV

Clone Steps

  1. Generate Context File for Database:
    cd /u03/oracle/PROD/19.0.0/appsutil/clone/bin/
    perl adclonectx.pl contextfile=/u03/oracle/PROD/19.0.0/appsutil/PROD_prodr12.xml template=/u03/oracle/PROD/19.0.0/appsutil/template/adxdbctx.tmp
                    
  2. Clone Database Technology Stack:
    cd /u03/oracle/PROD/19.0.0/appsutil/clone/bin
    perl adcfgclone.pl dbTechStack /u03/oracle/PROD/19.0.0/appsutil/DEV_cloner12.xml
                    
  3. Rename and Edit pfile, Set Environment, Start DB in nomount:
    . DEVCDB_cloner12.env
    sqlplus / as sysdba
    SQL> startup nomount;
    SQL> ALTER SYSTEM SET DB_FILE_NAME_CONVERT = '/u01/oracle/PROD/oradata/PRODCDB', '/u01/oracle/DEV/oradata/DEVCDB' ;
    SQL> ALTER SYSTEM SET LOG_FILE_NAME_CONVERT='/u01/oracle/PROD/oradata/PRODCDB', '/u01/oracle/DEV/oradata/DEVCDB' ;
                    
  4. Restore RMAN Backup:
    $ORACLE_HOME/bin/rman auxiliary / log=rman.log <<EOF
    run
    {
        allocate auxiliary channel C1 device type disk;
        allocate auxiliary channel C2 device type disk;
        allocate auxiliary channel C3 device type disk;
        allocate auxiliary channel C4 device type disk;
        allocate auxiliary channel C5 device type disk;
        allocate auxiliary channel C6 device type disk;
        DUPLICATE DATABASE TO "DEVCDB" BACKUP LOCATION '/u03/backup/18062025'  nofilenamecheck;
    }
                    
  5. PDB Configuration:
    sqlplus / as sysdba
    SQL> alter pluggable database PROD close immediate;
    SQL> alter pluggable database PROD unplug into '/u03/oracle/PROD/19.0.0/dbs/PROD.xml';
    SQL> drop pluggable database PROD;
    SQL> create pluggable database DEV using '/u03/oracle/PROD/19.0.0/dbs/PROD.xml' NOCOPY SERVICE_NAME_CONVERT=('DEV','PROD');
    SQL> alter pluggable database DEV open read write;
    SQL> alter pluggable database all open;
    SQL> alter pluggable database all save state instances=all;
                    
  6. Configure the Database:
    cd $ORACLE_HOME/appsutil
    . ./txkSetCfgCDB.env dboraclehome=/u03/oracle/PROD/19.0.0
                    
  7. TNS Configuration:
    cd $ORACLE_HOME/appsutil/bin
    perl txkGenCDBTnsAdmin.pl -dboraclehome=/u03/oracle/PROD/19.0.0 -cdbname=DEVCDB -cdbsid=DEVCDB -dbport=1526 -outdir=/u03/oracle/PROD/19.0.0/appsutil/log
                    
  8. Register Local Listener:
    sqlplus / as sysdba
    SQL> alter system set LOCAL_LISTENER='cloner12:1526' scope=both;
    SQL> alter system register;
    SQL> alter user system identified by manager;
    SQL> alter session set container=DEV;
    SQL> alter trigger SYSTEM.EBS_LOGON compile;
                    
  9. Post-PDB Creation Tasks:
    cd $ORACLE_HOME/appsutil
    . ./txkSetCfgCDB.env dboraclehome=/u03/oracle/PROD/19.0.0
    perl $ORACLE_HOME/appsutil/bin/txkPostPDBCreationTasks.pl -dboraclehome=/u03/oracle/PROD/19.0.0 -outdir=/u03/oracle/PROD/19.0.0/appsutil/log -cdbsid=DEVCDB -pdbsid=DEV -appsuser=apps -dbport=1526 -servicetype=onpremise
                    
  10. Setup Utility File Directory:
    cd $ORACLE_HOME
    . DEV_cloner12.env
    # Rename and modify the PROD_utlfiledir.txt to DEV_utlfiledir.txt ($ORACLE_HOME/dbs)
    tail -n 6 DEV_utlfiledir.txt
    mkdir -p /u03/oracle/PROD/temp/DEV
    mkdir -p /u03/oracle/PROD/19.0.0/appsutil/outbound/DEV_cloner12
    perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=$CONTEXT_FILE -oraclehome=$ORACLE_HOME -outdir=$ORACLE_HOME/appsutil/log -mode=setUtlFileDir
    perl $ORACLE_HOME/appsutil/bin/txkCfgUtlfileDir.pl -contextfile=$CONTEXT_FILE -oraclehome=$ORACLE_HOME -outdir=$ORACLE_HOME/appsutil/log -mode=syncUtlFileDir
                    
  11. Run POST-CLONE for Application Tier:
    cd /u03/oracle/PROD/fs1/EBSapps/comn/clone/bin
    ./adcfgclone.pl appsTier dualfs
                    

Check Application URL

grep -e "s_external_url" $CONTEXT_FILE
# Example output:
http://cloner12.githesh.com:8005
        

Oracle E-Business Suite R12.2.14 Clone with Oracle 19c Database

Oracle E-Business Suite R12.2.14 Clone with Oracle 19c Database Oracle E-Business Suite R12.2.14 Clone with Oracle 1...