Consultor Eletrônico



Kbase P89527: How to ensure the DB will be shutdown
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

How to ensure the DB will be shutdown

GOAL:

Script avoiding a hanging proshut

GOAL:

Sample script using proshut -F to workaround proshut hang

FIX:

#!/bin/sh
# SHUTDB
# A sample UNIX script to shutdown a database.
# Usage: shutdb dbname

# Make sure syntax is correct
: ${1?"Usage: $0 dbname"}

dbname=$1

# Create the logging file
echo "Shut $dbname at `date`" > shut.log

# start the proshut in the background
# be sure to put the & at the end of the proshut command
proshut $dbname -by >> shut.log 2>&1 &

# wait 15 Minutes or 900 seconds
sleep 900

# if the .lk is removed, shutdown complete
if [ ! -f $dbname.lk ]
then
echo Database shut `date` >> shut.log
exit
fi

# if we got this far, perform force shutdown
proshut $dbname -by -F >> shut.log

echo Emergency shut 'date' >> shut.log