home *** CD-ROM | disk | FTP | other *** search
- :
- #
- # $Header: oracle.ver.pp,v 6.6 89/05/15 16:03:59 ksriniva Exp $ oracle.ver.pp
- #
- #
- # oracle.verify
- #
- # Master verification script for ORACLE products.
- #
- # Usage: oracle.verify [-d] [-n] [product ... ]
- # The -d option turns on ORACLE_DEFAULT so that no questions will be
- # asked. The default values will always be used.
- # The -n option turns on NO_CONFIRM which suppresses asking whether
- # individual products should be verified. All products will be
- # verified.
- # If product names are present on the command line, only those present
- # will be considered for verification.
- #
- # It is recommended, but not required, that all other ORACLE VERIFY
- # scripts be run from this script.
- #
- # oracle.verify assumes that the rdbms and all products to
- # be verified have been successfully installed and the
- # database instance is up when oracle.verify is called.
- #
-
- NETLIBNAME="nsl_s"
- PHYS_BLK_SIZE=2048
- VNDR_NETLIBS="-lnsl_s "
- CHOWN=/bin/chown
- MAKE=make
- ORACLE_LPPROG="/usr/bin/lp"
- ORACLE_PAGER="/usr/bin/more"
- ORACLE_LPSTAT="/usr/bin/lpstat"
-
- #
- # Allow verification/trace to be turned on and off.
- #
- case "$ORACLE_TRACE" in
- T) set -x ;;
- esac
-
- #
- # Print abort message on interupt.
- #
- trap 'echo "ORACLE Verification Aborted!"; exit' 1 2 3 15
-
- #
- # PRODUCTS is a list of all possible products extracted from oracle.key.
- # RDBMS should always be at the beginning of the list. The user is
- # prompted to verify the products in the order they occur in this list.
- #
- # Note: rdbms.verify uses SQL*Plus demo tables. In other words,
- # it is assumed that both RDBMS and SQL*Plus are
- # included in every ship tape.
- #
- ALL_PRODUCTS=`awk -F: '{print $2}' $ORACLE_HOME/install/oracle.key`
- ALL_PRODUCTS=`echo $ALL_PRODUCTS | sed -e 's/rdbms//'`
- ALL_PRODUCTS="rdbms $ALL_PRODUCTS"
-
- PROD=
- PRODS=
- for i in $* ; do
- case $i in
- -n) NO_CONFIRM=T ;;
- -d) ORACLE_DEFAULT=T ; export ORACLE_DEFAULT ;;
- *) PROD=`echo $ALL_PRODUCTS | tr ' ' '\012' | grep "^$i$"`
- case $PROD in
- "") echo ""
- echo "Unrecognized product name, ${i}."
- echo "Exiting verification."
- exit 1 ;;
- *) PRODS="$PRODS $PROD" ;;
- esac ;;
- esac
- done
- case "$PRODS" in
- "") PRODUCTS=$ALL_PRODUCTS;;
- *) PRODUCTS=$PRODS ;;
- esac
- # This is to let sub-verify know they do not have to carry out an
- # install.
- ORACLE_INSTALL=T
- export ORACLE_INSTALL
-
- #
- # Determine how to suppress newline with echo command.
- #
- if echo "\c" | grep c >/dev/null 2>&1; then
- N='-n'
- else
- C='\c'
- fi
- export N C
-
- #
- # Determine whether to use test -x or test -f
- #
- if test -x "$0" > /dev/null 2>&1 ; then
- TESTX=-x
- else
- TESTX=-f
- fi
- export TESTX
-
- #
- # Make sure that the script is being run from $ORACLE_HOME.
- # Check that at least the $ORACLE_HOME/install directory exists.
- #
- case "$ORACLE_HOME" in
- "") DIR=`pwd`
- case "`basename $DIR`" in
- install) cd .. ;;
- esac
- ORACLE_HOME=`pwd` ;;
- *) cd $ORACLE_HOME ;;
- esac
-
- if [ ! -d $ORACLE_HOME/install ] ; then
- echo ""
- echo "No ORACLE install directory found in $ORACLE_HOME. "
- echo "Check the following:"
- echo " . The distribution has been loaded onto disk and is readable."
- echo " . oracle.verify is being invoked from the directory in which ORACLE"
- echo " was loaded."
- echo " . The environment variable ORACLE_HOME is either undefined, or set "
- echo " to the directory in which ORACLE was loaded."
- echo "Exiting ORACLE verify."
- exit 1
- fi
- INSTALL_HOME="$ORACLE_HOME/install"; export INSTALL_HOME
-
- #
- # Display verify banner and information about default answers.
- #
- echo "Running ORACLE verify program ..."
- echo "
- Note: All questions are followed by a default value in brackets \"[default]\".
- Press RETURN to use this default rather than entering a value.
- Use a \"!\" to run a sub-shell. When you exit the sub-shell, you will
- be re-prompted with the original default value.
- "
- echo $N "Press RETURN to continue ...$C"
- DEFLT=""; . $INSTALL_HOME/read.sh; WAIT=$RDVAR
-
- #
- # Get defaults from $INSTALL_HOME/.defaults if it exists
- #
- if [ -r $INSTALL_HOME/.defaults ] ; then
- . $INSTALL_HOME/.defaults
- fi
-
- #
- # Setup ORACLE_HOME, ORACLE_SID and ORACLE_OWNER.
- #
- echo ""
- echo "Checking ORACLE environment variables for verification ..."
-
- case "$ORACLE_HOME" in
- "") DEFLT=`pwd` ;;
- *) DEFLT="$ORACLE_HOME" ;;
- esac
- echo ""
- echo $N "Enter home directory for ORACLE database: $C"
- . $INSTALL_HOME/read.sh; ORACLE_HOME=$RDVAR
- export ORACLE_HOME
-
- case "$ORACLE_OWNER" in
- "") DEFLT="${USER-$LOGNAME}"
- case "$DEFLT" in
- root) DEFLT=oracle ;;
- esac ;;
- *) DEFLT="$ORACLE_OWNER" ;;
- esac
- echo ""
- echo $N "Enter the login name for the owner of this ORACLE database: $C"
- . $INSTALL_HOME/read.sh; ORACLE_OWNER=$RDVAR
-
- export ORACLE_OWNER
-
- case $ORACLE_SID in
- "") DEFLT=$ORACLE_OWNER ;;
- *) DEFLT=$ORACLE_SID ;;
- esac
- echo ""
- echo $N "Enter string for ORACLE system identifier: $C"
- . $INSTALL_HOME/read.sh; ORACLE_SID=$RDVAR
- export ORACLE_SID
-
- #
- # Make the defaults file
- #
- cat <<END > $INSTALL_HOME/.defaults
- LOG="$LOG"
- ORACLE_HOME="$ORACLE_HOME"
- ORACLE_SID="$ORACLE_SID"
- ORACLE_OWNER="$ORACLE_OWNER"
- END
- chmod 666 $INSTALL_HOME/.defaults
-
- #
- # Adjust PATH.
- #
- # This ensures that the path begins with ":"
- PATH=`echo $PATH | sed -e '/^[^:]/s/^/:/' -e 's/^:\.:/:/'`
- # This ensures that only one occurrance of "$ORACLE_HOME/bin" is in PATH
- STRIP=`echo $ORACLE_HOME/bin | sed "s./.\\\\\/.g"`
- STRIP=$STRIP"[:]"
- PATH=:$ORACLE_HOME/install:$ORACLE_HOME/bin`echo $PATH | sed "/${STRIP}/s///g"`
- export PATH
-
- #
- # Setup verification log file.
- #
-
- LOG=$ORACLE_HOME/install/verify.log
- echo "ORACLE VERIFICATION DIAGNOSTICS FILE" > $LOG
- echo "" >> $LOG
- chmod 666 $LOG
- export LOG
-
- echo ""
- echo "BEGINNING ORACLE VERIFICATION. "
- echo ""
- echo "The oracle.verify program assumes that all products to be verified"
- echo "have been successfully installed and that the database is currently up."
-
- while : ; do
- echo $N "OK to continue (Q to Quit) ? $C"
- DEFLT="Y"; . $INSTALL_HOME/read.sh; OK=$RDVAR
- case "$OK" in
- Y|y) break ;;
- N|n|Q|q) echo "ORACLE Verification Aborted!"
- exit 1;;
- *) echo "Enter Y, N, or Q please..." ;;
- esac
- done
-
- echo "Log of the whole verification process can be found in"
- echo " $ORACLE_HOME/install/verify.log"
-
- echo ""
- echo $N "Working .$C" #Wait message
- echo $N ".$C" #Wait message
-
- VERIFIED=""
- for PROD in $PRODUCTS
- do
- PROD_HOME=${ORACLE_HOME}/$PROD
- PROD_INFO=`fgrep :$PROD: $ORACLE_HOME/install/oracle.key`
- PROD_NAME=`echo $PROD_INFO | awk -F: '{print $3}'`
- SCRIPT=$ORACLE_HOME/`echo $PROD_INFO | awk -F: '{print $4}'`
- script=`basename $SCRIPT`
- SCRIPT=$SCRIPT.verify
-
- if [ -d "$PROD_HOME" ]; then
- echo ""
-
- case $NO_CONFIRM in
- "") while : ; do
- echo $N "Verify $PROD_NAME (Q to Quit) ? $C"
- DEFLT="Y"; . $INSTALL_HOME/read.sh; VERIFY=$RDVAR
- case "$VERIFY" in
- Y|y|N|n|Q|q) break ;;
- *) echo "Enter Y, N, or Q please..." ;;
- esac
- done ;;
- T) echo "" >> $LOG
- echo "Verifying $PROD_NAME ..." >> $LOG
- echo "" >>$LOG;;
- esac
-
- if [ "$VERIFY" = y -o "$VERIFY" = Y -o "$NO_CONFIRM" = T ] ; then
- chmod 554 $PROD_HOME/install/* > /dev/null 2>&1
- if [ $TESTX $SCRIPT ]; then
- case "$SYSTEM_PASS" in
- "") echo ""
- echo $N "Enter current SYSTEM account password: $C"
- DEFLT="manager"
- . $INSTALL_HOME/read.sh; SYSTEM_PASS=$RDVAR
- SYSTEM_PASS="system/${SYSTEM_PASS}"
- export SYSTEM_PASS ;;
- esac
-
- $SCRIPT
- echo " ###### Finished running ${script}.verify ######" >> $LOG
- echo " # Please check $PROD_HOME/install/${script}_ver.out #" >> $LOG
- echo "" >> $LOG
- echo "" >> $LOG
- echo "" >> $LOG
-
- VERIFIED="$VERIFIED $PROD"
- else
- echo "Executable verify script for $PROD_NAME not found."
- echo "Executable verify script for $PROD_NAME not found." >> $LOG
- echo "" >> $LOG
- echo "" >> $LOG
- echo "" >> $LOG
- fi
- else
- case "$VERIFY" in
- q|Q) sync ; exit 0 ;;
- esac
- fi
- fi
- done
-
- echo "
- Done."
- sync;sync;sync
- exit 0
-