How to Interpret sp_who Output

cmd Column Contains the Entry “Maintenance Token”

Adaptive Server generates sp_who output by reading values from sysprocesses, which is a “fake” table built by the server. The command listed in the cmd column is from the cmd column of the sysprocesses table.

“Maintenance Token” in the cmd column of sysprocesses indicates that the status value of the process is zero. This means that the process is initializing or in a transient state. A process completing initialization or running recovery may display the command string “Maintenance Token”.

The presence of “Maintenance Token” does not indicate a problem.

loginame Value Changes During Stored Procedure Execution

During recompilation, Adaptive Server sets the user to the owner of the procedure being recompiled in order to resolve the names of referenced objects correctly.

If a user is executing a stored procedure, sp_who shows “sa” under the loginame for the duration of the stored procedure's execution. When execution is complete, sp_who again shows the user name under loginame.

Sleep Classifications

If an Adaptive Server process is asleep, sp_who shows the state of the process in the status column using one of the following classifications:

Table 2-3: Sleep classifications from sp_who output

Classification

Meaning

send sleep

Adaptive Server process is going to sleep until the network service task completes the send to the client.

recv sleep

Adaptive Server process is sleeping until it receives something from the client. This is the most common status.

lock sleep

Adaptive Server process is waiting for locks (resource, logical, semaphore, and so on) to be released.

alarm sleep

Adaptive Server process is waiting for an alarm to wake it up (user executed a waitfor delay command).

sleeping

Adaptive Server process is waiting for a resource to post network or disk I/O.