sp_ps

Description

Return detailed status information on specified Open Server threads.

Syntax

sp_ps [loginame | ’spid’]

Parameters

loginame

The user’s login name.

spid

The internal identification number of the thread to report on. You can obtain the spid from the output of a previous sp_who or sp_ps call. By default, all threads are listed.

Examples

Example 1

1>execute utility...sp_ps 
 2>go 
                                                                                                                           
 spid  Login Name Host Name     Program Name  Task Type         ... 
 ----  ---------- ---------     ------------  --------------    ... 
    1                                         SERVER TASK       ... 
    2                                         SERVER TASK       ... 
    3                                         SERVER TASK       ... 
    4                                         SERVICE TASK      ... 
   11             hiram                       SITE HANDLER TASK ... 
   14  bud        sonoma        isql          CHILD TASK        ... 
...   Status     Sleep Event   Sleep Label       Current Command    ...

 ...   -------    -----------   -----------       ---------------    ...
 ...   runnable   369448                          NETWORK HANDLER    ...
 ...   sleeping   369544        MSG AVAILABLE     CONNECT HANDLER    ...
 ...   sleeping   369640        MSG AVAILABLE     DEFERRED HANDLER   ...
 ...   runnable        0                          SCHEDULER          ...
 ...   sleeping   369736        MSG AVAILABLE                        ...
 ...   running    416480                                             ...
  ...  Blocked    Run     Current     Stack      Net       Net 
  ...       By  Ticks    Priority    Origin    Writes    Reads 
  ...  -------  ------   --------   --------   ------   ----- 
  ...        0       0         8     2794336        0       0 
  ...        0       0         8     2810792        0       0 
  ...        0       0         8     2827184        0       0 
  ...        0       0        15     2843576        0       0 
  ...        0       0         8     2859968        2       7 
  ...        0       0         8     2909208        3       0 

This example shows isql output from the sp_ps procedure. For printing purposes, the report was split where indicated by ellipses.

Usage

Table 4-2 summarizes the results returned as rows with these columns:

Table 4-2: Format of information returned (sp_ps)

Column name

Datatype

Length

spid

CS_INT_TYPE

4

Login Name

CS_CHAR_TYPE

SRV_MAXNAME

Host Name

CS_CHAR_TYPE

SRV_MAXNAME

Program Name

CS_CHAR_TYPE

SRV_MAXNAME

Task Type

CS_CHAR_TYPE

SRV_MAXNAME

Status

CS_CHAR_TYPE

SRV_MAXNAME

Sleep Event

CS_INT_TYPE

4

Sleep Label

CS_CHAR_TYPE

SRV_MAXNAME

Current Command

CS_CHAR_TYPE

SRV_MAXNAME

Blocked By

CS_INT_TYPE

4

Run Ticks

CS_INT_TYPE

4

Current Priority

CS_INT_TYPE

4

Stack Origin

CS_INT_TYPE

4

Net Writes

CS_INT_TYPE

4

Net Reads

CS_INT_TYPE

4

See also

sp_terminate, sp_who