Basics Archives - SQL XEvents https://sqlxevents.com/category/xevents/basics/ Wed, 20 May 2020 21:45:37 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.3 https://sqlxevents.com/wp-content/uploads/2019/07/fav.png Basics Archives - SQL XEvents https://sqlxevents.com/category/xevents/basics/ 32 32 176530083 Extended Events Categories: An Introduction https://sqlxevents.com/extended-events-categories-an-introduction/?utm_source=rss&utm_medium=rss&utm_campaign=extended-events-categories-an-introduction https://sqlxevents.com/extended-events-categories-an-introduction/#respond Fri, 22 May 2020 12:42:00 +0000 https://sqlxevents.com/?p=719 Packages come with a pair of descriptors (or classifiers) that will be useful in correlating related events contained within a given package.

The post Extended Events Categories: An Introduction appeared first on SQL XEvents.

]]>
Previously, I gave a brief explanation of the concept of “Packages” as it relates to Extended Events (XEvents). In that article, I taught you some basic concepts about packages. However, I did not go deep into some of the granular details such as Extended Events categories.

Packages come with a pair of descriptors (or Extended Events categories). Importantly, you use descriptors to find related events in the package. Therefore, you will find using these descriptors helpful in creating an XEvent session to troubleshoot your specific issue.

XEvents packages have two basic types of categories. In other words, these classifiers are called keywords and channels.

XEvent Channels

An XEvents channel is defined just the same as a radio station or TV channel. Similarly, the XEvents channel indicates a stream of interest. In addition, it identifies the target audience for the event.

Term Definition
Admin These events are targeted to administrators and support. Firstly, these events indicate a problem with a solution that an administrator can act on. In addition, these events include a message indicating how to resolve the problem.
Operational Events that are used for analyzing and diagnosing a problem. For instance, one may use these to trigger tasks based on the occurrence. As a result, these events are for Administrators.
Analytic Use these in performance investigations. However, take note that these are a high volume type of events. Consequently, these events are ideal for anybody working on performance issues.
Debug Debug events are used solely by developers to diagnose a problem for debugging. As a result, you will use these primarily when working with CSS.

Different issues require different channels. As a result, your interest in a Channel will change day by day.

The post Extended Events Categories: An Introduction appeared first on SQL XEvents.

]]>
https://sqlxevents.com/extended-events-categories-an-introduction/feed/ 0 719
Extended Events Objects: an Introduction https://sqlxevents.com/extended-events-objects-an-introduction/?utm_source=rss&utm_medium=rss&utm_campaign=extended-events-objects-an-introduction https://sqlxevents.com/extended-events-objects-an-introduction/#respond Wed, 20 May 2020 13:00:01 +0000 https://sqlxevents.com/?p=705 In this article, I start diving into this metadata deeper as we progress through the core concepts surrounding XEvents, at the base of which is objects.

The post Extended Events Objects: an Introduction appeared first on SQL XEvents.

]]>
So far, I have talked about some of the metadata associated with Extended Events (XEvents). I have even introduced you to the concept of packages, but I have not yet started to dive into the individual components of that metadata, specifically the Extended Events objects.

In this article, I will start diving into some of this metadata a little deeper as we progress through some of the core concepts surrounding Extended Events. At the base of these core concepts is the data that relates to objects. This is not your ordinary objects like we see in a database such as tables, views, procs and so forth. These are the types of objects that are specific to XEvents.

XEvents Objects

In Extended Events, all of the objects that help to build an extended event session are exposed through the Dynamic Management View (DMV) sys.dm_xe_objects. That should not be too much of a surprise after reading my introduction on the topic – here.

Querying that DMV, one will see there are numerous objects. With each release of SQL Server, this list grows larger and larger. With all of these objects, where does one really begin? Well, a good place to start is to figure out the types of objects that are available to use.

The post Extended Events Objects: an Introduction appeared first on SQL XEvents.

]]>
https://sqlxevents.com/extended-events-objects-an-introduction/feed/ 0 705
Learn about Packages in Extended Events https://sqlxevents.com/learn-about-packages-in-extended-events/?utm_source=rss&utm_medium=rss&utm_campaign=learn-about-packages-in-extended-events https://sqlxevents.com/learn-about-packages-in-extended-events/#respond Tue, 28 Apr 2020 13:00:00 +0000 https://sqlxevents.com/?p=481 The first core building block to the data that builds Extended Events is the concept around packages. This article helps to explore what a package is.

The post Learn about Packages in Extended Events appeared first on SQL XEvents.

]]>
In this article, I am going to begin the exploration into the essential components of Extended Events (XEvents). When you learn about XEvents, you will discover the first critical component is a concept called “Packages”. As I share these critical components, or XEvents basics, I will present them as learning blocks. Each component will hopefully build upon previous components / blocks to help gain a deeper understanding of XEvents and how the XEvents feature works. Let’s dive in now and learn about packages in Extended Events and what their role entails.

Let’s Learn

xevent package

The first core building block to the data that builds Extended Events is the concept around packages.

When I think of package, I like to think of a container that gives me access to one or more smaller items. Take the concept of a package and consider an alternate name for it. Personally, I think of the word parcel and that I need to have it shipped, or that I am expecting to receive one from any of the popular couriers. Only this is obviously something electronic and could potentially contain much much more than any traditional parcel would contain.

Microsoft exposes the packages that contain all of the components of extended events via the DMV sys.dm_xe_packages. Combine this DMV with another DMV not specific to Extended Events and we can see which DLL on the file-system exposes that particular package and grants us access to various components of Extended events. That second DMV is sys.dm_os_loaded_modules.

Packages in XEvents

Knowing the source of the Extended Event object is useful in some cases. Being able to pull out the pertinent information isn’t terribly difficult either. I can run a query like the following and get just about everything I might want to know about the package (well maybe not if I want to know the memory address as well, but that is an easy fix).

SELECT xp.name AS PackageName
		,xp.description AS PackageDesc
		,xp.capabilities_desc
		,REVERSE(LEFT(REVERSE(olm.name),CHARINDEX('\',REVERSE(olm.name))-1)) AS DLLName
		,olm.file_version
		,xp.module_guid
	FROM sys.dm_xe_packages xp
		INNER JOIN sys.dm_os_loaded_modules olm
			ON xp.module_address = olm.base_address;

Running that on a SQL Server 2014 instance, I will see results like this:

packages_xe

When you look at my results, will see that there is one that is highlighted – package0. This package is basically like the utility drawer – it contains most of everything that you will need to (or maybe want to) use with extended events. At least that is the definition of the package. A package contains all of the data maps, data types, operators, actions, and targets.

There is another very interesting package that is visible with this particular query. That is the SecAudit package. When you look further into the SecAudit package, you will find that it is used by SQL Audits. You cannot use SecAudit package directly, since the contents of the package are accessed automatically by the SQL Audit feature. That is a topic for a different discussion.

When I execute the above query against a SQL Server 2017 instance, I am greeted with a slightly different result set. Take a look at the following image and take note of the sections blocked out in red.

XEvents Packages in SQL Server 2017

Each of these new packages represents a new realm of functionality to be supported by the Extended Events feature. This is wonderful news demonstrating that the feature is definitely evolving and improving.

Wrapping it up

The goal of this article has been to help demonstrate the basic concept of “packages” in Extended Events. I have defined the concept as well as provided samples of how to explore this core concept.

This article has been an updated rewrite of the version that originally appeared on my blog – here.

The post Learn about Packages in Extended Events appeared first on SQL XEvents.

]]>
https://sqlxevents.com/learn-about-packages-in-extended-events/feed/ 0 481