EOH: A Microsoft Partner INTRODUCTION TO EXTENDED EVENTS

Preview:

DESCRIPTION

XE Architecture – Courtesy BOL

Citation preview

EOH: A Microsoft Partner

INTRODUCTION TO EXTENDED EVENTS

www.eoh.co.za

What is XE

Extended Events:– Replacement for SQL Profiler (Deprecated)– XE features on all editions

Event handling framework for systems

Used for diagnostics, tracing and auditing

XE combines information from SQL Server and OS

www.eoh.co.za

XE Architecture – Courtesy BOL

www.eoh.co.za

Packages

• Parent container contained attributes of events within the package

• Three Types

– Package0– SQLServer– SQLOS– 1 Internal

XE Components

www.eoh.co.za

Events

• Two Categories

– 4 Channels (Grouping of Events)

– Keyword (Specific)

• Defined point in task

XE Components

www.eoh.co.za

Targets

• Consume events & output event data

• Six target types– File – Histogram– Counter– Pairing– ETW– Ring Buffer

XE Components

www.eoh.co.za

Actions

• Response\s to an event.

• All actions are SYNC.

• Collects object details from EVENT.

– TSQL capture\ Plan handle\ Numa ID etc.

• Certain events can have unique actions.

XE Components

www.eoh.co.za

Predicates

• Boolean expressions that have a failure on first false evaluation.

• Applied per event not per session.

• Order of predicates can affect performance.

• Rich evaluation and filtering contexts

XE Components

www.eoh.co.za

GLOBAL EVENT SESSION DATA

sys.server_event_sessions

sys.server_event_session_target

sys.server_event_session_fields

sys.server_event_session_actions

sys.server_event_session_events

Metadata – System Views

www.eoh.co.za

EVENT SYSTEM DATA

sys.dm_xe_packages

sys.dm_xe_objects

sys.dm_xe_object_columns

sys.dm_xe_map_values

Metadata - DMVs

www.eoh.co.za

ACTIVE SESSION DATA

sys.dm_xe_sessions

sys.dm_xe_session_targets

sys.dm_xe_events

sys.dm_xe_event_actions

Meta Data - DMVs

www.eoh.co.za

Querying XE system Tables And DMVs

DEMO

www.eoh.co.za

CREATE EVENT SESSION…ON SERVER ALTER EVENT SESSION…ON SERVER DROP EVENT SESSION…ON SERVER COMMON OPTIONS:

– MAX_DISPATCH_LATENCY– MAX_MEMORY– STARTUP_STATE – EVENT_RETENTION_MODE

• SINGLE• MULTIPLE• NONE

XE DDL

www.eoh.co.za

XE DDL

DEMO

www.eoh.co.za

Real-time amendment of events and predicates. SSMS GUI interface. Different stores for output. Event correlation available. Profiler Deprecated (Repeat ) Less Overhead.

SQL Trace vs XE

www.eoh.co.za

sys.trace_xe_event_map

sys.trace_xe_action_map

sp_BlitzTrace

Migrating Profiler to XE

www.eoh.co.za

Deadlocks Page splits – fill factor Auditing – Internal Use only CPU and IO tracking Wait stats Queries by duration General troubleshooting

Use Case Scenarios

www.eoh.co.za

USE CASES

DEMO

www.eoh.co.za

Additional XE objects added. Live data view. GUI interface.

• Aggregation and filtering in UI• New session wizard• Create new session• Templates• View Target Data• Customizing View• Live Data watch

Enhancements in SQL 2012\4

www.eoh.co.za

SSMS XE GUI

DEMO

www.eoh.co.za

Pair Matching considerations.

Partitioning nodes.

Predicates.

Use the MAX option to control overhead.

Use sampling to minimize result sets.

Best Practices & Considerations

www.eoh.co.za

Idera XE Profiler• https://www.idera.com/productssolutions/freetools

sp_BlitzTrace – Brent Ozar• http://www.brentozar.com/extendedevents

Jonathan Kehayias – SQLSkills• XE SSMS 2008 Add-In (codeplex)• Deep Dive Blogs (msdn & sqlskills.com)

Mike Wachel – MSFT• XE Engine developer• http://blogs.msdn.com/b/extended_events/

XTrace (WinSDK)• Tools for OS\SQL\APP debug

Useful Resources

www.eoh.co.za

Donovan White Email: Donovan.White@eoh.co.za

Twitter:@SQLSoup

Questions & Answers

Recommended