Databases Reference
In-Depth Information
Sadly, the SQL Server Management Studio interface for Extended Events appears only when you
connect to an instance of SQL Server 2012. Although Extended Events existed in SQL Server 2008,
you need to use one of the graphical tools created by SQL Server community members in order to
connect to SQL Server 2008 instances and manage the Extended Events sessions, or use the T-SQL
commands.
Events
An event, like its name suggests, is something that happens within SQL Server that you're interested
in i nding out more about. Events are dei ned by specii c points in the SQL Server source code; and
whenever a running task reaches one, a check is performed to determine whether the Extended
Events engine currently has a session watching for that event to happen. If so, then the task is sus-
pended while the Extended Events engine performs the session's actions, something you'll learn
more about in a moment.
Checking for an event and then executing the session's actions happen synchronously, meaning the
user's running task is halted until the actions are completed. Fortunately, the processes that perform
these steps are very fast and efi cient, which is why Extended Events is often described as being
lightweight. Therefore, despite being synchronous, the overhead of this feature is very small; and
regular usage even on production systems is not normally associated with lower performance.
NOTE Actions are covered in more depth in a few paragraphs, but for now
assume that the coni gured action in the example is to get the text of the SQL
Server statement that caused the event to occur.
Because the events we can monitor are written into the SQL Server source code, it's not possible
for us as end users to add our own, although Microsoft contends that it can ship custom events if
needed. For example, Microsoft support engineers have said they can ship Extended Events modules
to an end user for monitoring very specii c errors. Despite that being a well-publicized option, these
extra modules are certainly not downloadable; nor are we aware of anyone actually using them.
To store the event dei nitions and their internal code, the Extended Events engine uses its own stor-
age containers, called packages . Several of these packages ship with SQL Server 2012, far more than
were included with SQL Server 2008, and Microsoft can ship others as just mentioned. If you want
to know what packages are available, you can query the names from one of the many DMVs that
Extended Events provides. The following query is one example:
select name, description from sys.dm_xe_packages
On the RTM release of SQL Server 2012, the preceding returns the following results:
name description
package0 Default package. Contains all standard types, maps, compare
operators, actions and targets
sqlos Extended events for SQL Operating System
Search WWH ::




Custom Search