kill command 
Author Message
 kill command
Hi. I have been having some problem for killing a connection. My C program using
DB-Library sometimes died(the whole process is terminated), but left a connection
to sybase. It can be seen by sp_who. Using KILL(as sa) is only effective when the
C program is alive. These connection will hang out there until the server is
recycled. I don't know if these dead connections still consume much server resource
 Is there a easy way to get rid of them ? Thanks

Luke Liang    Goldman Sachs & Co.



Tue, 08 Aug 1995 02:36:13 GMT
 kill command

When attending a Sybase Database Administration course, the instructor told the
class that when "kill" does not work there is an alternative that can be used.
The command is "syb_terminate spid" this will most definitely get rid of it. He
instructed CAUTION when using this, if the operation was in the middle of an
update do not use this command. We use this rarely, when all else fails, short of
rebooting the server.

If anyone has further documentation, please post!!

Gale

-----------------------------------------------------------------------

Gale Dillow                               Baylor College of Medicine
Manager, Data Administration              Corporate Systems Center

Telephone: (713) 798-3524                 Houston, Texas 77030
Fax:       (713) 798-5990                 Room: MEDT 611

Standard disclaimers apply.
-----------------------------------------------------------------------



Tue, 08 Aug 1995 05:34:12 GMT
 kill command

Quote:

> Hi. I have been having some problem for killing a connection. My C program using
> DB-Library sometimes died(the whole process is terminated), but left a connection
> to sybase. It can be seen by sp_who. Using KILL(as sa) is only effective when the
> C program is alive. These connection will hang out there until the server is
> recycled. I don't know if these dead connections still consume much server resource
>  Is there a easy way to get rid of them ? Thanks

Yes, these 'hung' processes take up resources.  And if the process hung
while accessing a table (insert, update, select w/ table lock) you could
end up locking out other processes.

As for the 'kill' command . . . it don't always work . . as you've seen.
You could always use the 'syb_terminate spid' command but since that's
an undocumented command you don't know about it . . right! ;-)

Mark



Tue, 08 Aug 1995 06:03:19 GMT
 kill command

Quote:

>> Hi. I have been having some problem for killing a connection. My C program using
>> DB-Library sometimes died(the whole process is terminated), but left a connection
>> to sybase. It can be seen by sp_who. Using KILL(as sa) is only effective when the
>> C program is alive. These connection will hang out there until the server is
>> recycled. I don't know if these dead connections still consume much server resource
>>  Is there a easy way to get rid of them ? Thanks
>Yes, these 'hung' processes take up resources.  And if the process hung
>while accessing a table (insert, update, select w/ table lock) you could
>end up locking out other processes.
>As for the 'kill' command . . . it don't always work . . as you've seen.
>You could always use the 'syb_terminate spid' command but since that's
>an undocumented command you don't know about it . . right! ;-)

Just so everybody here knows, "syb_terminate" is a very dangerous
command to use.  If the hung process has locks on any resources, they
will not be released by syb_terminate.  There will then be no way to
release the locks other than restarting the server -- not fun in the
middle of the day with 100 users on-line.

A much better way to minimize the hung process problem is to decrease
your TCP/IP socket timeout interval.  I won't go into details here,
as it is documented in the Sybase release notes for you platform.
--
--------------------------------------------------------------------

Strong/Corneliuson Capital Mgmt



Wed, 09 Aug 1995 04:15:51 GMT
 kill command
Quote:


>> Hi. I have been having some problem for killing a connection. My C program using
>> DB-Library sometimes died(the whole process is terminated), but left a connection
>> to sybase. It can be seen by sp_who. Using KILL(as sa) is only effective when the
>> C program is alive. These connection will hang out there until the server is
>> recycled. I don't know if these dead connections still consume much server resource
>>  Is there a easy way to get rid of them ? Thanks

>Yes, these 'hung' processes take up resources.  And if the process hung
>while accessing a table (insert, update, select w/ table lock) you could
>end up locking out other processes.

>As for the 'kill' command . . . it don't always work . . as you've seen.
>You could always use the 'syb_terminate spid' command but since that's
>an undocumented command you don't know about it . . right! ;-)

        Please only use this undocumented and unsupported command when you
        really REALLY want to corrupt your database... I have lost track of the
        number of times this command has screwed up our customer's db's, it
        is extremely dangerous and should only be used when you are certain
        that the process you are killing did not go to sleep having
        uncommitted updates outstanding (and I'm not even 100% sure it
        can't{*filter*}the db up anyway...). The ONLY safe way to remove
       {*filter*} server processes is to restart the server. Sybase are well
        aware of the need for a better method, an active "kill" that would
        not risk the db's integrity and are working on it for a future
        version of System 10 (but not likely in 10.0 from what I have
        heard).

Quote:
>Mark

Regards
David S.        Open Vision Systems - Sybase distributor, Australia.


Fri, 11 Aug 1995 08:36:08 GMT
 kill command

Quote:


> >As for the 'kill' command . . . it don't always work . . as you've seen.
> >You could always use the 'syb_terminate spid' command but since that's
> >an undocumented command you don't know about it . . right! ;-)

>    Please only use this undocumented and unsupported command when you
>    really REALLY want to corrupt your database... I have lost track of the

Hmmmmmmm, never had that problem . . . . interesting . . . very interesting . .

But Dave, and someone else who already posted, make a good point.  Maybe
I shouldn't have put out the info about syb_terminate? But any of you
working with Sybase should know now that if you run across an 'undocumented'
command that you should take it with a grain of salt.  They're all
undocumented for a reason.  And if you don't know the complete background
for using said functions you may be causing yourself more harm than
good.

With the syb_terminate command, we use it only when nothing else will
do, i.e., processes are blocked by the hung process, 'kill' doesn't
work, and we don't want to reboot the server, thereby kicking 20 other
users off the system.  Again, we've never had a problem with corrupt
databases after using syb_terminate . . . we've ended up with corrupt
databases for other reasons . . . but not for syb_terminate . . YMMV.

Mark



Fri, 11 Aug 1995 23:50:29 GMT
 kill command
|>
|> When attending a Sybase Database Administration course, the instructor told the
|> class that when "kill" does not work there is an alternative that can be used.
|> The command is "syb_terminate spid" this will most definitely get rid of it.
[...]

DO NOT USE SYB_TERMNINATE!!  it is NOT SUPPORTED and can EASILY mess up your
database BIG TIME.  i have personally messed up the locks on sybase's
production sql server a few times, using this command when i was dba years ago.

i will be contacting education to get that instructor "educated" if what you
say is true.  this command was a MISTAKE, and should NOT be used.
the alternative to KILL is SHUTDOWN and reboot.  period.

system 10 will have a better-functioning KILL-like command for terminating
processes.

--
....ben
------                          all words are those of the author, not Sybase.

                       {pyramid,pacbell,sun,lll-tis}!sybase!Benjamin.von.Ullrich



Sun, 13 Aug 1995 02:31:58 GMT
 
 [ 7 post ] 

 Relevant Pages 

1. kill command

2. kill command

3. SQL 6.5 Kill Command does not work

4. Generic use of Kill - command.

5. KILL command question?

6. Kill command

7. Process Admin Server Role Can't use Kill command

8. KILL - Command

9. Error6115(KILL command cannot be used inside user transactions) in Mssql2000

10. Variable insertion w/KILL command

11. Use of Kill command

12. TSQL Kill command in a stored proc


 
Powered by phpBB® Forum Software