אירוע
31 במרץ, 23 - 2 באפר׳, 23
אירוע הלמידה הגדול ביותר של SQL, Fabric ו- Power BI. 31 במרץ - 2 באפריל. השתמש בקוד FABINSIDER כדי לחסוך $400.
הירשם עוד היוםהדפדפן הזה אינו נתמך עוד.
שדרג ל- Microsoft Edge כדי לנצל את התכונות, עדכוני האבטחה והתמיכה הטכנית העדכניים ביותר.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
The Extended Events (XEvents) architecture enables users to collect as much or as little data as is necessary to monitor, identify, or troubleshoot performance in SQL Server, Azure SQL Database, and Azure SQL Managed Instance. Extended Events is highly configurable, lightweight, and scales well. For more information, see Extended Events Architecture.
Extended Events replace the deprecated SQL Trace and SQL Server Profiler features.
To get started with Extended Events, use Quickstart: Extended Events.
הערה
If you use Azure SQL, learn how Code examples can differ for Azure SQL Database and SQL Managed Instance and more about Extended events in Azure SQL Database.
Extended Events is a lightweight performance monitoring system that uses minimal system resources while providing a detailed, in-depth view of the database engine. SQL Server Management Studio provides a graphical user interface for Extended Events to create, modify, and drop event sessions and to display and analyze session data. To learn more about Extended Events support in Management Studio, see:
Extended Events builds on existing concepts from Event Tracing for Windows, such as event and event consumer, and introduces new concepts such as action and predicate.
The following table provides documentation references to understand the concepts in Extended Events.
Article | Description |
---|---|
Extended Events packages | Describes the Extended Events packages that contain objects. These objects are used to obtain and process data when an Extended Events session is running. |
Targets for Extended Events | Describes the event consumers that can receive data during an event session. |
Extended Events engine | Describes the engine that implements and manages an Extended Events session. |
Extended Events sessions | Describes the Extended Events session. |
Extended Events is a name for a general event-handling system for server systems. The Extended Events infrastructure supports the correlation of data from the database engine, and under certain conditions, the correlation of data from the operating system and database applications. In the operating system case, Extended Events output must be directed to Event Tracing for Windows (ETW). ETW can correlate the event data with operating system or application event data.
All applications have execution points that are useful both inside and outside an application. Inside the application, asynchronous processing can be enqueued using information that is collected during the initial execution of a task. Outside the application, execution points provide monitoring utilities with information. The information is about the behavioral and performance characteristics of the monitored application.
Extended Events supports using event data outside a process. This data is typically used by users either administering or supporting a product by doing performance monitoring or by user developing applications on a product for debugging purposes. Data is consumed or analyzed using tools such as SQL Server Management Studio, XEvent Profiler and Performance Monitor, and T-SQL or Windows command line tools.
Extended Events has the following key design aspects:
Extended Events can synchronously generate event data (and asynchronously process that data), which provides a flexible solution for event handling. In addition, Extended Events provides the following features:
Using Management Studio or Transact-SQL to execute Transact-SQL Data Definition Language (DDL) statements, consume dynamic management views and functions, or catalog views, you can create simple or complex SQL Server Extended Events troubleshooting solutions for your SQL Server environment.
Task description | Article |
---|---|
Use the Object Explorer to manage event sessions. | Manage Event Sessions in the Object Explorer |
Describes how to create an Extended Events session. | Extended Events sessions |
Describes how to view and refresh target data. | View event data in SQL Server Management Studio |
Describes how to use Extended Events tools to create and manage your Extended Events sessions. | Extended Events Tools |
Describes how to alter an Extended Events session. | Alter an Extended Events Session |
Describes how to get information about the fields associated with the events. | Get the Fields for All Events |
Describes how to find out what events are available in the registered packages. | SELECTs and JOINs From System Views for Extended Events in SQL Server |
Describes how to determine what Extended Events targets are available in the registered packages. | Targets for Extended Events |
Describes how to view the Extended Events events and actions that are equivalent to each SQL Trace event and its associated columns. | View the Extended Events Equivalents to SQL Trace Event Classes |
Describes how to find the parameters you can set when you use the ADD TARGET clause in CREATE EVENT SESSION or ALTER EVENT SESSION statements. |
Targets for Extended Events |
Describes how to convert an existing SQL Trace script to an Extended Events session. | Convert an Existing SQL Trace Script to an Extended Events Session |
Describes how to determine which queries are holding the lock, the plan of the query, and the Transact-SQL stack at the time the lock was taken. | Determine Which Queries Are Holding Locks |
Describes how to identify the source of locks. | Find the Objects That Have the Most Locks Taken on Them |
Describes how to use Extended Events with Event Tracing for Windows to monitor system activity. | Monitor System Activity Using Extended Events |
Using Catalog Views and Dynamic Management Views (DMVs) for Extended Events | SELECTs and JOINs From System Views for Extended Events in SQL Server |
Use the following T-SQL query to return all possible events and their descriptions:
SELECT obj1.name AS [XEvent-name],
col2.name AS [XEvent-column],
obj1.description AS [Descr-name],
col2.description AS [Descr-column]
FROM sys.dm_xe_objects AS obj1
INNER JOIN sys.dm_xe_object_columns AS col2
ON col2.object_name = obj1.name
ORDER BY obj1.name,
col2.name
Some Transact-SQL code examples written for SQL Server need small changes to run in Azure. One category of such code examples involves catalog views whose name prefixes differ depending on the database engine type:
server_
- prefix for SQL Server and Azure SQL Managed Instancedatabase_
- prefix for Azure SQL Database and SQL Managed InstanceAzure SQL Database supports only database-scoped event sessions. SQL Server Management Studio (SSMS) fully supports database-scoped event sessions for Azure SQL Database: an Extended Events node containing database-scoped sessions appears under each database in Object Explorer.
Azure SQL Managed Instance supports both database-scoped sessions and server-scoped sessions. SSMS fully supports server-scoped sessions for SQL Managed Instance: an Extended Events node containing all server-scoped sessions appears under the Management folder for each managed instance in Object Explorer.
הערה
Server-scoped sessions are recommended for managed instances. Database-scoped sessions aren't displayed in Object Explorer in SSMS for Azure SQL Managed Instance. Database-scoped sessions can only be queried and managed with Transact-SQL when using a managed instance.
For illustration, the following table lists and compares two subsets of catalog views. For brevity, the subsets are restricted to view names that also contain the string _event
. The subsets have differing name prefixes because they support different database engine types.
Name in SQL Server and Azure SQL Managed Instance | Name in Azure SQL Database and Azure SQL Managed Instance |
---|---|
server_event_notifications server_event_session_actions server_event_session_events server_event_session_fields server_event_session_targets server_event_sessions server_events server_trigger_events |
database_event_session_actions database_event_session_events database_event_session_fields database_event_session_targets database_event_sessions |
The two lists in the preceding table were accurate as of March 2022. For an up-to-date list, run the following Transact-SQL SELECT
statement:
SELECT name
FROM sys.all_objects
WHERE
(name LIKE 'database[_]%' OR
name LIKE 'server[_]%' )
AND name LIKE '%[_]event%'
AND type = 'V'
AND SCHEMA_NAME(schema_id) = 'sys'
ORDER BY name;
אירוע
31 במרץ, 23 - 2 באפר׳, 23
אירוע הלמידה הגדול ביותר של SQL, Fabric ו- Power BI. 31 במרץ - 2 באפריל. השתמש בקוד FABINSIDER כדי לחסוך $400.
הירשם עוד היוםהדרכה
מודול
ניהול וניטור של יומני אירועים של Windows Server - Training
למד כיצד מציג האירועים מספק מיקום נוח ונגיש כדי שתוכל לבחון אירועים שמתרחשים. גש למידע אודות אירועים במהירות ובנוחות. למד כיצד לפרש את הנתונים ביומן האירועים.
אישור
Microsoft Certified: Azure Database Administrator Associate - Certifications
ניהול תשתית מסד נתונים של SQL Server עבור מסדי נתונים יחסיים של ענן, מסדי נתונים מקומיים ו היברידיים באמצעות ההצעות של מסד הנתונים היחסי של Microsoft PaaS.
תיעוד
SQL Trace
CREATE EVENT SESSION (Transact-SQL) - SQL Server
CREATE EVENT SESSION creates an Extended Events session that identifies the source of the events, the event session targets, and the event session options.
Convert a SQL Trace script to Extended Events session - SQL Server
Use these procedures to create an Extended Events session equivalent to an existing SQL Trace script that you want to convert.