If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > How do you find a runaway stored procedure?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-15-07, 21:54
ftmjr ftmjr is offline
Registered User
 
Join Date: Mar 2007
Posts: 167
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?
Reply With Quote
  #2 (permalink)  
Old 04-08-08, 04:36
ftmjr ftmjr is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 04-08-08, 11:36
mpeppler mpeppler is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 04-09-08, 00:56
ftmjr ftmjr is offline
Registered User
 
Join Date: Mar 2007
Posts: 167
Thank you... :)

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On