Session
ID:
Prepared by:
Automating Your Clone in E-
Business Suite R12.2
Best of Collaborate
22-AUG-2017
Best of Collaborate
Michael Brown, BlueStar
@MichaelBrownOrg
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Who Am I?
Over 22 years experience with Oracle Database
Over 18 years experience with E-Business Suite
Chair, OAUG Database SIG
Secretary, OAUG Sysadmin SIG
Co-Founder AppsPerf
Oracle ACE
OAUG Member of the Year 2013
Applications DBA, BlueStar
2
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Assumptions
• One applications node
• Not RAC
• Unix commands
• AD/TXK Delta 8+
3
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Overview
• Manual Clone
• Automate the Clone
• Finishing Tasks
4
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Cloning
5
Apps
Filesystem
Oracle
Home
DB
Target
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Cloning
6
Apps
Filesystem
Oracle
Home
DB
Target
Oracle
Home
Copy
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Cloning
7
Apps
Filesystem
Oracle
Home
DB
Target
Copy
Oracle
Home
DB
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Configure
Source
Cloning
8
Apps
Filesystem
Oracle
Home
DB
Target
Oracle
Home
DB
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Cloning
9
Apps
Filesystem
Oracle
Home
DB
Target
Copy
Oracle
Home
DB
Apps
Filesystem
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Cloning
10
Apps
Filesystem
Oracle
Home
DB
Configure
Target
Oracle
Home
DB
Apps
Filesystem
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Cloning
11
Apps
Filesystem
Oracle
Home
DB
Target
Oracle
Home
DB
Apps
Filesystem
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
12.2 Patching
• The support note states that before cloning, complete
any patching cycle through the final (cleanup) phase.
• This includes running fs_clone
• Implications
• Nightly clones for reporting/support
• On-Demand clones
• fs_clone is not normally required (may be stated in the
patch note, middle tier technology patches, aborted patch
cycles)
12
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
12.2 Patching
• Check if adop session is active
• Apps Tier
• adop –status
• SQL
• Select decode(status,’C’,’Not Active’,’Active’) from ad_adop_sessions
where adop_session_id=(select max(adop_session_id) from
ad_adop_sessions);
• $AD_TOP/sql/ADZDSHOWED.sql
• Look for PATCH edition in the result
• Cannot clone
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Preclone
• Oracle builds staging information to use after the clone.
• Apps Tier
• $ADMIN_SCRIPTS_HOME
• adpreclone.pl appsTier
• Database Tier
• $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME
• adpreclone.pl dbTier
• General Comment
• Staging area is much larger than in prior releases because it includes
the tech stack.
• Make sure you are in the RUN filesystem when running
adpreclone.pl
14
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
DATABASE TIER
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Hot DB Clone
16
Apps
Filesystem
Oracle
Home
DB
Target
Oracle
Home
Copy
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Configure
Source
Hot DB Clone
17
Apps
Filesystem
Oracle
Home
DB
Target
Oracle
Home
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Hot DB Clone
• adcfgclone.pl dbTechStack
• Relink the oracle_home
• Configure the init.ora, listener, etc.
• Register the home with the central inventory
• Start the listener
18
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Hot DB Clone
19
Apps
Filesystem
Oracle
Home
DB
Target
Clone
Oracle
Home
DB
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Configure
Source
Hot DB Clone
20
Apps
Filesystem
Oracle
Home
DB
Target
Oracle
Home
DB
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
DB Clone
• Set the dynamic library extension
• cd $ORACLE_HOME/appstuil/install/$CONTEXT_NAME
• sqlplus / as sysdba @adupdlib so
• adcfgclone.pl dbconfig
$ORACLE_HOME/appsutil/$CONTEXT_NAME.xml
• Configure the data for the target
21
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Hot DB Clone
22
Apps
Filesystem
Oracle
Home
DB
Target
Clone
Oracle
Home
DB
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
RMAN Duplicate
• Can be from backups or the active database
• SUGGESTION: At least one regular clone is from backup
preferably with no connection to the source at all
set echo on;
connect auxiliary /
run {
ALLOCATE AUXILIARY CHANNEL c1 device type disk;
ALLOCATE AUXILIARY CHANNEL c2 device type disk;
set until time "to_date('01-MAR-2015 13:00','DD-MON-YYYY
HH24:MI')";
duplicate database PROD DBID 3244314739 to ”DEV"
pfile="/u01/app/oracle/db/tech_st/11.2.0.3/dbs/initDEV.ora.d
up" BACKUP LOCATION ’/rman/prod';
}
23
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Other Hot Backup
• Common to all of these is the fact old school hot backup
commands are used
• ALTER DATABASE BEGIN BACKUP
• ALTER DATABASE END BACKUP
or
• ALTER TABLESPACE XXX BEGIN BACKUP
• ALTER TABLESPACE XXX END BACKUP
• MOS Note 224274.1 How to Make a Copy of an Open
Database for Duplication to a Different Machine
24
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
SAN Technologies
• Beware Production Impacts!
• Split Mirrors
• Best if your vendor supports differential resync (if you
clone frequently)
• Snapshots
• Reduced space requirements, quick to create
• Must be read/write (copy on write)
• Snapshot Based Mirrors
• Starts like snapshot, then copies blocks in the background
25
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Other Possibilities
• Snapshots off dataguard
• Delphix
• zfs based appliance
• I have not used and am not affiliated
26
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Finishing Tasks
• Only Site level items are impacted when configuring the
applications tier
• You may have URLs or other profiles values that must be
changed manually
• Workflow MAIL_STATUS
• Etc.
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
APPLICATIONS TIER
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Source
Applications Tier
29
Apps
Filesystem
Oracle
Home
DB
Target
Copy
Oracle
Home
DB
Apps
Filesystem
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Applications Tier
• Copy the files
• Must preserve symbolic links
• APPL_TOP, COMMON_TOP, 10.1.2 tech stack from Run
filesystem (either fs1 or fs2) to the same directory on the
target
• That is if $RUN_BASE on the source is /prod/apps/fs2, the target
could be /uat/apps/fs2
• After copying the files
• adcfgclone.pl appsTier dualfs
• Need to use the same port pool you used with dbTechStack (or
dbTier)
• Need to have read/write access to one of the directories you gave
for the dbTier
• You will be prompted with a list of them
• Dualfs option creates the patch file system in one run of
adcfgclone.pl
30
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Finishing tasks
• Fix profile options
• Rapid Clone will fix site level profiles, but it will miss things like
a User level URL
• Update printers if required
• Fix Workflow
• $FND_TOP/sql/afsvcpup.sql
• Re-sign the JAR files
• $INST_TOP is generated on the target, you no longer have the
same code signing as the source since the keys are in
$APPL_TOP_NE/ad/admin
• Etc.
31
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
AUTOMATE THE PROCESS
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
• Abort if in patching session
ADOP_STATUS=$(sqlplus –s /nolog <<EOF | grep ADOP_STATUS
| tail -1 | cut –f2 –d:
Connect apps/$APPS_PWD
Select ‘ADOP_STATUS:’||status
From ad_adop_sessions
Where adop_session_id==(select max(adop_session_id) from
ad_adop_sessions)
/
EOF
)
If [ “$ADOP_STATUS” != ‘C’ ]; then
exit 1
fi
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Retrieve the RUN_BASE
• SELECT extractvalue(xmltype(text),'//CURRENT_BASE')
FROM fnd_oam_context_files where status='S'
and name not in ('TEMPLATE','METADATA')
and
extractvalue(xmltype(text),'//file_edition_type')='run’;
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
• Do ORACLE_HOME manually if required
• DB Patches
• Upgrade
• Automated process will pick up with cloning the
database
• Setup ssh affinity to apps node if different than database
node
• Don’t want to clone apps tier if the database fails
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
• Shutdown the apps tier
• ssh appsnode /scripts/shutdown_wait
• adcmctl.sh abort
• adstpall.sh
• Preserve Unique Data
• Logical backup of required data
• Apex applications
• Cleanup
• Remove backups
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
rman target / <<EOF
set echo on
crosscheck backup device type disk;
crosscheck copy device type disk;
crosscheck archivelog all;
delete noprompt backup;
delete noprompt expired backup device type disk;
delete noprompt expired copy device type disk;
delete noprompt expired archivelog all;
unregister database noprompt;
EOF
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
• Preserve Unique Data
• Logical backup of required data
• Apex applications
• Rman configuration
• Cleanup
• Remove backups
• Shutdown and remove datafiles and logs
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
• Clone the database
• Have a pfile with the correct settings for the clone, e.g.
initDEV.ora.dup
• db_file_name_convert
• log_file_name_convert
• Script the rman duplicate
• Pass the date or use something based on sysdate
• Restore the unique data
• Restart the database
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
• Configure the database
• adupdlib.sql
• adcfgclone.pl dbconfig $CONTEXT_FILE
• Change sys/system passwords
• Disable alerts
update alr_alerts
set enabled_flag='N',
LAST_UPDATE_DATE=SYSDATE,
LAST_UPDATED_BY=(select user_id from fnd_user where
user_name='SYSADMIN')
where enabled_flag='Y';
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
• Concurrent Requests
• Put requests on hold
update fnd_concurrent_requests
set HOLD_FLAG='Y',
LAST_UPDATE_DATE=SYSDATE,
LAST_UPDATED_BY=(select user_id from fnd_user where user_name='SYSADMIN')
where requested_by not in (select user_id
from fnd_user
where user_name in ('SYSADMIN'
))
and phase_code='P'
and hold_flag='N'
/
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Database Tier
• Profile Options
• Set SITENAME
update fnd_profile_option_values
set profile_option_value= (select rtrim(ltrim(global_name)) from global_name)||
' (Cloned from '||nvl('&&SOURCE',’PROD')||' on '||
nvl('&&SOURCEDATE',to_char(SYSDATE,'MM/DD/YY HH24:MI'))||')’,
LAST_UPDATE_DATE=SYSDATE,
LAST_UPDATED_BY=(select user_id from fnd_user where user_name='SYSADMIN')
Where level_id=10001
And (profile_option_id,application_id) in (select profile_option_id,application_id
from fnd_profile_options where profile_option_name='SITENAME')
/
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Applications Tier
• Clean up the apps tier
• Only want EBSapps from $RUN_BASE on the source
• If you have room
• mv fs1 fs2 fs_ne zap
• rm –rf zap &
• mkdir fs1 fs2 fs_ne
• rsync EBSapps from source $RUN_BASE to similar path on
target
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Applications Tier
• $INST_TOP/appl/admin/${CONTEXT_NAME}_run.txt
• Sample pairsfile
• Need to add patch_s_port_pool
• (echo $APPS_PASS; echo $SYSTEM_PASS; echo
$WLS_PASSWORD; echo n) | adcfgclone.pl
component=appsTier
pairsfile=/home/oracle/clone/TARGET_pairs.txt
dualfs=yes
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Applications Tier
• Other options is to build a driver file of the responses
you gave manually
cat responses.txt | adcfgclone.pl appsTier dualfs
• Passwords
• FNDCPASS lets everything be on command line so it easier
to script
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Applications Tier
• Passwords
• APPS Password
• FNDCPASS apps/$APPSPWD 0 Y system/$SYSTEMPWD SYSTEM
APPLSYS $NEW
• Need to fix the password stored in WLS
• Start AdminServer using the $INST_TOP/admin/scripts/adadminsrvctl.sh
script. Do not start any other application tier services.
• Change the APPS password in WLS Data Source by running the the
following script as shown:
• perl $FND_TOP/patch/115/bin/txkManageDBConnectionPool.pl
• When prompted, select 'updateDSPassword' to change the
APPS password in the WLS Datasource.
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Applications Tier
• Passwords
• Other Schema Passwords
• FNDCPASS apps/$NEW 0 Y system/$SYSTEMPWD ALLORACLE
$NEW
• FNDCPASS apps/$NEW 0 Y system/$SYSTEMPWD ORACLE schema
$NEW
• User Passwords
• FNDCPASS apps/$NEW 0 Y system/$SYSTEMPWD USER ebsuser
newpass
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Applications Tier
• Workflow
• @$FND_TOP/sql/afsvcpup.sql
• Script with inputs to set values (this is the test override address)
sqlplus apps/$APPS_PWD @$FND_TOP/sql/afsvcpup.sql <<EOF
10006
10093
wfdump@mycompany.com
EOF
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It
• Since we need to copy the source’s application tier, set
up ssh affinity from the source apps node
• Either call individual scripts from the master script or
bundle the code together
• I prefer to call individual scripts
• Check status after each step, abort and alert if there is an
issue
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Production Database Server)
#!/bin/bash
. /u01/app/oracle/db/tech_st/11.2.0.4/PROD_proddb.env
. /etc/sysconfig/PROD
ADOP_STATUS=$(sqlplus -s /nolog <<EOF | grep ADOP_STATUS | tail -1 | cut -f2 -d:
Connect apps/$APPS_PASSWORD
Select 'ADOP_STATUS:'||status
From ad_adop_sessions
Where adop_session_id=(select max(adop_session_id) from ad_adop_sessions)
/
EOF
)
if [ "$ADOP_STATUS" != 'C' ]; then
echo "CLONE ABORTED, active patching cycle"
exit 1
else
echo "Not in patching cycle, clone can proceed"
fi
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Production Database Server)
RUN_BASE=$(sqlplus -s /nolog <<EOF | grep RUN_BASE | tail -1 | cut -f2 -d:
Connect apps/$APPS_PASSWORD
Select 'RUN_BASE:'||extractvalue(xmltype(text),'//CURRENT_BASE')
FROM fnd_oam_context_files where status='S'
and name not in ('TEMPLATE','METADATA')
and extractvalue(xmltype(text),'//file_edition_type')='run';
/
EOF
)
ACTIVE_FS=$(basename $RUN_BASE)
echo $ACTIVE_FS
SRC_PASSWORD=$(echo $1 | tr '[A-Za-z0-9]' '[N-ZA-Mn-za-m5-90-4]')
ssh targetdbserver target $SRC_PASSWORD $ACTIVE_FS
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Target DB Server)
#!/bin/bash
if [ "$#" -ne "2" ]; then
echo "Usage: $(basename $0) SRC_APPS_PASSWORD RUN_BASE"
exit 1
fi
export SRC_PASSWORD=$(echo $1 | tr '[A-Za-z0-9]' '[N-ZA-Mn-za-m5-90-4]')
export RUN_BASE=$2
if [ "$RUN_BASE" != 'fs1' -a "$RUN_BASE" != 'fs2' ]; then
echo "RUN_BASE must be fs1 or fs2"
exit 1
fi
. /etc/sysconfig/TARGET
if [ -f FULL_PATH_TARGET_ENV_FILE ]; then
. FULL_PATH_TARGET_ENV_FILE P2_finup2db.env
else
echo "Unable to set enviroment"
exit 1
fi
export DISPLAY=$(grep '"s_display"' $CONTEXT_FILE | cut -f2 -d> | cut -f1 -d<)
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Target DB Server)
XPORT=$(echo $DISPLAY | cut -f2 -d:)
if ! /usr/bin/xdpyinfo &> /dev/null; then
vncserver :$XPORT
fi
/home/oracle/dba/bin/stop-glassfish
sqlplus apps/$APPS_PASSWORD <<EOF | grep 'X' > /dev/null
select * from dual;
EOF
status=$?
if [ "$status" -eq 0 ]; then
ssh TARGETAPPSERVER /home/oracle/apps_shutdown abort
sqlplus / as sysdba <<EOF
shutdown abort
EOF
lsnrctl stop TARGET
fi
export DATE=$(date +'%d-%b-%Y')
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Target DB Server)
COMMAND_TO_DUP_AND_RENAME_DB –DB and listener are up and sys/system passwords changed
cd $ORACLE_HOME/appsutil/install/FINUP2_finup2db
sqlplus / as sysdba <<EOF
@adupdlib so
EOF
cd ../../clone/bin
echo $SRC_PASSWORD | ./adcfgclone.pl dbconfig ../../$CONTEXT_NAME.xml
cd /home/oracle/dba/clone_sql
sqlplus apps/$SRC_PASSWORD <<EOF
@disable_alerts
@disable_concurrent.sql
@fix_edi_profiles.sql
@fix_log_profiles.sql
@fix_pcp.sql
@wf_mailer.sql
@set_site.sql
EOF
(echo $SRC_PASSWORD;echo PROD;echo $DATE)|ssh fTARGERTAPPSERVER /home/oracle/config/clone_$RUN_BASE
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Target APP Server)
. /etc/sysconfig/TARGET
DISPLAY=$(grep '^s_display'
/home/oracle/config/pairsfile.txt.fs2|cut -f2 -d=)
XPORT=$(echo $DISPLAY | cut -f2 -d:)
if ! /usr/bin/xdpyinfo &> /dev/null; then
vncserver :$XPORT
fi
cd /u01/app/oracle/apps
mkdir sign
cp /u01/app/oracle/apps/fs_ne/EBSapps/appl/ad/admin/*
sign/
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Target APP Server)
mkdir zap
mv fs1 fs_ne zap
mv fs2/FMW_Home fs2/inst zap
mv ../oraInventory/* zap
nohup rm -rf zap &
Optional: Copy correct Corporate Branding into place in path to
OA_MEDIA
cd /u01/app/oracle/apps/fs2/EBSapps/comn/clone/bin
echo "Enter source apps password"
read OLD_APPS_PASSWORD
echo "Source of clone:"
read SRC
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Target APP Server)
DATE=$(date +'%d-%b-%Y %H:%M')
echo "Date of clone (default $DATE):"
read cdate
if [ "$cdate" != "" ]; then
DATE="$cdate"
fi
(echo $OLD_APPS_PASSWORD;echo $WLS_PASSWORD;echo 'n') | ./adcfgclone.pl
component=appsTier pairsfile=/home/oracle/config/pairsfile.txt.fs2 dualfs=yes
status=$?
if [ "$status" -ne 0 ]; then
echo "Something went wrong"
exit $status
fi
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
Bundle It (Target APP Server)
cp /u01/app/oracle/apps/sign/*
/u01/app/oracle/apps/fs_ne/EBSapps/appl/ad/admin/
. /u01/app/oracle/apps/EBSapps.env run
cd /u01/app/oracle/apps/etcc
echo $OLD_APPS_PASSWORD | ./checkMTpatch.sh
cd /home/oracle/dba/clone
if [ "$OLD_APPS_PASSWORD" != "$APPS_PASSWORD" ]; then
./change_passwords $OLD_APPS_PASSWORD $APPS_PASSWORD
$WLS_PASSWORD
fi
echo $APPS_PASSWORD | ./wf_config_workflow
echo $WLS_PASSWORD | ./adstrtal.sh apps/$APPS_PASSWORD
(echo $SRC;echo $DATE) | /home/oracle/config/set_home_announce.sh
April 2-6, 2017 in Las Vegas, NV USA #C17LV
Copyright ©2017 Michael Brown
References
• My Oracle Support
• 1383621.1 Cloning Oracle E-Business Suite Release 12.2 with
Rapid Clone
• 224274.1 How to Make a Copy of an Open Database for
Duplication to a Different Machine
• James Morrow After the Clone: Things adcfgclone Doesn’t
do…
59
Q&Ambrown@bluestarinc.com
http://blog.michael-brown.org

Automating Your Clone in E-Business Suite R12.2

  • 1.
    Session ID: Prepared by: Automating YourClone in E- Business Suite R12.2 Best of Collaborate 22-AUG-2017 Best of Collaborate Michael Brown, BlueStar @MichaelBrownOrg
  • 2.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Who Am I? Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG Sysadmin SIG Co-Founder AppsPerf Oracle ACE OAUG Member of the Year 2013 Applications DBA, BlueStar 2
  • 3.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Assumptions • One applications node • Not RAC • Unix commands • AD/TXK Delta 8+ 3
  • 4.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Overview • Manual Clone • Automate the Clone • Finishing Tasks 4
  • 5.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Cloning 5 Apps Filesystem Oracle Home DB Target
  • 6.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Cloning 6 Apps Filesystem Oracle Home DB Target Oracle Home Copy
  • 7.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Cloning 7 Apps Filesystem Oracle Home DB Target Copy Oracle Home DB
  • 8.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Configure Source Cloning 8 Apps Filesystem Oracle Home DB Target Oracle Home DB
  • 9.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Cloning 9 Apps Filesystem Oracle Home DB Target Copy Oracle Home DB Apps Filesystem
  • 10.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Cloning 10 Apps Filesystem Oracle Home DB Configure Target Oracle Home DB Apps Filesystem
  • 11.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Cloning 11 Apps Filesystem Oracle Home DB Target Oracle Home DB Apps Filesystem
  • 12.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown 12.2 Patching • The support note states that before cloning, complete any patching cycle through the final (cleanup) phase. • This includes running fs_clone • Implications • Nightly clones for reporting/support • On-Demand clones • fs_clone is not normally required (may be stated in the patch note, middle tier technology patches, aborted patch cycles) 12
  • 13.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown 12.2 Patching • Check if adop session is active • Apps Tier • adop –status • SQL • Select decode(status,’C’,’Not Active’,’Active’) from ad_adop_sessions where adop_session_id=(select max(adop_session_id) from ad_adop_sessions); • $AD_TOP/sql/ADZDSHOWED.sql • Look for PATCH edition in the result • Cannot clone
  • 14.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Preclone • Oracle builds staging information to use after the clone. • Apps Tier • $ADMIN_SCRIPTS_HOME • adpreclone.pl appsTier • Database Tier • $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME • adpreclone.pl dbTier • General Comment • Staging area is much larger than in prior releases because it includes the tech stack. • Make sure you are in the RUN filesystem when running adpreclone.pl 14
  • 15.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown DATABASE TIER
  • 16.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Hot DB Clone 16 Apps Filesystem Oracle Home DB Target Oracle Home Copy
  • 17.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Configure Source Hot DB Clone 17 Apps Filesystem Oracle Home DB Target Oracle Home
  • 18.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Hot DB Clone • adcfgclone.pl dbTechStack • Relink the oracle_home • Configure the init.ora, listener, etc. • Register the home with the central inventory • Start the listener 18
  • 19.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Hot DB Clone 19 Apps Filesystem Oracle Home DB Target Clone Oracle Home DB
  • 20.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Configure Source Hot DB Clone 20 Apps Filesystem Oracle Home DB Target Oracle Home DB
  • 21.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown DB Clone • Set the dynamic library extension • cd $ORACLE_HOME/appstuil/install/$CONTEXT_NAME • sqlplus / as sysdba @adupdlib so • adcfgclone.pl dbconfig $ORACLE_HOME/appsutil/$CONTEXT_NAME.xml • Configure the data for the target 21
  • 22.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Hot DB Clone 22 Apps Filesystem Oracle Home DB Target Clone Oracle Home DB
  • 23.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown RMAN Duplicate • Can be from backups or the active database • SUGGESTION: At least one regular clone is from backup preferably with no connection to the source at all set echo on; connect auxiliary / run { ALLOCATE AUXILIARY CHANNEL c1 device type disk; ALLOCATE AUXILIARY CHANNEL c2 device type disk; set until time "to_date('01-MAR-2015 13:00','DD-MON-YYYY HH24:MI')"; duplicate database PROD DBID 3244314739 to ”DEV" pfile="/u01/app/oracle/db/tech_st/11.2.0.3/dbs/initDEV.ora.d up" BACKUP LOCATION ’/rman/prod'; } 23
  • 24.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Other Hot Backup • Common to all of these is the fact old school hot backup commands are used • ALTER DATABASE BEGIN BACKUP • ALTER DATABASE END BACKUP or • ALTER TABLESPACE XXX BEGIN BACKUP • ALTER TABLESPACE XXX END BACKUP • MOS Note 224274.1 How to Make a Copy of an Open Database for Duplication to a Different Machine 24
  • 25.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown SAN Technologies • Beware Production Impacts! • Split Mirrors • Best if your vendor supports differential resync (if you clone frequently) • Snapshots • Reduced space requirements, quick to create • Must be read/write (copy on write) • Snapshot Based Mirrors • Starts like snapshot, then copies blocks in the background 25
  • 26.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Other Possibilities • Snapshots off dataguard • Delphix • zfs based appliance • I have not used and am not affiliated 26
  • 27.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Finishing Tasks • Only Site level items are impacted when configuring the applications tier • You may have URLs or other profiles values that must be changed manually • Workflow MAIL_STATUS • Etc.
  • 28.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown APPLICATIONS TIER
  • 29.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Source Applications Tier 29 Apps Filesystem Oracle Home DB Target Copy Oracle Home DB Apps Filesystem
  • 30.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Applications Tier • Copy the files • Must preserve symbolic links • APPL_TOP, COMMON_TOP, 10.1.2 tech stack from Run filesystem (either fs1 or fs2) to the same directory on the target • That is if $RUN_BASE on the source is /prod/apps/fs2, the target could be /uat/apps/fs2 • After copying the files • adcfgclone.pl appsTier dualfs • Need to use the same port pool you used with dbTechStack (or dbTier) • Need to have read/write access to one of the directories you gave for the dbTier • You will be prompted with a list of them • Dualfs option creates the patch file system in one run of adcfgclone.pl 30
  • 31.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Finishing tasks • Fix profile options • Rapid Clone will fix site level profiles, but it will miss things like a User level URL • Update printers if required • Fix Workflow • $FND_TOP/sql/afsvcpup.sql • Re-sign the JAR files • $INST_TOP is generated on the target, you no longer have the same code signing as the source since the keys are in $APPL_TOP_NE/ad/admin • Etc. 31
  • 32.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown AUTOMATE THE PROCESS
  • 33.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier • Abort if in patching session ADOP_STATUS=$(sqlplus –s /nolog <<EOF | grep ADOP_STATUS | tail -1 | cut –f2 –d: Connect apps/$APPS_PWD Select ‘ADOP_STATUS:’||status From ad_adop_sessions Where adop_session_id==(select max(adop_session_id) from ad_adop_sessions) / EOF ) If [ “$ADOP_STATUS” != ‘C’ ]; then exit 1 fi
  • 34.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Retrieve the RUN_BASE • SELECT extractvalue(xmltype(text),'//CURRENT_BASE') FROM fnd_oam_context_files where status='S' and name not in ('TEMPLATE','METADATA') and extractvalue(xmltype(text),'//file_edition_type')='run’;
  • 35.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier • Do ORACLE_HOME manually if required • DB Patches • Upgrade • Automated process will pick up with cloning the database • Setup ssh affinity to apps node if different than database node • Don’t want to clone apps tier if the database fails
  • 36.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier • Shutdown the apps tier • ssh appsnode /scripts/shutdown_wait • adcmctl.sh abort • adstpall.sh • Preserve Unique Data • Logical backup of required data • Apex applications • Cleanup • Remove backups
  • 37.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier rman target / <<EOF set echo on crosscheck backup device type disk; crosscheck copy device type disk; crosscheck archivelog all; delete noprompt backup; delete noprompt expired backup device type disk; delete noprompt expired copy device type disk; delete noprompt expired archivelog all; unregister database noprompt; EOF
  • 38.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier • Preserve Unique Data • Logical backup of required data • Apex applications • Rman configuration • Cleanup • Remove backups • Shutdown and remove datafiles and logs
  • 39.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier • Clone the database • Have a pfile with the correct settings for the clone, e.g. initDEV.ora.dup • db_file_name_convert • log_file_name_convert • Script the rman duplicate • Pass the date or use something based on sysdate • Restore the unique data • Restart the database
  • 40.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier • Configure the database • adupdlib.sql • adcfgclone.pl dbconfig $CONTEXT_FILE • Change sys/system passwords • Disable alerts update alr_alerts set enabled_flag='N', LAST_UPDATE_DATE=SYSDATE, LAST_UPDATED_BY=(select user_id from fnd_user where user_name='SYSADMIN') where enabled_flag='Y';
  • 41.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier • Concurrent Requests • Put requests on hold update fnd_concurrent_requests set HOLD_FLAG='Y', LAST_UPDATE_DATE=SYSDATE, LAST_UPDATED_BY=(select user_id from fnd_user where user_name='SYSADMIN') where requested_by not in (select user_id from fnd_user where user_name in ('SYSADMIN' )) and phase_code='P' and hold_flag='N' /
  • 42.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Database Tier • Profile Options • Set SITENAME update fnd_profile_option_values set profile_option_value= (select rtrim(ltrim(global_name)) from global_name)|| ' (Cloned from '||nvl('&&SOURCE',’PROD')||' on '|| nvl('&&SOURCEDATE',to_char(SYSDATE,'MM/DD/YY HH24:MI'))||')’, LAST_UPDATE_DATE=SYSDATE, LAST_UPDATED_BY=(select user_id from fnd_user where user_name='SYSADMIN') Where level_id=10001 And (profile_option_id,application_id) in (select profile_option_id,application_id from fnd_profile_options where profile_option_name='SITENAME') /
  • 43.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Applications Tier • Clean up the apps tier • Only want EBSapps from $RUN_BASE on the source • If you have room • mv fs1 fs2 fs_ne zap • rm –rf zap & • mkdir fs1 fs2 fs_ne • rsync EBSapps from source $RUN_BASE to similar path on target
  • 44.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Applications Tier • $INST_TOP/appl/admin/${CONTEXT_NAME}_run.txt • Sample pairsfile • Need to add patch_s_port_pool • (echo $APPS_PASS; echo $SYSTEM_PASS; echo $WLS_PASSWORD; echo n) | adcfgclone.pl component=appsTier pairsfile=/home/oracle/clone/TARGET_pairs.txt dualfs=yes
  • 45.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Applications Tier • Other options is to build a driver file of the responses you gave manually cat responses.txt | adcfgclone.pl appsTier dualfs • Passwords • FNDCPASS lets everything be on command line so it easier to script
  • 46.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Applications Tier • Passwords • APPS Password • FNDCPASS apps/$APPSPWD 0 Y system/$SYSTEMPWD SYSTEM APPLSYS $NEW • Need to fix the password stored in WLS • Start AdminServer using the $INST_TOP/admin/scripts/adadminsrvctl.sh script. Do not start any other application tier services. • Change the APPS password in WLS Data Source by running the the following script as shown: • perl $FND_TOP/patch/115/bin/txkManageDBConnectionPool.pl • When prompted, select 'updateDSPassword' to change the APPS password in the WLS Datasource.
  • 47.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Applications Tier • Passwords • Other Schema Passwords • FNDCPASS apps/$NEW 0 Y system/$SYSTEMPWD ALLORACLE $NEW • FNDCPASS apps/$NEW 0 Y system/$SYSTEMPWD ORACLE schema $NEW • User Passwords • FNDCPASS apps/$NEW 0 Y system/$SYSTEMPWD USER ebsuser newpass
  • 48.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Applications Tier • Workflow • @$FND_TOP/sql/afsvcpup.sql • Script with inputs to set values (this is the test override address) sqlplus apps/$APPS_PWD @$FND_TOP/sql/afsvcpup.sql <<EOF 10006 10093 wfdump@mycompany.com EOF
  • 49.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It • Since we need to copy the source’s application tier, set up ssh affinity from the source apps node • Either call individual scripts from the master script or bundle the code together • I prefer to call individual scripts • Check status after each step, abort and alert if there is an issue
  • 50.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Production Database Server) #!/bin/bash . /u01/app/oracle/db/tech_st/11.2.0.4/PROD_proddb.env . /etc/sysconfig/PROD ADOP_STATUS=$(sqlplus -s /nolog <<EOF | grep ADOP_STATUS | tail -1 | cut -f2 -d: Connect apps/$APPS_PASSWORD Select 'ADOP_STATUS:'||status From ad_adop_sessions Where adop_session_id=(select max(adop_session_id) from ad_adop_sessions) / EOF ) if [ "$ADOP_STATUS" != 'C' ]; then echo "CLONE ABORTED, active patching cycle" exit 1 else echo "Not in patching cycle, clone can proceed" fi
  • 51.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Production Database Server) RUN_BASE=$(sqlplus -s /nolog <<EOF | grep RUN_BASE | tail -1 | cut -f2 -d: Connect apps/$APPS_PASSWORD Select 'RUN_BASE:'||extractvalue(xmltype(text),'//CURRENT_BASE') FROM fnd_oam_context_files where status='S' and name not in ('TEMPLATE','METADATA') and extractvalue(xmltype(text),'//file_edition_type')='run'; / EOF ) ACTIVE_FS=$(basename $RUN_BASE) echo $ACTIVE_FS SRC_PASSWORD=$(echo $1 | tr '[A-Za-z0-9]' '[N-ZA-Mn-za-m5-90-4]') ssh targetdbserver target $SRC_PASSWORD $ACTIVE_FS
  • 52.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Target DB Server) #!/bin/bash if [ "$#" -ne "2" ]; then echo "Usage: $(basename $0) SRC_APPS_PASSWORD RUN_BASE" exit 1 fi export SRC_PASSWORD=$(echo $1 | tr '[A-Za-z0-9]' '[N-ZA-Mn-za-m5-90-4]') export RUN_BASE=$2 if [ "$RUN_BASE" != 'fs1' -a "$RUN_BASE" != 'fs2' ]; then echo "RUN_BASE must be fs1 or fs2" exit 1 fi . /etc/sysconfig/TARGET if [ -f FULL_PATH_TARGET_ENV_FILE ]; then . FULL_PATH_TARGET_ENV_FILE P2_finup2db.env else echo "Unable to set enviroment" exit 1 fi export DISPLAY=$(grep '"s_display"' $CONTEXT_FILE | cut -f2 -d> | cut -f1 -d<)
  • 53.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Target DB Server) XPORT=$(echo $DISPLAY | cut -f2 -d:) if ! /usr/bin/xdpyinfo &> /dev/null; then vncserver :$XPORT fi /home/oracle/dba/bin/stop-glassfish sqlplus apps/$APPS_PASSWORD <<EOF | grep 'X' > /dev/null select * from dual; EOF status=$? if [ "$status" -eq 0 ]; then ssh TARGETAPPSERVER /home/oracle/apps_shutdown abort sqlplus / as sysdba <<EOF shutdown abort EOF lsnrctl stop TARGET fi export DATE=$(date +'%d-%b-%Y')
  • 54.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Target DB Server) COMMAND_TO_DUP_AND_RENAME_DB –DB and listener are up and sys/system passwords changed cd $ORACLE_HOME/appsutil/install/FINUP2_finup2db sqlplus / as sysdba <<EOF @adupdlib so EOF cd ../../clone/bin echo $SRC_PASSWORD | ./adcfgclone.pl dbconfig ../../$CONTEXT_NAME.xml cd /home/oracle/dba/clone_sql sqlplus apps/$SRC_PASSWORD <<EOF @disable_alerts @disable_concurrent.sql @fix_edi_profiles.sql @fix_log_profiles.sql @fix_pcp.sql @wf_mailer.sql @set_site.sql EOF (echo $SRC_PASSWORD;echo PROD;echo $DATE)|ssh fTARGERTAPPSERVER /home/oracle/config/clone_$RUN_BASE
  • 55.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Target APP Server) . /etc/sysconfig/TARGET DISPLAY=$(grep '^s_display' /home/oracle/config/pairsfile.txt.fs2|cut -f2 -d=) XPORT=$(echo $DISPLAY | cut -f2 -d:) if ! /usr/bin/xdpyinfo &> /dev/null; then vncserver :$XPORT fi cd /u01/app/oracle/apps mkdir sign cp /u01/app/oracle/apps/fs_ne/EBSapps/appl/ad/admin/* sign/
  • 56.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Target APP Server) mkdir zap mv fs1 fs_ne zap mv fs2/FMW_Home fs2/inst zap mv ../oraInventory/* zap nohup rm -rf zap & Optional: Copy correct Corporate Branding into place in path to OA_MEDIA cd /u01/app/oracle/apps/fs2/EBSapps/comn/clone/bin echo "Enter source apps password" read OLD_APPS_PASSWORD echo "Source of clone:" read SRC
  • 57.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Target APP Server) DATE=$(date +'%d-%b-%Y %H:%M') echo "Date of clone (default $DATE):" read cdate if [ "$cdate" != "" ]; then DATE="$cdate" fi (echo $OLD_APPS_PASSWORD;echo $WLS_PASSWORD;echo 'n') | ./adcfgclone.pl component=appsTier pairsfile=/home/oracle/config/pairsfile.txt.fs2 dualfs=yes status=$? if [ "$status" -ne 0 ]; then echo "Something went wrong" exit $status fi
  • 58.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown Bundle It (Target APP Server) cp /u01/app/oracle/apps/sign/* /u01/app/oracle/apps/fs_ne/EBSapps/appl/ad/admin/ . /u01/app/oracle/apps/EBSapps.env run cd /u01/app/oracle/apps/etcc echo $OLD_APPS_PASSWORD | ./checkMTpatch.sh cd /home/oracle/dba/clone if [ "$OLD_APPS_PASSWORD" != "$APPS_PASSWORD" ]; then ./change_passwords $OLD_APPS_PASSWORD $APPS_PASSWORD $WLS_PASSWORD fi echo $APPS_PASSWORD | ./wf_config_workflow echo $WLS_PASSWORD | ./adstrtal.sh apps/$APPS_PASSWORD (echo $SRC;echo $DATE) | /home/oracle/config/set_home_announce.sh
  • 59.
    April 2-6, 2017in Las Vegas, NV USA #C17LV Copyright ©2017 Michael Brown References • My Oracle Support • 1383621.1 Cloning Oracle E-Business Suite Release 12.2 with Rapid Clone • 224274.1 How to Make a Copy of an Open Database for Duplication to a Different Machine • James Morrow After the Clone: Things adcfgclone Doesn’t do… 59
  • 60.

Editor's Notes

  • #4 KISS principle, Delta 7 gives us dualfs
  • #6 This could be a single node. Starting with the target machine(s) up and running and configured to run the EBS/DB and prepared source
  • #7 DB Oracle Home is copied
  • #8 Database is copied (there may have been a configuration step here, but will be discussed later)
  • #9 Configure the database tier. You now have a working copy of the database.
  • #10 Copy the apps tier (copy could actually be concurrent with other copies). It is not needed until after the target db is configured.
  • #11 Configure the applications on the target
  • #12 You now are running a copy of the source system.
  • #13 There are some extra steps involved when cloning 12.2. I will attempt to point these out throughout the presentation. This can be a major impact on how your business is currently run.
  • #14 I have started using ADZDSHOWED.sql because this should continue to work even if Oracle changes the codes in ad_adop_sessions, although I may have to worry about them changing PATCH as the edition name. Every time you update the AD/TXK patches, make sure your method of detection still works.
  • #15 Can normally skip unless configuration changes have been made, e.g. patches. I always run on apps tier 12.2 change is because of WLS
  • #17 DB Oracle Home is copied
  • #18 Configure the Oracle Home
  • #19 Don’t expect to be able to shutdown for clones. Bad idea to shutdown regularly in any case
  • #20 Get a working database up using the newly configured oracle home
  • #21 Configure the database tier. You now have a working copy of the database.
  • #22 Single Sign On will not configure correctly without adupdlib
  • #23 We did a little handwaving at this point, so let’s talk about how you get this clone done.
  • #24 Headless can just automatically catalog the backup location or can use a catalog connection. If this works, you know you can restore your source in a disaster rman handles creating the control file as well as restoring and recovering the database initDEV.ora.dup means it will be saved as I like it for cloning
  • #25 You can just do file copies when in backup mode, but if you are using copies, really should switch to rman
  • #26 This is instead of
  • #28 We will go into more detail when we talk about automating the process
  • #30 Copy the apps tier (copy could actually be concurrent with other copies). It is not needed until after the target db is configured.
  • #31 cp –RH preserves links on most Unix systems. rsync is my tool of choice (rsync uses ssh by default on most current Linux releases) Suggestion NFS mount from the database node to the applications node
  • #32 I disable all alerts, put concurrent requests on hold except for a defined set of users. JAR files will still be signed correctly if using the same code signing certificate, but you must put it back in place in the $INST_TOP (both tiers or run FS_CLONE)
  • #35 This needs to be run on the source before cloning to the target
  • #43 12.2 replaces this with just the instance name as part of configuring the apps tier. You need to run this as a post apps tier clone step if you want the source to be kept
  • #44 You can copy what you need or use disk technology to get it all and then cleanup