Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

Query to determine XE Session status

$
0
0
Query to determine XE Session status epivaral Posted on 3 October 2018 Comments

On a previous post , we discussed what is an extended event (XE) and how to create one.

With the following T-SQL you can quickly check what are the currently running Extended Events sessions:

SELECT ES.name, iif(RS.name IS NULL, 0, 1) AS running FROM sys.dm_xe_sessions RS RIGHT JOIN sys.server_event_sessions ES ON RS.name = ES.name --WHERE es.name = '<YOUR XE SESSION NAME>'

The column running will show 0 if the session is currently stopped and 1 if it is currently running.

In the commented WHERE clause, you can filter for a specific session.

Hope this helps you to monitor your XE sessions!


Query to determine XE Session status
SQL Guatemala

SQL Server Database Administrator/Developer with experience in large environments. I have worked on IT for nearly 15 years in different areas. Microsoft Certified Solutions Associate: SQL 2016 Database Administration since 2018. Microsoft Certified Solutions Associate: SQL Server 2012/2014 since 2017. Microsoft Certified Professional since 2014.


Viewing all articles
Browse latest Browse all 3160

Trending Articles