270 likes | 577 Views
SQL Server Extended Events. SQL Zaterdag , Utrecht. Norman Gillis, Premier Field Engineering. 17-November-2012. Table of Contents. Why extended events? What is it? The Extended Event Object Model Extended Event Objects Building a Session XEvent MetaData Anatomy of an Event Session
E N D
SQL Server Extended Events SQL Zaterdag, Utrecht Norman Gillis, Premier Field Engineering 17-November-2012
Table of Contents • Why extended events? • What is it? • The Extended Event Object Model • Extended Event Objects • Building a Session • XEventMetaData • Anatomy of an Event Session • Demo
Eliminate breakpoint/dump technique Why did Microsoft create extended events? XEvent can trace Lock:Acquired and Lock:Released with little degradation
What is it? Requires SQLOS
Extended Event Objects SecAudit is for All Actions Audited
Building Your Session The result of this is the event session stored in a system table but it is not running yet Your session is now running
Anatomy of an Event Session create event session myfirstsession on server add event sqlserver.error_reported ( action ( package0.callstack, sqlserver.session_id, sqlserver.sql_text ) where sqlserver.error_reported.error = 208 and package0.counter <= 5 ) add target package0.ring_buffer Can add multiple events across multiple packages for a single session Can mix objects from different packages in a single “add event” Example of property of event Special property of a package that keeps state You can have multiple targets for a session
Pre-Collect • Collection • Post-Collect • Publish Life of an Event • IsEnabled check • Event data collected • Predicate evaluation • Actions executed • data buffered asynch targets • Synchronous targets served
References • About Event Tracing: • http://msdn.microsoft.com/en-us/windows/hardware/gg487334.aspx • Troubleshooting Performance Problems in SQL Server 2008: • http://msdn.microsoft.com/en-us/library/dd672789(SQL.100).aspx • Technet SQL Server 2008 R2 Extended Events: • http://technet.microsoft.com/en-us/library/bb630282.aspx • MSDN SQL Server 2012 Extended Events: • http://msdn.microsoft.com/en-us/library/bb630282(SQL.110).aspx