Art S. Kagel wrote:
>
> 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
No need to shout:-) But Art is right - it is very much the case of buyer
beware.
--
Paul Watson #
WF Software Ltd # I don't suffer from
Tel +44 1436 674729 # stress I'm a carrier
Fax +44 1436 678693 #