Pennsylvania BANNER Users Group 2006 Instance Neutral Cloning Script Robin Ying 760-355-6377 Imperial Valley.

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Repaso: Unidad 1 Lección 2
1 A B C
Scenario: EOT/EOT-R/COT Resident admitted March 10th Admitted for PT and OT following knee replacement for patient with CHF, COPD, shortness of breath.
AKC Rally Signs These are copies of the 2008 AKC Rally signs, as re-drawn by Chuck Shultz. Use them to print your own signs. Be prepared to use a LOT of.
AP STUDY SESSION 2.
1
& dding ubtracting ractions.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Myra Shields Training Manager Introduction to OvidSP.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Objectives: Generate and describe sequences. Vocabulary:
David Burdett May 11, 2004 Package Binding for WS CDL.
Pennsylvania Banner Users Group 2008 Fall Conference
Pennsylvania BANNER Users Group 2006 Taming the ENV Settings Robin Ying Imperial Valley College.
Pennsylvania BANNER Users Group 2007 Automating the Freshman Parent Load.
Pennsylvania Banner Users Group 2008 Fall Conference Finance Reporting from the ODS using Cognos.
Pennsylvania BANNER Users Group 2007 Oracle Discoverer Web Reports for the Provost & Deans.
We need a common denominator to add these fractions.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Process a Customer Chapter 2. Process a Customer 2-2 Objectives Understand what defines a Customer Learn how to check for an existing Customer Learn how.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
Custom Services and Training Provider Details Chapter 4.
CALENDAR.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Break Time Remaining 10:00.
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
ETS4 - What's new? - How to start? - Any questions?
PP Test Review Sections 6-1 to 6-6
1 DARTBOARD Tutorial: DARTBOARD Access and Use for Faculty and Staff Tutorial: DARTBOARD Access and Use for Faculty and Staff.
1 The Blue Café by Chris Rea My world is miles of endless roads.
Bright Futures Guidelines Priorities and Screening Tables
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Copyright © 2013, 2009, 2006 Pearson Education, Inc. 1 Section 5.5 Dividing Polynomials Copyright © 2013, 2009, 2006 Pearson Education, Inc. 1.
Sample Service Screenshots Enterprise Cloud Service 11.3.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
Subtraction: Adding UP
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Analyzing Genes and Genomes
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Essential Cell Biology
Converting a Fraction to %
Clock will move after 1 minute
PSSA Preparation.
& dding ubtracting ractions.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
Presentation transcript:

Pennsylvania BANNER Users Group 2006 Instance Neutral Cloning Script Robin Ying Imperial Valley College

2 General Announcements: Please turn off all cell phones/pagers If you must leave the session early, please do so as discreetly as possible Please avoid side conversations during the session Questions will be answered at the end of the session Thank you for your cooperation

3 Background Our Environment: – Users want to have their exclusive cloned databases – AR, FA, FIN, HR, STU. – Adding the TEST, PPRD, CURR, TRNG, and IVC (production), there are 10 instances. – Using the opportunity of conversion from Version 6 to Version 7 to clean up the code. – Having failed history due to production database parameter changes.

4 Goals of Refactoring Allow only one place to make code changes. – Simplifies maintenance when the parameter of the production database changes Avoid any hard-coded path names. Avoid any hard-coded instance names. Not affecting the baseline, maintaining the directory structure and hierarchy. – Easy to carry forward Refactoring Result – separating the old code into an incidence independent (generic) part and a calling part.

5 Walk through the code... 3 # CLONE.shl -- generic clone script, no hard-coded pathnames. 5 # Usage: CLONE.shl $1 $2 $3 $4 $5 $6 6 #$1: oracle_sid of clone 7 #$2: backup dir of the source dataabase (e.g. /u04/backups/IVC) 8 #$3: dest dir of the clone database (e.g. /u02/oradata/$ORACLE_SID) 9 #$4: command dir of the clone database (e.g. /u01/app/oracle/admin/$ORACLE_SID/scripts) 10 #$5: oracle_sid of production instance (e.g. IVC) 11 #$6: archive directory (e.g. /logs/archive) 13 #Run this script as oracle (i.e. "su oracle") 19 set -e 20 [ $# != 6 ] && { echo "Usage: $0 oracle_sid source_dir dest_dir cmd_dir"; exit 1; } 21 [ $1 = $5 ] && { echo "$5 is the production instance!!"; exit 1; } 6 parameters Error checking

6 Walk through the code ORACLE_SID=$1# command line overrides env setting 24 BACKUPDIR=$2 25 DESTDIR=$3 26 CMDDIR=$4 27 PROD=$5 28 ARCHDIR=$6 29 PATH=/usr/local/oracle/bin:/bin 30 oraenv=/usr/local/bin/oraenv_local 31 export PATH ORACLE_SID 36 /bin/grep $ORACLE_SID $oraenv > /dev/null 37 [ $? = 0 ] || { echo "$ORACLE_SID is not a valid ORACLE_SID"; exit 1; } 39 # /bin/grep $PROD $oraenv > /dev/null 40 # [ $? = 0 ] || { echo "$PROD is not a valid ORACLE_SID"; exit 1; } 42 [ -d $ARCHDIR ] || { echo "$ARCHDIR does not exits"; exit 1; } 43 [ -d $BACKUPDIR ] || { echo "$BACKUPDIR does not exits"; exit 1; } 44 [ -d $CMDDIR ] || { echo "$CMDDIR does not exits"; exit 1; } 45 [ -d $DESTDIR ] || { echo "$DESTDIR does not exits"; exit 1; } Error checking

7 Walk through the code # Get a clean shutdown of the database to avoid temp file problems. 50 sqlplus /nolog << EOF 51 connect /as sysdba 52 shutdown abort 53 startup restrict 54 shutdown immediate 55 EOF 57 # cleanup old files to avoid write/overwrite errors 58 rm -f $DESTDIR/* 60 # copy all files from the BACKUPDIR 61 for f in $BACKUPDIR/* 62 do 63echo "-- copying $f to $DESTDIR..." 64cp -rp $f $DESTDIR 65 done 67 # copy the archive files 68 echo "-- copying archive files to $DESTDIR..." 69 find $ARCHDIR -name "*.arc" -mtime -3 -exec cp -rp {} $DESTDIR \;

8 Walk through the code # Rename files 72 echo "-- rename files in $DESTDIR..." 73 for f in $DESTDIR/*${PROD}* 74 do 75mv $f `echo $f | sed "s/$PROD/$ORACLE_SID/"` 76 done 78 # generate the sql script for recreating the control file 79 # modify here if the control files are changed. 80 tmpf=$DESTDIR/create_${ORACLE_SID}_ctlfile.sql 82 echo "STARTUP NOMOUNT 118 '$DESTDIR/${ORACLE_SID}_xdb_01.dbf' 119 CHARACTER SET WE8ISO8859P1;" > $tmpf Keep the parameters in one place only

9 Walk through the code # run the sql script 122 echo "-- recreating control files..." 123 sqlplus /nolog << EOF 124 connect /as sysdba 126 EOF 128 # apply all of the archive files in the BACKUPDIR to bring the database up to last good file 129 # and clean up the archive files 130 for f in $DESTDIR/*.arc 131 do 132echo "-- applying archive file $f..." 133sqlplus /nolog << EOF 134connect / as sysdba 135recover database using backup controlfile until cancel; 136$f 137cancel 138 EOF 139 done 140 rm $DESTDIR/*.arc

10 Walk through the code # generate the sql script for opening up the database and configure for the 143 # clone instance. modify here if needed. 144 tmpf=/tmp/after_${ORACLE_SID}_clone.sql 145 pls=/pls/`echo $ORACLE_SID | dd conv=lcase` 2> /dev/null 147 echo "ALTER TABLESPACE TEMP ADD TEMPFILE '$DESTDIR/${ORACLE_SID}_temp_01.dbf' 148 SIZE REUSE AUTOEXTEND ON NEXT MAXSIZE 2000M; Update ae_paths table for Xtender UPDATE OTGMGR.AE_PATHS SET PATH='E:\IMAGES\$ORACLE_SID\FT_PATH' WHERE PATHID=4;" > $tmpf Keep the parameters in one place only

11 Calling Script 6 SID=FA# set the oracle_sid 8 BACKUPDIR=/u04/backups/IVC# backup of the production database 9 ARCHIVEDIR=/logs/archives # archive directory 11 DESTDIR=/u02/oradata/$SID# directory of FA database 12 CMDDIR=/u01/app/oracle/admin/$SID/scripts # directory of FA clone commands 23 sh CLONE.shl $SID $BACKUPDIR $DESTDIR $CMDDIR IVC $ARCHIVEDIR >> ${SID}_clone_$$.log 2>&1 6 parameters

12 PABUG 2006

Pennsylvania BANNER Users Group 2006 Have a great day! Robin Ying Imperial Valley College