Last modified by Billie D on 2021/03/05 13:55

From version 4.1
edited by Billie D
on 2021/02/16 23:02
To version 5.1
edited by Billie D
on 2021/03/05 13:55
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -92,73 +92,33 @@
92 92  
93 93  === Actions ===
94 94  
95 -Also known as Global Fields, Actions are commands that allow additional information to
96 -be captured when an event fires. An action is fired synchronously when an event occurs
97 -and the event is unaware of the action. There are 50 actions available that allow you to
98 -capture a rich array of information, including the statement that caused the event to fire,
99 -the security context under which the statement ran, the transaction ID, the CPU ID, and
100 -the call stack.
95 +Also known as Global Fields, **Actions** are __commands that allow additional information to be captured when an event fires__. An action is fired synchronously when an event occurs and the event is unaware of the action. There are 50 actions available that allow you to capture a rich array of information, including the statement that caused the event to fire, the security context under which the statement ran, the transaction ID, the CPU ID, and the call stack.
101 101  
102 102  === Predicates ===
103 103  
104 -Predicates are filter conditions that you can apply before the system sends events to the
105 -target. It is possible to create simple predicates, such as filtering statements completing
106 -based on a database ID, but you can also create more complex predicates, such as only
107 -capturing the role change of an AlwaysOn Availability Group replica if it happens more
108 -than twice.
99 +**Predicates** are __filter conditions that you can apply before the system sends events to the target__. It is possible to create simple predicates, such as filtering statements completing based on a database ID, but you can also create more complex predicates, such as only capturing the role change of an AlwaysOn Availability Group replica if it happens more than twice.
109 109  
110 -Predicates also fully support short-circuiting. This means that if you use multiple
111 -conditions within a predicate, then the order of predicates is important, because if the
112 -evaluation of the first predicate fails, the second predicate will not be evaluated. Because
113 -predicates are evaluated synchronously, this can have an impact on performance.
114 -Therefore, it is sensible to design your predicates, so that predicates which are least likely
115 -to evaluate to true are placed before predicates that are very likely to evaluate to true.
116 -For example, imagine that you are planning to filter on a specific database (with a
117 -database ID of 6), but this database accounts for a high percentage of the activity on
118 -the instance. You also plan to filter on a specific user ID (UserA), which is responsible
119 -for a low percentage of the activity. In this scenario, you would use the WHERE
120 -(([sqlserver].[username]='UserA') AND ([sqlserver].[database_id]=(6~)~)~)
121 -predicate to first filter out activity that does not relate to UserA, before then filtering out
122 -activity that does not relate to database ID 6.
123 -Types
124 -All objects within a package are assigned a type. This type is used to interpret the data
125 -stored within the byte collection of an object. Objects are assigned one of the following
126 -types:
127 -• Action
128 -• Event
129 -• Pred_compare (retrieve data from events)
130 -• Pred_source (compare data types)
131 -• Target
132 -• Type
101 +Predicates also fully support short-circuiting. This means that if you use multiple conditions within a predicate, then the order of predicates is important, because if the evaluation of the first predicate fails, the second predicate will not be evaluated. Because predicates are evaluated synchronously, this can have an impact on performance. Therefore, it is sensible to design your predicates, so that predicates which are least likely to evaluate to true are placed before predicates that are very likely to evaluate to true. For example, imagine that you are planning to filter on a specific database (with a database ID of 6), but this database accounts for a high percentage of the activity on the instance. You also plan to filter on a specific user ID (UserA), which is responsible for a low percentage of the activity. In this scenario, you would use the WHERE (([sqlserver].[username]='UserA') AND ([sqlserver].[database_id]=(6~)~)~) predicate to first filter out activity that does not relate to UserA, before then filtering out activity that does not relate to database ID 6. Types All objects within a package are assigned a type. This type is used to interpret the data stored within the byte collection of an object. Objects are assigned one of the following types:
133 133  
103 +* Action
104 +* Event
105 +* Pred_compare (retrieve data from events)
106 +* Pred_source (compare data types)
107 +* Target
108 +* Type
109 +
134 134  === Maps ===
135 135  
136 -A map is a dictionary that maps internal ID vales to strings that DBAs can understand.
137 -Map keys are only unique within their context and are repeated between contexts. For
138 -example, within the statement_recompile_cause context, a map_key of 1 relates to a
139 -map_value of Schema Changed. Within the context of a database_sql_statement type,
140 -however, a map_key of 1 relates to a map_value of CREATE DATABASE. You can find a
141 -complete list of mappings by using the sys.dm_xe_map_values DMV.
112 +A **map** is a __dictionary that maps internal ID vales to strings that DBAs can understand__. Map keys are only unique within their context and are repeated between contexts. For example, within the statement_recompile_cause context, a map_key of 1 relates to a map_value of Schema Changed. Within the context of a database_sql_statement type, however, a map_key of 1 relates to a map_value of CREATE DATABASE. You can find a
113 +complete list of mappings by using the __//sys.dm_xe_map_values DMV//__.
142 142  
143 143  === Sessions ===
144 144  
145 -A session is essentially a trace. It can contain events from multiple packages, actions,
146 -targets, and predicates. When you start or stop a session, you are turning the trace on
147 -or off. When a session starts, events are written to memory buffers and have predicates
148 -applied before they are sent to the target. Therefore, when creating a session, you need to
149 -configure properties, such as how much memory the session can use for buffering, what
150 -events can be dropped if the session experiences memory pressure, and the maximum
151 -latency before the events are sent to the target.
117 +A **session** is __essentially a trace__. It can contain events from multiple packages, actions, targets, and predicates. When you start or stop a session, you are turning the trace on or off. When a session starts, events are written to memory buffers and have predicates applied before they are sent to the target. Therefore, when creating a session, you need to configure properties, such as how much memory the session can use for buffering, what
118 +events can be dropped if the session experiences memory pressure, and the maximum latency before the events are sent to the target.
152 152  
153 153  == Creating an Event Session to Monitor Availability Group ==
154 154  
155 -You can create an event session using either the New Session Wizard, the New Session
156 -Dialog Box, or via T-SQL. To create a session using the New Session Wizard, drill through
157 -Management ➤ Extended Events in Object Explorer, and select New Session Wizard
158 -from the context menu of Sessions. This will cause the Introduction page of the New
159 -Session Wizard to be displayed.
160 -After passing through the Introduction page, you will find the Set Session Properties
161 -page, as displayed in Figure 9-5. Here, you can configure a name for the Session and also
162 -specify if the Session should automatically be started on creation.
122 +You can create an event session using either the **New Session Wizard**, the New Session Dialog Box, or via T-SQL. To create a session using the New Session Wizard, drill through __Management__ ➤ __Extended Events in Object Explorer__, and select __New Session Wizard__ from the context menu of Sessions. This will cause the Introduction page of the New Session Wizard to be displayed. After passing through the Introduction page, you will find the Set Session Properties page. Here, you can configure a name for the Session and also specify if the Session should automatically be started on creation.
163 163  
164 164  
Icon SQL Server.Code.SQL ServerClass[0]
databaseList1
... ... @@ -1,0 +1,1 @@
1 +Blog.BlogIntroduction