Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Posts
    167

    Unanswered: How do you find a runaway stored procedure?

    I was asked by our development team... "How do we check for runaway stored procedures?".

    the only thing I can think of is run the following query.

    - select * from syslogs hold

    Is there any other way in Sybase to check if there are procedures that are "runaway" stored procedures?

  2. #2
    Join Date
    Mar 2007
    Posts
    167

    How do you check to see if a stored procedure is not frozen/hung and is processing.

    Is the best way to see if a stored procedure has frozen / hung is by using sysprocesses?

    For example,

    select spid, status, suid, cmd, cpu, physical_io, dbid, loggedindatetime from sysprocesses


    What do you think? Thank you.

  3. #3
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    First, find all the rows in sysprocesses where the status is not "sleeping" or "recv sleep" - this will find all the spids that are currently active (i.e. not waiting for user requests). You can then refine the search from there, for example using the cpu and physical_io columns, as well as the blocked column to find "interesting" processes.

    Michael

  4. #4
    Join Date
    Mar 2007
    Posts
    167

    Thank you... :)

    Thank you for your feedback and advice. I will use the method you recommended.

Posting Permissions

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