Moving from SQL Profiler to xEvents Peter Jonk, Premier Field Engineer – Data platform @Microsoft, Since April 2014 Previous roles: DBA, Developer blog: http://dba60k.net SQL 2008 SSMS-Addin by: Jonathan Kehayias (SQLSkills.com) - Can we do this presentation it in Dutch? (or are there any non-Dutch in the audience?) - My name is Peter Jonk, working at Microsoft as a Premier Field Engineer. Previously worked as a DBA and Developer (on funda.nl). Mainly target on SQL Server but also doing BigData (like Analytics Platform System). Maybe you saw the session of Henk van der Valk on this subject. - Also volunteer at SQLPASSNL this year. - My BLOG is dba60k.net (got my nickname DBA60K from a former colleague in the audience here - This is the last presentation of day, so you getting tired? I will only have a few slides and will do mostly demo’s on different SQL versions. - Also want to credit Jonathan Kehayias for making the Addin available and providing lots of interesting articles on this subject.
Thanks to our platinum sponsors : Take a moment to thank our sponsors. Without our sponsors we can’t organize this event. 9/26/2015 SQL Saturday Holland
Thanks to our silver and gold sponsors : Take a moment to thank our sponsors. Without our sponsors we can’t organize this event. 9/26/2015 SQL Saturday Holland
Agenda xEvents overview xEvents architecture Demo time Questions (ask anytime but discussions after session) Presentation & scripts on sqlsaturday.com - So just a couple of slides to explain the basics of xEvents and then start with demos. Questions may be asked any time, but may be postponed after session to save time. Presentation can be downloaded from SQLSaturday. No need to take notes of all slides. Demos from SQL2016 to SQL2008 - You can always drop me an email afterwards. My businesscards are on the desk 4 | 9/26/2015 SQL Saturday Holland
xEvents overview Introduced in SQL 2008, GUI since 2012 SQL 2008 GUI Add-in via http://extendedeventmanager.codeplex.com Why? Performance: Less overhead than Profiler Supportability: New events in SQL 2012/2014/2016, profiler deprecated since 2012 Extensive tracing: Using new features Introduced SQL 2008 but with no GUI. GUI added in SQL 2012, but also SSMS-Addin available - Most important reason: performance. Footprint is much smaller. You would be able to run multiple xEvent sessions without impacting performance. This was a problem with SQL Profiler - Supportability: Profiler is deprecated and not being developed anymore. However still available in SQL 2016. - Examples of extensive tracing: Page splits, I/O events Tracking Wait Types Per Session: this is something that wasn’t previously even possible, the alternative was to have clunky jobs constantly polling sys.dm_os_waiting_tasks to see what WAITS a session was encountering. With Extended Events we can easily track it and aggregate it. Tracing an entire sequence of events that end up generating a specific error: this was previously possible with Profiler but it was cumbersome and error prone. With Extended Events “causality tracking” feature this becomes much more simpler and it’s very easy to debug and troubleshoot complex chains of events. Size and amount of Read IOs a specific workload is doing: another one that wasn’t previously possible from a SQL Server tracing perspective. With the histogram target and the file read events we can easily run a workload and profile it’s IO behavior in the amount and size of the IOs it makes. This is very powerful, for example, you could capture this information and then create a SQLIO test file to test new hardware before an upgrade. 5 | 9/26/2015 SQL Saturday Holland
xEvents architecture (1/4) - This is a just a architectural overview. I will explain the concepts later. - Some of these objects sound familiar to SQL trace. Like Events, Predicates (called column filters in trace). Some concepts are new like Actions, Dispatchers and Targets - All these object types are organized in packages which are located in different modules. - Everything can be queried using T-SQL (metadata based) 6 | 9/26/2015 SQL Saturday Holland
xEvents architecture (2/4) Certain point in SQL exe Predicate Criteria on captured events Action Response to captured event Predicate like a column filter in SQL trace. Much more efficient because they are evaluated before the event fires. For profiler all data was collected first and filtered afterwards Action (synchronous response to an event) be careful for performance impact: Can be used for collecting additional event data but also setting break point or do a memory dump (Side effecting actions) 7 | 9/26/2015 SQL Saturday Holland
xEvents architecture (3/4) Target Consumer of event (memory buffer / XEL file) Type Common data types used in engine - Since this is a beginner session we only discuss event_file (XEL files) and ring_buffer for this session. - Note package0 name: This is a common package with shared objects. You also have packages like SQLOS and SQLServer 8 | 9/26/2015 SQL Saturday Holland
xEvents architecture (4/4) Lookup table. Translation of integer data stored in EventData Map - Lookup table with integer values translating to descriptions. For example different wait types values 9 | 9/26/2015 SQL Saturday Holland
Demo time Laptop SQL2016 CTP 2.3 VM’s DC (SQL2008 SP3) SQL2012 (SP2) I will give this demo on my laptop running SQL2016 but also using Hyper-V VM’s of SQL2014/2012/2008) Using SQL 2014 for most of the demo’s. I will use SQL2008 just to show differences and the SSMS-Addin. 9/26/2015 SQL Saturday Holland
Please review the event and sessions http://www.sqlsaturday.com/434/eventeval.aspx http://www.sqlsaturday.com/434/sessions/sessionevaluation.aspx Please fill in the evaluation of this event and sessions so we can improve. PASS SQL Saturday – Holland - 2015