>
br****@lsmp.com (Ray) wrote in message news:<f3*************************@posting.google.c om>...
DB2 V7.2
Is it possible to list applications connected to a node by Auth ID?
Is it possible to force applications connected to a node by Auth ID or
am I forced to use App. Handle?
Thanks,
Ray
not directly, on AIX (you didn't mention your OS, it's ALWAYS a good
idea to note the OS and the DB2-version as often answers depens on
that) i'm using the following script:
- the var DB2CMD points to the db2 command
- the user of this script must have the autorithy to force apps
(either as user or via "sudo")
------------------------------------------------------------------------
#!/bin/ksh
#----------------------------------------------------------------------------
# kill all applications of DB for given user
#
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
if [ $# -eq 0 ] ; then
echo " "
echo "*** no arguments given! list only DB-Appls connected to
databases"
$DB2CMD list applications
fi
if [ $# -ne 2 ] ; then
echo "\n usage: `basename $0` DB AuthId \n"
exit 1
fi
DB=$1
USER=`echo $2 | tr "a-z" "A-Z"`
$DB2CMD list applications for db $DB
echo "killing DB-applications: user $USER, db $DB"
export IDS=`$DB2CMD list applications for db $DB | grep -E "^$USER " |
cut -c 25-29`
export IDSK=`echo $IDS | sed -e "s/ /,/g"`
if [[ -z $IDSK ]]
then
echo "No Application to be forced."
else
export FDB="$DB2CMD force applications \("$IDSK"\)"
echo $FDB"\n"
eval $FDB
sleep 3
export IDS=`$DB2CMD list applications for db $DB | grep -E "^$USER"
| cut -c 25-29`
export IDSK=`echo $IDS | sed -e "s/ /,/g"`
if [[ -z $IDSK ]]
then
echo "Applications forced successfully"
else
echo "Applications $IDSK still connected!"
fi
fi
------------------------------------------------------------------------