Displays statistics about Adaptive Server.
sp_monitor
Reports information about how busy Adaptive Server has been:
sp_monitor
last_run current_run seconds ------------------- ------------------- --------- Jan 29 1987 10:11AM Jan 29 1987 10:17AM 314 cpu_busy io_busy idle --------------- --------- -------------- 4250(215)-68% 67(1)-0% 109(100)-31% packets_received packets_sent packet_errors ---------------- ------------ ------------ 781(15) 10110(9596) 0(0) total_read total_write total_errors connections ----------- ------------------------- ----------- 394(67) 5392(53) 0(0) 15(1)
Adaptive Server keeps track of how much work it has done in a series of global variables. sp_monitor displays the current values of these global variables and how much they have changed since the last time the procedure executed.
For each column, the statistic appears in the form number(number)-number% or number(number).
The first number refers to the number of seconds (for cpu_busy, io_busy, and idle) or the total number (for the other columns) since Adaptive Server restarted.
The number in parentheses refers to the number of seconds or the total number since the last time sp_monitor was run. The percent sign indicates the percentage of time since sp_monitor was last run.
For example, if the report shows cpu_busy as “4250(215)-68%”, it means that the CPU has been busy for 4250 seconds since Adaptive Server was last started, 215 seconds since sp_monitor last ran, and 68 percent of the total time since sp_monitor was last run.
For the total_read column, the value 394(67) means there have been 394 disk reads since Adaptive Server was last started, 67 of them since the last time sp_monitor was run.
Table 1-16 describes the columns in the sp_monitor report, the equivalent global variables, if any, and their meanings. With the exception of last_run, current_run and seconds, these column headings are also the names of global variables—except that all global variables are preceded by @@. There is also a difference in the units of the numbers reported by the global variables—the numbers reported by the global variables are not milliseconds of CPU time, but machine ticks.
Column heading |
Equivalent variable |
Meaning |
---|---|---|
last_run |
Clock time at which the sp_monitor procedure last ran. |
|
current_run |
Current clock time. |
|
seconds |
Number of seconds since sp_monitor last ran. |
|
cpu_busy |
@@cpu_busy |
Number of seconds in CPU time that Adaptive Server’s CPU was doing Adaptive Server work. |
io_busy |
@@io_busy |
Number of seconds in CPU time that Adaptive Server has spent doing input and output operations. |
idle |
@@idle |
Number of seconds in CPU time that Adaptive Server has been idle. |
packets_received |
@@pack_received |
Number of input packets read by Adaptive Server. |
packets_sent |
@@pack_sent |
Number of output packets written by Adaptive Server. |
packet_errors |
@@packet_errors |
Number of errors detected by Adaptive Server while reading and writing packets. |
total_read |
@@total_read |
Number of disk reads by Adaptive Server. |
total_write |
@@total_write |
Number of disk writes by Adaptive Server. |
total_errors |
@@total_errors |
Number of errors detected by Adaptive Server while reading and writing. |
connections |
@@connections |
Number of logins or attempted logins to Adaptive Server. |
The first time sp_monitor runs after Adaptive Server start-up, the number in parentheses is meaningless.
Adaptive Server’s housekeeper task uses the server’s idle cycles to write changed pages from cache to disk. This process affects the values of the cpu_busy, io_busy, and idle columns reported by sp_monitor. To disable the housekeeper task and eliminate these effects, set the housekeeper free write percent configuration parameter to 0:
sp_configure "housekeeper free write percent", 0
Only a System Administrator can execute sp_monitor.
System procedures sp_who