SQL Server provides sp_monitor stored procedures can help us to see performance statistics for SQL Server, including CPU / Network / IO, this information may have their own database performance status of a general understanding.
The following example reports information about how busy SQL Server:
Each column name explanation:
Column Name | Explanation |
---|---|
last_run |
Sp_monitor time last run. |
current_run |
Sp_monitor time of this run. |
second |
The number of seconds elapsed since sp_monitor self-running. |
cpu_busy |
The number of seconds of CPU processing server computer work with SQL Server. |
io_busy |
SQL Server is the number of seconds spent on the input and output operations. |
idle |
SQL Server has been idle for the number of seconds. |
packets_received |
SQL Server reads the input data of the number of packets. |
packets_sent |
SQL Server has been written to the output data of the number of packets. |
packet_errors |
Number of errors encountered by SQL Server while reading and writing packets. |
total_read |
The number of SQL Server read. |
total_write |
The number of SQL Server written. |
total_errors |
Number of errors encountered by SQL Server while reading and writing. |
connections |
Login or attempts to log SQL Server. |
For each column, the statistics will Number ( Number -) Number % or Number ( Number format output). The first number is the number of seconds since the restart of SQL Server (for cpu_busy, io_busy and idle) or the total number (for other variables). Parenthesis number refers to the total number or the number of seconds since the last run sp_monitor. The percentage is the percentage of time since the last run of sp_monitor. For example, if the report is displayed as cpu_busy 4250 (215) 68%, since the last time SQL Server starts, CPU worked for 4250 seconds; since the last run sp_monitor, CPU worked for 215 seconds; since the last run sp_monitor 68% of the total time.
If you need to save the data, then you can use the following system statistical functions:
Table 1 System Statistical Functions
Function |
Description |
@@CONNECTIONS | The number of connections or attempted connections. |
@@CPU_BUSY | Timer ticks that the CPU has been working for SQL Server. |
@@IDLE | Time in timer ticks that SQL Server has been idle. |
@@IO_BUSY | Timer ticks that SQL Server has spent performing I/O operations. |
@@PACKET_ERRORS | Number of network packet errors that have occurred. |
@@PACK_RECEIVED | Number of packets read from the network. |
@@PACK_SENT | Number of packets written to the network. |
@@ TIMETICKS | Number of millionths of a second in a timer tick. |
@@TOTAL_ERRORS | Number of read/write errors during I/O operations. |
@@TOTAL_READ | Number of disk reads. |
@@TOTAL_WRITE | Number of disk writes. |