Skip to content

Instantly share code, notes, and snippets.

@jgnagy
Created April 29, 2013 15:51
Show Gist options
  • Save jgnagy/5482519 to your computer and use it in GitHub Desktop.
Save jgnagy/5482519 to your computer and use it in GitHub Desktop.
DB2 stopping, round II
stop() {
echo -n $"Stopping $prog: "
dprofile || failure
db2gcf -s 1>>${DB2LOG} 2>&1
RETVAL=$?
if [ $RETVAL -gt 0 ]; then
echo -n $"${prog} is already stopped"
failure
RETVAL=3
echo ""
else
db2 terminate 1>>${DB2LOG} 2>&1
db2 force applications all 1>>${DB2LOG} 2>&1
db2stop 1>>${DB2LOG} 2>&1 && success
RETVAL=$?
if [ $RETVAL -gt 0 ]; then
db2stop force 1>>${DB2LOG} 2>&1 && success || failure
fi
echo ""
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment