码迷,mamicode.com
首页 > 其他好文 > 详细

查看Wait信息

时间:2015-10-16 18:37:46      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:

一,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_typeName of the wait type.

blocking_session_idID 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_descriptionDescription 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

查看Wait信息

标签:

原文地址:http://www.cnblogs.com/ljhdo/p/4885796.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!