首页 > 其他 > 详细

XEVENT入门

时间:2016-07-23 15:02:01      阅读:98      评论:0      收藏:0      [点我收藏+]

 

XEVENT:在指定事件发生时记录,可将日志放在内存或文件中,效率比sqlprofile高。
参考:
Introduction to Extended Events
Troubleshooting Error 511 using XEvents

 

相关DMV1
相关DMV2

相关DMV:

Events
-- Event objects
SELECT p.name AS package_name,
       o.name AS event_name,
       o.description
FROM sys.dm_xe_packages AS p
JOIN sys.dm_xe_objects AS o
     ON p.guid = o.package_guid
WHERE (p.capabilities IS NULL OR p.capabilities & 1 = 0)
  AND (o.capabilities IS NULL OR o.capabilities & 1 = 0)
  AND o.object_type = ‘event‘
Actions

-- Actions
SELECT p.name AS package_name,
       o.name AS action_name,
       o.description
FROM sys.dm_xe_packages AS p
JOIN sys.dm_xe_objects AS o
     ON p.guid = o.package_guid
WHERE (p.capabilities IS NULL OR p.capabilities & 1 = 0)
  AND (o.capabilities IS NULL OR o.capabilities & 1 = 0)
  AND o.object_type = ‘action‘
Targets

--Event获取的数据

select * from sys.dm_xe_object_columns
where object_name = ‘lock_acquired‘ and column_type = ‘data‘

-- Targets
SELECT p.name AS package_name,
       o.name AS target_name,
       o.description
FROM sys.dm_xe_packages AS p
JOIN sys.dm_xe_objects AS o ON p.guid = o.package_guid
WHERE (p.capabilities IS NULL OR p.capabilities & 1 = 0)
  AND (o.capabilities IS NULL OR o.capabilities & 1 = 0)
  AND o.object_type = ‘target‘

XEVENT入门

原文:http://www.cnblogs.com/heqianjin/p/5698647.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!