WF Software wrote:
>
> In article <6pb6bg$fab$1@news.xmission.com>, sanjeevsagar@rocketmail.com
> (sanjeev sagar) wrote:
> > I am in need of one kill query which should do the
> > following
> > KILL ALL SELECT QUERY CONNECTED TO A SPECIFIC
> > DATABASE OF A SPECIFIC INSTANCE.
> > i made one script which take instance and database
> > name as a input positional parameter. The query which
> > i ran inside the script is
> > "select username, sqx_sessionid, sqx_conbno,
> > sqx_sqlstatement,
> > sysdatabases.name database
> > from syssqexplain , sysscblst, sysdatabases
> > where sqx_sessionid=sid
> > and sysdatabases.name='${DATABASENAME}'
> > order by 2, 3"
[SNIP]
> you could try something a long the lines of
> for sesid in `onstat -g sql | egrep 'SELECT.*${DATABASE}' | awk
> '{print$1}'`
> do
> onmode -z $sesid> done
VERY IMPORTANT!!! If you have a very busy system either of these
methods may themselves NEVER complete! Because of the dynamic nature
of the syssqexplain table either the explicit query or the equivalent
query which the onstat -g sql executes will chase the end of the
constantly growing table until the server is shutdown. You will not
even be able to kill the session with onmode -z!
Art S. Kagel