顯示關(guān)于 Microsoft® SQL Server™ 的統(tǒng)計(jì)。
sp_monitor
0(成功)或 1(失?。?/P>
列名 | 描述 |
---|---|
last_run | 上次運(yùn)行 sp_monitor 的時(shí)間。 |
current_run | 本次運(yùn)行 sp_monitor 的時(shí)間。 |
seconds | sp_monitor 自運(yùn)行以來(lái)所經(jīng)過(guò)的時(shí)間(按秒計(jì))。 |
cpu_busy | 服務(wù)器計(jì)算機(jī)的 CPU 處理 SQL Server 工作所用的時(shí)間(按秒計(jì))。 |
io_busy | SQL Server 在輸入和輸出操作上花費(fèi)的時(shí)間(按秒計(jì))。 |
idle | SQL Server 已空閑的時(shí)間(按秒計(jì))。 |
packets_received | SQL Server 讀取的輸入數(shù)據(jù)包數(shù)。 |
packets_sent | SQL Server 寫入的輸出數(shù)據(jù)包數(shù)。 |
packet_errors | SQL Server 在讀取和寫入數(shù)據(jù)包時(shí)遇到的錯(cuò)誤數(shù)。 |
total_read | SQL Server 讀取的次數(shù)。 |
total_write | SQL Server 寫入的次數(shù)。 |
total_errors | SQL Server 在讀取和寫入時(shí)遇到的錯(cuò)誤數(shù)。 |
connections | 登錄或嘗試登錄 SQL Server 的次數(shù)。 |
SQL Server 通過(guò)一系列函數(shù)跟蹤其完成的工作量。執(zhí)行 sp_monitor 會(huì)顯示這些函數(shù)返回的當(dāng)前值,并顯示自上次運(yùn)行該過(guò)程以來(lái)有多大改變。
對(duì)于每一列,統(tǒng)計(jì)將以 number(number)-number% 或 number(number) 的格式輸出。第一個(gè)數(shù)字是指重新啟動(dòng) SQL Server 以來(lái)的秒數(shù)(對(duì)于 cpu_busy、io_busy 和 idle)或總數(shù)目(對(duì)于其它變量)。圓括號(hào)中的數(shù)字是指上次運(yùn)行 sp_monitor 以來(lái)的秒數(shù)或總數(shù)目。百分比是自上次運(yùn)行 sp_monitor 以來(lái)的時(shí)間百分比。例如,如果報(bào)告中 cpu_busy 顯示為 4250(215)-68%,則自 SQL Server 上次啟動(dòng)以來(lái),CPU 工作了 4250 秒;自上次運(yùn)行 sp_monitor 以來(lái),CPU 工作了 215 秒;自上次運(yùn)行 sp_monitor 以來(lái)占總時(shí)間的 68%。
執(zhí)行權(quán)限默認(rèn)賦予 sysadmin 固定服務(wù)器角色的成員。
下面的示例報(bào)告有關(guān) SQL Server 繁忙程度的信息。
USE master
EXEC sp_monitor
下面是結(jié)果集:
last_run | current_run | Seconds |
------------------ | -------------------- | ------------- |
Mar 29 1998 11:55AM | Apr 4 1993 2:22 PM | 561 |
cpu_busy | io_busy | idle |
----------------- | --------------- | ------------- |
190(0)-0% | 187(0)-0% | 148(556)-99% |
packets_received | packets_sent | packet_errors |
----------------- | ----------------- | ------------- |
16(1) | 20(2) | 0(0) |
total_read | total_write | total_errors | connections |
----------------- | ----------------- | ------------- | ------------ |
141(0) | 54920(127) | 0(0) | 4(0) |