+ All Categories
Home > Documents > Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over...

Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over...

Date post: 23-Apr-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
60
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
Transcript
Page 1: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

Session ID:

Prepared by:

AutomatingYourCloneinE-BusinessSuiteR12.2BestofCollaborate22-AUG-2017

BestofCollaborate

MichaelBrown,BlueStar

@MichaelBrownOrg

Page 2: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Who Am I?

Over 22 years experience with Oracle DatabaseOver 18 years experience with E-Business SuiteChair, OAUG Database SIGSecretary, OAUG Sysadmin SIGCo-Founder AppsPerfOracle ACEOAUG Member of the Year 2013Applications DBA, BlueStar

2

Page 3: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Assumptions

• Oneapplicationsnode• NotRAC• Unixcommands• AD/TXKDelta8+

3

Page 4: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Overview

• ManualClone• AutomatetheClone• FinishingTasks

4

Page 5: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

Cloning

5

Apps Filesystem

Oracle Home

DB

Target

Page 6: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

Cloning

6

Apps Filesystem

Oracle Home

DB

Target

Oracle Home

Copy

Page 7: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

Cloning

7

Apps Filesystem

Oracle Home

DB

Target

Copy

Oracle Home

DB

Page 8: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ConfigureSource

Cloning

8

Apps Filesystem

Oracle Home

DB

Target

Oracle Home

DB

Page 9: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

Cloning

9

Apps Filesystem

Oracle Home

DB

Target

Copy

Oracle Home

DB

Apps Filesystem

Page 10: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

Cloning

10

Apps Filesystem

Oracle Home

DB

Configure

Target

Oracle Home

DB

Apps Filesystem

Page 11: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

Cloning

11

Apps Filesystem

Oracle Home

DB

Target

Oracle Home

DB

Apps Filesystem

Page 12: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

12.2Patching• Thesupportnotestatesthatbeforecloning,completeanypatchingcyclethroughthefinal(cleanup)phase.

• Thisincludesrunningfs_clone

• Implications• Nightlyclonesforreporting/support• On-Demandclones• fs_clone isnotnormallyrequired(maybestatedinthepatchnote,middletiertechnologypatches,abortedpatchcycles)

12

Page 13: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

12.2Patching

• Checkifadop sessionisactive• AppsTier

• adop –status• SQL

• Selectdecode(status,’C’,’Not Active’,’Active’)fromad_adop_sessionswhereadop_session_id=(selectmax(adop_session_id)fromad_adop_sessions);

• $AD_TOP/sql/ADZDSHOWED.sql• LookforPATCHeditionintheresult

• Cannotclone

Page 14: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Preclone

• Oraclebuildsstaginginformationtouseaftertheclone.• AppsTier

• $ADMIN_SCRIPTS_HOME• adpreclone.pl appsTier

• DatabaseTier• $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME• adpreclone.pl dbTier

• GeneralComment• Stagingareaismuchlargerthaninpriorreleasesbecauseitincludesthetechstack.

• MakesureyouareintheRUNfilesystem whenrunningadpreclone.pl

14

Page 15: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DATABASE TIER

Page 16: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

HotDBClone

16

Apps Filesystem

Oracle Home

DB

Target

Oracle Home

Copy

Page 17: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ConfigureSource

HotDBClone

17

Apps Filesystem

Oracle Home

DB

Target

Oracle Home

Page 18: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

HotDBClone

• adcfgclone.pl dbTechStack• Relinktheoracle_home• Configuretheinit.ora,listener,etc.• Registerthehomewiththecentralinventory• Startthelistener

18

Page 19: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

HotDBClone

19

Apps Filesystem

Oracle Home

DB

Target

Clone

Oracle Home

DB

Page 20: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ConfigureSource

HotDBClone

20

Apps Filesystem

Oracle Home

DB

Target

Oracle Home

DB

Page 21: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DBClone• Setthedynamiclibraryextension

• cd$ORACLE_HOME/appstuil/install/$CONTEXT_NAME• sqlplus /assysdba @adupdlib so

• adcfgclone.pl dbconfig$ORACLE_HOME/appsutil/$CONTEXT_NAME.xml

• Configurethedataforthetarget

21

Page 22: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

HotDBClone

22

Apps Filesystem

Oracle Home

DB

Target

Clone

Oracle Home

DB

Page 23: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

RMANDuplicate• Canbefrombackupsortheactivedatabase• SUGGESTION:Atleastoneregularcloneisfrombackuppreferablywithnoconnectiontothesourceatall

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.dup" BACKUP LOCATION ’/rman/prod';

}

23

Page 24: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

OtherHotBackup

• Commontoalloftheseisthefactoldschoolhotbackupcommandsareused

• ALTERDATABASEBEGINBACKUP• ALTERDATABASEENDBACKUP

or• ALTERTABLESPACEXXXBEGINBACKUP• ALTERTABLESPACEXXXENDBACKUP

• MOSNote224274.1HowtoMakeaCopyofanOpenDatabaseforDuplicationtoaDifferentMachine

24

Page 25: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

SANTechnologies• BewareProductionImpacts!• SplitMirrors

• Bestifyourvendorsupportsdifferentialresync(ifyouclonefrequently)

• Snapshots• Reducedspacerequirements,quicktocreate• Mustberead/write(copyonwrite)

• SnapshotBasedMirrors• Startslikesnapshot,thencopiesblocksinthebackground

25

Page 26: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

OtherPossibilities

• Snapshotsoffdataguard• Delphix

• zfs basedappliance• Ihavenotusedandamnotaffiliated

26

Page 27: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

FinishingTasks

• OnlySitelevelitemsareimpactedwhenconfiguringtheapplicationstier

• YoumayhaveURLsorotherprofilesvaluesthatmustbechangedmanually

• WorkflowMAIL_STATUS• Etc.

Page 28: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

APPLICATIONSTIER

Page 29: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Source

ApplicationsTier

29

Apps Filesystem

Oracle Home

DB

Target

Copy

Oracle Home

DB

Apps Filesystem

Page 30: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ApplicationsTier• Copythefiles

• Mustpreservesymboliclinks• APPL_TOP,COMMON_TOP,10.1.2techstackfromRunfilesystem(eitherfs1orfs2)tothesamedirectoryonthetarget

• Thatisif$RUN_BASEonthesourceis/prod/apps/fs2,thetargetcouldbe/uat/apps/fs2

• Aftercopyingthefiles• adcfgclone.pl appsTier dualfs

• NeedtousethesameportpoolyouusedwithdbTechStack (ordbTier)

• Needtohaveread/writeaccesstooneofthedirectoriesyougaveforthedbTier

• Youwillbepromptedwithalistofthem• Dualfs optioncreatesthepatchfilesysteminonerunofadcfgclone.pl

30

Page 31: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

Finishingtasks

• Fixprofileoptions• RapidClonewillfixsitelevelprofiles,butitwillmissthingslikeaUserlevelURL

• Updateprintersifrequired• FixWorkflow

• $FND_TOP/sql/afsvcpup.sql• Re-signtheJARfiles

• $INST_TOPisgeneratedonthetarget,younolongerhavethesamecodesigningasthesourcesincethekeysarein$APPL_TOP_NE/ad/admin

• Etc.

31

Page 32: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

AUTOMATETHEPROCESS

Page 33: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier• Abortifinpatchingsession

ADOP_STATUS=$(sqlplus –s /nolog <<EOF | grep ADOP_STATUS | tail -1 | cut –f2 –d:Connect apps/$APPS_PWDSelect ‘ADOP_STATUS:’||statusFrom ad_adop_sessionsWhere adop_session_id==(selectmax(adop_session_id)fromad_adop_sessions)/EOF)If [ “$ADOP_STATUS” != ‘C’ ]; thenexit 1

fi

Page 34: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

RetrievetheRUN_BASE

• SELECTextractvalue(xmltype(text),'//CURRENT_BASE')FROMfnd_oam_context_files wherestatus='S'and namenotin('TEMPLATE','METADATA')andextractvalue(xmltype(text),'//file_edition_type')='run’;

Page 35: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier

• DoORACLE_HOMEmanuallyifrequired• DBPatches• Upgrade

• Automatedprocesswillpickupwithcloningthedatabase

• Setupssh affinitytoappsnodeifdifferentthandatabasenode

• Don’twanttocloneappstierifthedatabasefails

Page 36: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier

• Shutdowntheappstier• ssh appsnode /scripts/shutdown_wait

• adcmctl.sh abort• adstpall.sh

• PreserveUniqueData• Logicalbackupofrequireddata• Apexapplications

• Cleanup• Removebackups

Page 37: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier

rman target/<<EOF

setechoon

crosscheckbackupdevicetypedisk;

crosscheckcopydevicetypedisk;

crosscheckarchivelog all;

deletenoprompt backup;

deletenoprompt expiredbackupdevicetypedisk;

deletenoprompt expiredcopydevicetypedisk;

deletenoprompt expiredarchivelog all;

unregisterdatabasenoprompt;

EOF

Page 38: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier

• PreserveUniqueData• Logicalbackupofrequireddata• Apexapplications• Rman configuration

• Cleanup• Removebackups• Shutdownandremovedatafiles andlogs

Page 39: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier

• Clonethedatabase• Haveapfile withthecorrectsettingsfortheclone,e.g.initDEV.ora.dup

• db_file_name_convert• log_file_name_convert

• Scripttherman duplicate• Passthedateorusesomethingbasedonsysdate

• Restoretheuniquedata• Restartthedatabase

Page 40: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier• Configurethedatabase

• adupdlib.sql• adcfgclone.pl dbconfig $CONTEXT_FILE

• Changesys/systempasswords• Disablealerts

updatealr_alertssetenabled_flag='N',LAST_UPDATE_DATE=SYSDATE,LAST_UPDATED_BY=(selectuser_id fromfnd_user where

user_name='SYSADMIN')whereenabled_flag='Y';

Page 41: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier• ConcurrentRequests

• Putrequestsonholdupdatefnd_concurrent_requestssetHOLD_FLAG='Y',LAST_UPDATE_DATE=SYSDATE,LAST_UPDATED_BY=(selectuser_id fromfnd_user whereuser_name='SYSADMIN')

whererequested_by notin(selectuser_idfrom fnd_userwhereuser_name in('SYSADMIN'

))and phase_code='P'and hold_flag='N'/

Page 42: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

DatabaseTier• ProfileOptions

• SetSITENAMEupdatefnd_profile_option_valuessetprofile_option_value= (selectrtrim(ltrim(global_name))fromglobal_name)||'(Clonedfrom'||nvl('&&SOURCE',’PROD')||'on'||nvl('&&SOURCEDATE',to_char(SYSDATE,'MM/DD/YYHH24:MI'))||')’,LAST_UPDATE_DATE=SYSDATE,LAST_UPDATED_BY=(selectuser_id fromfnd_user whereuser_name='SYSADMIN')

Wherelevel_id=10001And(profile_option_id,application_id)in(selectprofile_option_id,application_idfromfnd_profile_options whereprofile_option_name='SITENAME')/

Page 43: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ApplicationsTier• Cleanuptheappstier

• OnlywantEBSapps from$RUN_BASEonthesource• Ifyouhaveroom

• mvfs1fs2fs_ne zap• rm –rf zap&

• mkdir fs1fs2fs_ne• rsync EBSapps fromsource$RUN_BASEtosimilarpathontarget

Page 44: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ApplicationsTier• $INST_TOP/appl/admin/${CONTEXT_NAME}_run.txt

• Samplepairsfile• Needtoaddpatch_s_port_pool

• (echo$APPS_PASS;echo$SYSTEM_PASS;echo$WLS_PASSWORD;echon)|adcfgclone.plcomponent=appsTierpairsfile=/home/oracle/clone/TARGET_pairs.txtdualfs=yes

Page 45: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ApplicationsTier• Otheroptionsistobuildadriverfileoftheresponsesyougavemanually

catresponses.txt |adcfgclone.pl appsTier dualfs

• Passwords• FNDCPASSletseverythingbeoncommandlinesoiteasiertoscript

Page 46: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ApplicationsTier• Passwords

• APPSPassword• FNDCPASSapps/$APPSPWD0Ysystem/$SYSTEMPWDSYSTEMAPPLSYS$NEW

• NeedtofixthepasswordstoredinWLS• StartAdminServer usingthe$INST_TOP/admin/scripts/adadminsrvctl.sh

script.Donotstartanyotherapplicationtierservices.• ChangetheAPPSpasswordinWLSDataSourcebyrunningthethe

followingscriptasshown:• perl $FND_TOP/patch/115/bin/txkManageDBConnectionPool.pl

• Whenprompted,select'updateDSPassword'tochangetheAPPSpasswordintheWLSDatasource.

Page 47: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ApplicationsTier• Passwords

• OtherSchemaPasswords• FNDCPASSapps/$NEW0Ysystem/$SYSTEMPWDALLORACLE$NEW

• FNDCPASSapps/$NEW0Ysystem/$SYSTEMPWDORACLEschema$NEW

• UserPasswords• FNDCPASSapps/$NEW0Ysystem/$SYSTEMPWDUSERebsusernewpass

Page 48: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

ApplicationsTier

• Workflow• @$FND_TOP/sql/afsvcpup.sql

• Scriptwithinputstosetvalues(thisisthetestoverrideaddress)sqlplus apps/$APPS_PWD@$FND_TOP/sql/afsvcpup.sql <<[email protected]

Page 49: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt

• Sinceweneedtocopythesource’sapplicationtier,setupssh affinityfromthesourceappsnode

• Eithercallindividualscriptsfromthemasterscriptorbundlethecodetogether

• Iprefertocallindividualscripts

• Checkstatusaftereachstep,abortandalertifthereisanissue

Page 50: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(ProductionDatabaseServer)#!/bin/bash./u01/app/oracle/db/tech_st/11.2.0.4/PROD_proddb.env./etc/sysconfig/PRODADOP_STATUS=$(sqlplus -s/nolog <<EOF|grepADOP_STATUS|tail-1|cut-f2-d:Connectapps/$APPS_PASSWORDSelect'ADOP_STATUS:'||statusFromad_adop_sessionsWhereadop_session_id=(selectmax(adop_session_id)fromad_adop_sessions)/EOF)if["$ADOP_STATUS"!='C'];thenecho"CLONEABORTED,activepatchingcycle"exit1elseecho"Notinpatchingcycle,clonecanproceed"fi

Page 51: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(ProductionDatabaseServer)RUN_BASE=$(sqlplus -s/nolog <<EOF|grepRUN_BASE|tail-1|cut-f2-d:Connectapps/$APPS_PASSWORDSelect'RUN_BASE:'||extractvalue(xmltype(text),'//CURRENT_BASE')FROMfnd_oam_context_files wherestatus='S'andnamenotin('TEMPLATE','METADATA')andextractvalue(xmltype(text),'//file_edition_type')='run';/EOF)ACTIVE_FS=$(basename $RUN_BASE)echo$ACTIVE_FSSRC_PASSWORD=$(echo $1 | tr '[A-Za-z0-9]''[N-ZA-Mn-za-m5-90-4]')ssh targetdbserver target$SRC_PASSWORD$ACTIVE_FS

Page 52: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(TargetDBServer)#!/bin/bash

if["$#"-ne"2"];then

echo"Usage:$(basename $0)SRC_APPS_PASSWORDRUN_BASE"

exit1

fi

exportSRC_PASSWORD=$(echo$1|tr '[A-Za-z0-9]''[N-ZA-Mn-za-m5-90-4]')

exportRUN_BASE=$2

if["$RUN_BASE"!='fs1'-a"$RUN_BASE"!='fs2'];then

echo"RUN_BASEmustbefs1orfs2"

exit1

fi

./etc/sysconfig/TARGET

if[-fFULL_PATH_TARGET_ENV_FILE ];then

.FULL_PATH_TARGET_ENV_FILEP2_finup2db.env

else

echo"Unabletosetenviroment"

exit1

fi

exportDISPLAY=$(grep'"\s_display\"'$CONTEXT_FILE|cut-f2-d\>|cut-f1-d\<)

Page 53: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(TargetDBServer)

XPORT=$(echo$DISPLAY|cut-f2-d:)if!/usr/bin/xdpyinfo &>/dev/null;thenvncserver :$XPORT

fi/home/oracle/dba/bin/stop-glassfishsqlplus apps/$APPS_PASSWORD<<EOF|grep'X'>/dev/nullselect*fromdual;EOFstatus=$?if["$status"-eq 0];thenssh TARGETAPPSERVER /home/oracle/apps_shutdown abortsqlplus /assysdba <<EOFshutdownabortEOFlsnrctl stopTARGETfiexportDATE=$(date+'%d-%b-%Y')

Page 54: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(TargetDBServer)COMMAND_TO_DUP_AND_RENAME_DB–DBandlistenerareupandsys/systempasswordschanged

cd$ORACLE_HOME/appsutil/install/FINUP2_finup2db

sqlplus /assysdba <<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

Page 55: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(TargetAPPServer)

./etc/sysconfig/TARGETDISPLAY=$(grep'^s_display'/home/oracle/config/pairsfile.txt.fs2|cut-f2-d=)XPORT=$(echo$DISPLAY|cut-f2-d:)if!/usr/bin/xdpyinfo &>/dev/null;thenvncserver :$XPORT

ficd/u01/app/oracle/appsmkdir signcp /u01/app/oracle/apps/fs_ne/EBSapps/appl/ad/admin/*sign/

Page 56: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(TargetAPPServer)

mkdir zapmvfs1fs_ne zapmvfs2/FMW_Home fs2/inst zapmv../oraInventory/*zapnohup rm -rf zap&Optional:CopycorrectCorporateBrandingintoplaceinpathtoOA_MEDIAcd/u01/app/oracle/apps/fs2/EBSapps/comn/clone/binecho"Entersourceappspassword"readOLD_APPS_PASSWORDecho"Sourceofclone:"readSRC

Page 57: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(TargetAPPServer)

DATE=$(date+'%d-%b-%Y%H:%M')echo"Dateofclone(default$DATE):"readcdateif["$cdate"!=""];thenDATE="$cdate"fi(echo$OLD_APPS_PASSWORD;echo $WLS_PASSWORD;echo 'n')|./adcfgclone.plcomponent=appsTier pairsfile=/home/oracle/config/pairsfile.txt.fs2dualfs=yesstatus=$?if["$status"-ne0];thenecho"Somethingwentwrong"exit$status

fi

Page 58: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

BundleIt(TargetAPPServer)

cp /u01/app/oracle/apps/sign/*/u01/app/oracle/apps/fs_ne/EBSapps/appl/ad/admin/./u01/app/oracle/apps/EBSapps.env runcd/u01/app/oracle/apps/etccecho$OLD_APPS_PASSWORD|./checkMTpatch.shcd/home/oracle/dba/cloneif["$OLD_APPS_PASSWORD"!="$APPS_PASSWORD"];then./change_passwords $OLD_APPS_PASSWORD$APPS_PASSWORD$WLS_PASSWORDfiecho$APPS_PASSWORD|./wf_config_workflowecho$WLS_PASSWORD|./adstrtal.sh apps/$APPS_PASSWORD(echo$SRC;echo $DATE)|/home/oracle/config/set_home_announce.sh

Page 59: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

April2-6,2017inLasVegas,NVUSA#C17LVCopyright ©2017 Michael Brown

References

• MyOracleSupport• 1383621.1CloningOracleE-BusinessSuiteRelease12.2withRapidClone

• 224274.1HowtoMakeaCopyofanOpenDatabaseforDuplicationtoaDifferentMachine

• JamesMorrowAftertheClone:Thingsadcfgclone Doesn’tdo…

59

Page 60: Tips and Tricks from an Apps DBA - Automating …Over 22 years experience with Oracle Database Over 18 years experience with E-Business Suite Chair, OAUG Database SIG Secretary, OAUG

Q&[email protected]://blog.michael-brown.org


Recommended