By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,647 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,647 IT Pros & Developers. It's quick & easy.

List or Force Applications by Auth ID

P: n/a
Ray
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
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Ray wrote:
DB2 V7.2
Is it possible to list applications connected to a node by Auth ID? Not from the clp...it would be easy to write an app that did this...you
can check out the database monitor samples to use as a template. Is it possible to force applications connected to a node by Auth ID or
am I forced to use App. Handle?

You can only force by app handle...but again, you could write an app
that pulled out all app handles for a particular id, and force them all
with a single request.
Nov 12 '05 #2

P: n/a
Leo
Try piping the output of the list applications command thru grep.

Ex) db2 list applications at node NODENUM | grep AUTHID

Leo
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

Nov 12 '05 #3

P: n/a
> 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

------------------------------------------------------------------------
Nov 12 '05 #4

P: n/a
In DB2 V8:

SELECT * FROM TABLE(SYSPROC.SNAPSHOT_APPL_INFO(CURRENT SERVER,-1)) as
SNAPSHOT_APPL_INFO WHERE EXECUTION_ID = 'your_user'

To force:
SELECT 'force application (' concat char(agent_id) concat ')' FROM
TABLE(SYSPROC.SNAPSHOT_APPL_INFO(CURRENT SERVER,-1)) as
SNAPSHOT_APPL_INFO WHERE EXECUTION_ID = 'your_user'
Pipe the output to a skript and execute it via DB2 CLP

HTH
Joachim

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

Nov 12 '05 #5

P: n/a
Additional info :

If i'm logged on windows as usera and connect to db2 with userb,
EXECUTION_ID=windows logon/usera
AUTH_ID=db2 connect to ... user /userb

PM

"Joachim Klassen" <Jo*******@email.com> a écrit dans le message de
news:b5**************************@posting.google.c om...
In DB2 V8:

SELECT * FROM TABLE(SYSPROC.SNAPSHOT_APPL_INFO(CURRENT SERVER,-1)) as
SNAPSHOT_APPL_INFO WHERE EXECUTION_ID = 'your_user'

To force:
SELECT 'force application (' concat char(agent_id) concat ')' FROM
TABLE(SYSPROC.SNAPSHOT_APPL_INFO(CURRENT SERVER,-1)) as
SNAPSHOT_APPL_INFO WHERE EXECUTION_ID = 'your_user'
Pipe the output to a skript and execute it via DB2 CLP

HTH
Joachim

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

Nov 12 '05 #6

P: n/a
Ray
I am using V7.2 on Window 2000 Server.
I will try and write a quick and dirty app to do it for me. Thanks.

Ray

Jo*******@email.com (Joachim Klassen) wrote in message news:<b5**************************@posting.google. com>...
In DB2 V8:

SELECT * FROM TABLE(SYSPROC.SNAPSHOT_APPL_INFO(CURRENT SERVER,-1)) as
SNAPSHOT_APPL_INFO WHERE EXECUTION_ID = 'your_user'

To force:
SELECT 'force application (' concat char(agent_id) concat ')' FROM
TABLE(SYSPROC.SNAPSHOT_APPL_INFO(CURRENT SERVER,-1)) as
SNAPSHOT_APPL_INFO WHERE EXECUTION_ID = 'your_user'
Pipe the output to a skript and execute it via DB2 CLP

HTH
Joachim

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

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.