Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    35

    Unanswered: killing spids with AWAITING COMMAND status

    I know its:

    kill <spid>

    where spid is the one shown in sysprocesses

    but i would like to know if a certain spid has an AWAITING COMMAND status for a long time before i kill it. Like is there a column in a system table that tells you the last time a spid did something.

    lets say if the spid has been in that status (AWAITING COMMAND) for 30 minutes, you'd kill it to free up some memory right? or to allow more connections right?

    is there a way?

    i'm thinking of putting triggers on the sysprocesses but its kinda destructive isn't it?

    Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    Quote Originally Posted by Jonga
    I know its:

    kill <spid>

    where spid is the one shown in sysprocesses

    but i would like to know if a certain spid has an AWAITING COMMAND status for a long time before i kill it. Like is there a column in a system table that tells you the last time a spid did something.

    lets say if the spid has been in that status (AWAITING COMMAND) for 30 minutes, you'd kill it to free up some memory right? or to allow more connections right?

    is there a way?

    i'm thinking of putting triggers on the sysprocesses but its kinda destructive isn't it?

    Thanks!
    The 'cmd'-column in the sysprocessestable containes the commend that is being executed, or AWAITING COMMAND, if it is idle.
    A trigger on a systemtable isn't wise, in my opinion.

    In some applications you can specify the time-out in which connections are dropped when not used.
    As far as I know, the idle-time is not recorded in ASE, only the time the login logged in on ASE.
    I'm not crazy, I'm an aeroplane!

  3. #3
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    You can't put triggers on system tables.

    David Wein of Sybase has written a stored proc that reaps idle SPIDs and which uses data in the MDA tables (so requires 12.5.0.3 or later). I believe the code is available on CodeXchange, and I think there is a reference to it on Rob Vershoor's site (www.sypron.nl/mda.html)

    Michael

  4. #4
    Join Date
    May 2004
    Posts
    35
    wow thanks!

    i'll test it right away!

    nice link


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •