Unix Technical Forum

List or Force Applications by Auth ID

This is a discussion on List or Force Applications by Auth ID within the DB2 forums, part of the Database Server Software category; --> DB2 V7.2 Is it possible to list applications connected to a node by Auth ID? Is it possible to ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 04:20 PM
Ray
 
Posts: n/a
Default List or Force Applications by Auth ID

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 04:21 PM
Sean McKeough
 
Posts: n/a
Default Re: List or Force Applications by Auth ID

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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 04:21 PM
Leo
 
Posts: n/a
Default Re: List or Force Applications by Auth ID

Try piping the output of the list applications command thru grep.

Ex) db2 list applications at node NODENUM | grep AUTHID

Leo


briggs@lsmp.com (Ray) wrote in message news:<f3c3a1a3.0312080755.bf50bf6@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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 04:21 PM
Joerg Ammann
 
Posts: n/a
Default Re: List or Force Applications by Auth ID

> briggs@lsmp.com (Ray) wrote in message news:<f3c3a1a3.0312080755.bf50bf6@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

------------------------------------------------------------------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-26-2008, 04:22 PM
Joachim Klassen
 
Posts: n/a
Default Re: List or Force Applications by Auth ID

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

briggs@lsmp.com (Ray) wrote in message news:<f3c3a1a3.0312080755.bf50bf6@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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-26-2008, 04:23 PM
PM \(pm3iinc-nospam\)
 
Posts: n/a
Default Re: List or Force Applications by Auth ID

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" <JoKlassen@email.com> a écrit dans le message de
news:b5788ff3.0312092338.42a075ea@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
>
> briggs@lsmp.com (Ray) wrote in message

news:<f3c3a1a3.0312080755.bf50bf6@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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-26-2008, 04:23 PM
Ray
 
Posts: n/a
Default Re: List or Force Applications by Auth ID

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

JoKlassen@email.com (Joachim Klassen) wrote in message news:<b5788ff3.0312092338.42a075ea@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
>
> briggs@lsmp.com (Ray) wrote in message news:<f3c3a1a3.0312080755.bf50bf6@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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:57 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com