#!/bin/sh # Program: start_db # Purpose: To start the database and the correct number of # page writers for a given database # Author: Adam Backman # Date: 04/29/98 # SCRIPTS=${SCRIPTS-/u3/users/adamb/scripts} HOSTNAME=`hostname` export SCRIPTS HOSTNAME # Start Page writers subroutine start_apws() { # Every database gets a biw probiw $DB_DIR/$DB # If AI is enabled a AIW is started if [ $BKAIDIR != "NO_AI" ] then proaiw $DB_DIR/$DB fi # Determine the number of APWs to start and start them if [ $APWS = "0" ] then break fi COUNTER=1 while [ $COUNTER -le $APWS ] do proapw $DB_DIR/$DB COUNTER=`expr $COUNTER + 1` done } case $1 in all|ALL|All) for i in `grep $HOSTNAME $SCRIPTS/live/db.registry | cut -s -f 1 -d "|" ` do if [ $i != "#DB" ] then . $SCRIPTS/live/read_registry $i if [ $? = "0" ] then if test -s $SCRIPTS/pf_files/$DB.pf then echo "Starting $DB" proserve $DB_DIR/$DB -pf $SCRIPTS/pf_files/$DB.pf start_apws else echo "$DB.pf file in $SCRIPTS/pf_files does not exist" echo "Database not started" exit 2 fi fi fi done ;; *) . $SCRIPTS/live/read_registry $1 case $? in 2) echo "Database $1 is not in database registry" exit 1 ;; 3) echo "Database $1 is on $HOST not on this host" exit 1 ;; esac if test -s $SCRIPTS/pf_files/$DB.pf then echo "Starting $DB" proserve $DB_DIR/$DB -pf $SCRIPTS/pf_files/$DB.pf start_apws else echo "$DB.pf file in $SCRIPTS/pf_files does not exist" echo "Database not started" exit 2 fi ;; esac