Re: killing sqlturbo
Posted in 1997
The following script was used at my last job, mainly for any user that had inadvertently started a search (read: sequential scan) of ALL rows in a large table, with extensive joins, when the user really *intended* to just retrieve a few rows. *WARNING*: This script will *NOT* work asis w/ ODS 7.xx ========================================== # Program : killuser # Created : 05/15/1995 by Paul A. Mosser # : (based on 'kill_ipid.sh' script by Bob Baskett) # Purpose : Program to kill the transaction associated with # : a specified user's Informix On-Line sqlturbo process. # Changed : if [ "$#" -lt 1 ] then echo " " echo "USAGE: $0 <user-id>" echo " " echo " example: $0 bclinton" echo " " exit 1 fi for uline in `ps -ef | grep '.4ge' | grep $1 | \\ awk '{print $1"~"$2"~"$3"~" }'` do upid=`echo $uline | cut -d~ -f2` ipid=`ps -ef | grep sqlturbo | grep $1 | grep $upid | \\ awk '{print $1"~"$2"~"$3"~" }' | cut -d~ -f2` echo "\\nKilling user process $ipid:" for line in `tbstat -u | awk /Users/,/active/ | grep $ipid | \\ awk '{print $1"~"$2"~"$3"~" }'` do user_address=`echo $line | cut -d~ -f1` for trans in `tbstat -u | awk /Transactions/,/active/ | \\ grep $user_address | awk '{print $1"~"$2"~"$3"~" }'` do trans_address=`echo $trans | cut -d~ -f1` echo "Terminating transaction...\\c" tbmode -Z $trans_address echo "done" sleep 2 echo "Terminating process.......\\c" tbmode -z $ipid echo "done" done done done ========================================== HTH -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Paul Mosser pmosser@primenet.com Michal Hajek <hajek@nspuh.cz> wrote in article <341E1910.616A@nspuh.cz>... > And you have to rememeber: you may find that the process is not in > critical section NOW (tbstat -s), but it CAN BE in a few second later, > when > trying to kill it. > Since time we have been using Informix-Star (application server on one > machine > and database server on other one), I sometimes use tbmode -z and kill -1 > (one), > and process (sqlturbo) dies without problems. (I never try kill -9 on > sqlexec > on application server - I do not know what it can do.) > > It happened to me to make OnLine to abort with kill -9 on sqlturbo. > OnLine > then went up without problems - but we were said it was good luck. > > Michal Hajek > > Art S. Kagel wrote: > > > > Nigel Gall wrote: > > > > > > At 05:53 PM 9/12/97 EDT, you wrote: > > > > > > > > > > > >Is there a way to kill a runaway sqlturbo process without bringing the > > > >Informix engine down? Some of our programmers have had bad > > > >experiences with this in the past. > > -- > -------------------------------------------------------------- > Michal Hajek mailto:hajek@nspuh.cz > Sprava NIS http://www.nspuh.cz > NsP Uherske Hradiste phone : voice +420 0632 529 204 > Purkynova 365 fax +420 0632 551 014 > 686 68 Uherske Hradiste Czech Republic > -------------------------------------------------------------- >