Presentation is loading. Please wait.

Presentation is loading. Please wait.

Medlemsträff i Stockholm

Similar presentations


Presentation on theme: "Medlemsträff i Stockholm"— Presentation transcript:

1 Medlemsträff i Stockholm 2011-01-24

2 Agenda 12.30 – 13.30 Lunch and social gathering
13.30 – Introduction 13.45 – Raoul Illyés: Stop guessing! 14.45 – Break 15.00 – Joe Chang: The SQL Server Query Optimizer Cost Formulas 16.30 – Q&A with Joe and Raoul

3 Sponsorer

4 SQLug.se Information PASS Chapter Ideell förening registrerad
Årets aktiviteter 5 träffar i Sthlm 2011 Talare sökes! PASS konf i November SQLUG lag till Triathlon SQLUG Challenge

5 Xevent by Raoul Illyés

6 Who am i? 17 years of IT Experiance SQL MVP since October 2010
Owner of Guide-line since 2010

7 History In 2007 was invited to Redmond to
demonstrate the Oracles way of instrumentation. They showed me an alpha version of Extended events.

8 History A 1000 mails later back and forth i was in 2008
invited back to Redmond to work with Xevent for 2 hole weeks. The aim was to create some form of tool to demonstrate Its powers, the result was..

9 Response Time Analysis using Extended Events

10 Then many, many presentations later nothing
has really happened

11 The main reason for this is:
Complexity! (NO UI) CREATE EVENT SESSION event_session_name ON SERVER {     <event_definition> [ ,...n]     [ <event_target_definition> [ ,...n] ]     [ WITH ( <event_session_options> [ ,...n] ) ] } ;    <event_definition>::= {     ADD EVENT [event_module_guid].event_package_name.event_name          [ ( {                  [ SET { event_customizable_attribute = <value> [ ,...n] } ]                  [ ACTION ( { [event_module_guid].event_package_name.action_name [ ,...n] } ) ]                  [ WHERE <predicate_expression> ]         } ) ] }    <predicate_expression> ::= {     [ NOT ] <predicate_factor> | {( <predicate_expression> ) }     [ { AND | OR } [ NOT ] { <predicate_factor> | ( <predicate_expression> ) } ]     [ ,...n ] }    <predicate_factor>::= {     <predicate_leaf> | ( <predicate_expression> ) } <predicate_leaf>::= {       <predicate_source_declaration> { = | < > | ! = | > | > = | < | < = } <value>     | [event_module_guid].event_package_name.predicate_compare_name ( <predicate_source_declaration>, <value> ) } <predicate_source_declaration>::= {         event_field_name | ( [event_module_guid].event_package_name.predicate_source_name ) }    <value>::= {         number | 'string' } <event_target_definition>::= {     ADD TARGET [event_module_guid].event_package_name.target_name         [ ( SET { target_parameter_name = <value> [ ,...n] } ) ] } <event_session_options>::= {     [    MAX_MEMORY = size [ KB | MB ] ]     [ [,] EVENT_RETENTION_MODE = { ALLOW_SINGLE_EVENT_LOSS | ALLOW_MULTIPLE_EVENT_LOSS | NO_EVENT_LOSS } ]     [ [,] MAX_DISPATCH_LATENCY = { seconds SECONDS | INFINITE } ]     [ [,] MAX_EVENT_SIZE = size [ KB | MB ] ]     [ [,] MEMORY_PARTITION_MODE = { NONE | PER_NODE | PER_CPU } ]     [ [,] TRACK_CAUSALITY = { ON | OFF } ]     [ [,] STARTUP_STATE = { ON | OFF } ] }

12 2. Non friendly providers for the DBA.

13 (SQL Server 2008 Extended Events SSMS Addin)
So what have changed? Jonathan gave us a UI to use to interact with Extended events (SQL Server 2008 Extended Events SSMS Addin) Microsoft will bring their own in SQL11

14 What is Xevent? The new low level, high performance eventing system in SQL Server. Used correctly Xevent will make you stop guessing!

15 Xevent is implemented through a couple of packages
Just like “Profiler” is. Packages Currently there are 4 packages available: Package0 (default, meta objects) Sqlos (OS Related) Sqlserver (Profiler counter part) SecAudit (is private and used only for the built-in SQL Server auditing) select * from sys.dm_xe_packages Module (sqlserver.exe) Packages

16 And inside the Xevent packages we have the objects
Packages are containers Each package must have a GUID and a name Can contain any or all of: Event Target Action Predicate Type Map Module (sqlserver.exe) Packages Events Targets Actions Types Predicates Maps

17 Xevent building blocks
Events Events are points in code that we can trace and currently there are about 254 events defined in SQL Server 2008, R2: SELECT * FROM sys.dm_xe_objects WHERE object_type = 'event' ORDER BY name  DEMO 1

18 Life of an event

19 Xevent building blocks
Targets Targets are the consumers of the events, there are currently 6 targets available in SQL Server 2008: Event bucketing Event pairing ETW target Event file Synchronous event counter Ring buffer SELECT * FROM sys.dm_xe_objects WHERE object_type = 'target' ORDER BY name 

20 Xevent building blocks
And a lot more that we don't have the time to dwell upon.… Predicates Actions Sessions Types and Maps

21 History lane, different tools for different things.
Perfmon ETW Sysinternals Windows Server “Huston we have a problem, but where To begin?” SQL Server Tools: Profiler Server trace System tables DMV & DMF´s

22 The Profiler aggregation problem.

23 The [sys].[dm_os_wait_stats] scope problem.

24 The [sys].[dm_exec_requests] sampling problem.

25 The Xevent Way! DEMO 2 DBCC DROPCLEANBUFFERS; GO USE AdventureWorks
SELECT p.Name AS ProductName, NonDiscountSales = (OrderQty * UnitPrice), Discounts = ((OrderQty * UnitPrice) * UnitPriceDiscount) FROM Production.Product AS p INNER JOIN Sales.SalesOrderDetail AS sod ON p.ProductID = sod.ProductID ORDER BY ProductName DESC; --SELECT TOP 1000 [wait_type] ,[waiting_tasks_count] ,[wait_time_ms] ,[max_wait_time_ms] ,[signal_wait_time_ms] -- FROM [AdventureWorks].[sys].[dm_os_wait_stat DEMO 2

26 System_health What is that?
Created by the Product Support team (PSS) keeps track of information commonly use to debug customer systems, such as: when a deadlock or a high-severity error occurs. The session is created and started as part of the install process for a SQL Server >= 2008 instance using the ring buffer target. DEMO 3

27 (To come to a class near you!)
What about end-to-end trace? From IIS to SQL Server, SQL Server to SAN and then back again we use the ETW target. (To come to a class near you!)

28 Almost no cost in running a Xevent trace.
A round-up. Almost no cost in running a Xevent trace. Test by Microsoft revels that 20,000 events/sec trace on a 2 GHZ Pentium with 1 GB RAM takes less than 2% of the CPU, Wow! Xevent data is not stored as XML, but the providers made available to interpret the data dose (Except ETW.) Server 1 Server 2 Server 3


Download ppt "Medlemsträff i Stockholm"

Similar presentations


Ads by Google