标签:
一,DMV:sys.dm_os_wait_stats
Sql Server 提供DMV:sys.dm_os_wait_stats 用于查看实例级别的wait的统计信息,Returns information about all the waits encountered by threads that executed. 返回的数据是针对每种Wait Type的汇总信息。
清空Sql Server实例所有DB的Wait统计信息
dbcc sqlperf(‘sys.dm_os_wait_stats‘,clear)
2,DMV:sys.dm_os_waiting_tasks
如果要查看每个Task的Wait信息,需要使用 DMV:sys.dm_os_waiting_tasks,比较重要的字段
session_id:Task所在的SessionID,通过SessionID可以和 DMV:sys.dm_exec_requests join起来,查看所执行的SQL语句和查询计划。
wait_duration_ms :Total wait time for this wait type, in milliseconds
wait_type:Name of the wait type.
blocking_session_id:ID of the session that is blocking the request. If this column is NULL, the request is not blocked, or the session information of the blocking session is not available (or cannot be identified).
resource_description:Description of the resource that is being consumed
3,DMV:sys.dm_exec_requests
参考文档
https://msdn.microsoft.com/zh-cn/library/ms179984(v=sql.110).aspx
https://technet.microsoft.com/zh-cn/library/ms188743(v=sql.110).aspx
https://msdn.microsoft.com/ZH-CN/LIBRARY/ms177648
标签:
原文地址:http://www.cnblogs.com/ljhdo/p/4885796.html