Welcome 微信登录

首页 / 数据库 / MySQL / 使用sp_monitor 查看SQL Server统计信息

SQL Server提供了sp_monitor存储过程可以方便我们查看SQL Server性能统计信息,包括CPU/Network/IO,通过这些信息可以对自己的数据库性能状况有一个大致的了解。下面的示例报告有关 SQL Server 繁忙程度的信息:  每个列名的解释: 
列名说明
last_run上次运行 sp_monitor 的时间。
current_run本次运行 sp_monitor 的时间。
sp_monitor 自运行以来所经过的秒数。
cpu_busy服务器计算机的 CPU 处理 SQL Server 工作所用的秒数。
io_busySQL Server 在输入和输出操作上花费的秒数。
空闲SQL Server 已空闲的秒数。
packets_receivedSQL Server 读取的输入数据包数。
packets_sentSQL Server 已写入的输出数据包数。
packet_errorsSQL Server 在读取和写入数据包时遇到的错误数。
total_readSQL Server 读取的次数。
total_writeSQL Server 写入的次数。
total_errorsSQL Server 在读取和写入时遇到的错误数。
connections登录或尝试登录 SQL Server 的次数。
对于每一列,统计信息将以 numbernumber)-number% 或 numbernumber) 的格式输出。第一个number 是指重新启动 SQL Server 以来的秒数(对于cpu_busyio_busyidle)或总数目(对于其他变量)。圆括号中的number 是指上次运行 sp_monitor 以来的秒数或总数目。百分比是自上次运行sp_monitor 以来的时间百分比。例如,如果报告中cpu_busy 显示为 4250(215)-68%,则自 SQL Server 上次启动以来,CPU 工作了 4250 秒;自上次运行sp_monitor 以来,CPU 工作了 215 秒;自上次运行sp_monitor 以来占总时间的 68%。如果需要保存数据的话可以使用下面的系统统计函数:Table 1 System Statistical Functions 

Function

Description
@@CONNECTIONSThe number of connections or attempted connections.
@@CPU_BUSYTimer ticks that the CPU has been working for SQL Server.
@@IDLETime in timer ticks that SQL Server has been idle.
@@IO_BUSYTimer ticks that SQL Server has spent performing I/O operations.
@@PACKET_ERRORSNumber of network packet errors that have occurred.
@@PACK_RECEIVEDNumber of packets read from the network.
@@PACK_SENTNumber of packets written to the network.
@@TIMETICKSNumber of millionths of a second in a timer tick.
@@TOTAL_ERRORSNumber of read/write errors during I/O operations.
@@TOTAL_READNumber of disk reads.
@@TOTAL_WRITENumber of disk writes.
将SQL Server数据库备份到多个文件提高备份效率SQL Server System Session ID是不是1-50?相关资讯      SQL Server  SQL Server教程 
  • Build2016喜讯:Linux用户注册微软  (03月17日)
  • SQL Server on Linux 理由浅析  (03月09日)
  • 管理SQL Server服务的登录(启动)  (02月13日)
  • 微软要抢甲骨文用户?从Oracle迁移  (03月13日)
  • 微软发布面向Linux的SQL Server预  (03月08日)
  • SQL Server如何修改自增列值以及相  (01月23日)
本文评论 查看全部评论 (0)
表情: 姓名: 字数