LISTING 13: This script, condiAnalyze1db.sh, is called by dbAdmCron.sh (see Listing 10). It invokes the condiAnalyze() procedure. #!/bin/ksh # Filename : condiAnalyze1db.sh # Author : Julius J.Y. Lin 01/09/96 # Purpose : procedures to invoke group analyze for the specified SID and USR # ================================================================ if (( $# < 1 )) ; then echo " Usage : $0 USR " exit fi # ---------------------------------- typeset -u USR=$1 echo "Start $0 $* at `date`" wday=`date +%w` # you select the database with max groups, if you want all the group to be analyzed. # next groups are in database $SID, which reside in a 8 CPUs UNIX host, I use 2 processes/ CPU, # so the entire database are divided into approximately 16 equal rows group, also try to functional # group them too. The I/O of each group of tables is also evenly distributed among striped disk # volume groups in EMC2 disk farm. By doing so, you can shrink 16x times into 1x time when you # analyze a VLDB. groups='a b c d e f g h i j k l m n o p q' cd /oracle/daily.log # to end, then keep 1 week's log files for grp in $groups ; do sqlplus -s system/$(systpswd "open seasame") < reCA_$ORACLE_SID.log$wday echo "********** end 1st/2, start 2nd/2 re-analyze at `date` ********* " >> \ reCA_$ORACLE_SID.log$wday sqlplus -s system/$(systpswd "open seasame") <> reCA_$ORACLE_SID.log$wday echo "all Re-Analyze processes are end at `date`" echo "cp ca$ORACLE_SID.log condAnal$ORACLE_SID.log$wday" cp ca$ORACLE_SID.log condAnal$ORACLE_SID.log$wday