Download presentation
Presentation is loading. Please wait.
Published byLesley Lambert Modified over 8 years ago
2
Sofia, Bulgaria | 9-10 October SQL Server Profiler Richard Campbell
3
Sofia, Bulgaria | 9-10 October Who Am I? ●Consultant in development methodology and high scaling systems ●Microsoft Regional Director ●Partner in PWOP Productions ●Author of Advisor Answers ●www.campbellassociates.ca ●C●Consultant in development methodology and high scaling systems ●M●Microsoft Regional Director ●P●Partner in PWOP Productions ●A●Author of Advisor Answers ●w●www.campbellassociates.ca
4
Sofia, Bulgaria | 9-10 October PWOP Productions ●.NET Rocks! ●Internet Audio Talkshow for.NET Developers ●www.dotnetrocks.comwww.dotnetrocks.com ●dnrTV ●Screencast (see the code!) ●www.dnrtv.comwww.dnrtv.com ●.●.NET Rocks! ●I●Internet Audio Talkshow for.NET Developers ●w●www.dotnetrocks.com ●d●dnrTV ●S●Screencast (see the code!) ●w●www.dnrtv.com
5
Sofia, Bulgaria | 9-10 October Overview ●Understand performance problems ●Answer the question “Why is it slow?” ●Tune up your SQL Server ●SQL Server behavior changes over time ●Understand middleware ●ODBC and OLE DB change your queries! ●Understand performance problems ●Answer the question “Why is it slow?” ●Tune up your SQL Server ●SQL Server behavior changes over time ●Understand middleware ●ODBC and OLE DB change your queries!
6
Sofia, Bulgaria | 9-10 October Profiler Terms ●Event ●All data coming and going from SQL Server is considered an event ●Connections, queries, stored procedures, cursors, batches, locks, errors; everything is an event! ●Related events are grouped into Event Categories (all connection events, etc) ●Event ●All data coming and going from SQL Server is considered an event ●Connections, queries, stored procedures, cursors, batches, locks, errors; everything is an event! ●Related events are grouped into Event Categories (all connection events, etc)
7
Sofia, Bulgaria | 9-10 October Profiler Terms ●Data Columns ●Information about events is displayed as data columns ●The Event Class column identifies the event ●Different events provided different data columns (although many are common across events) ●Data Columns ●Information about events is displayed as data columns ●The Event Class column identifies the event ●Different events provided different data columns (although many are common across events)
8
Sofia, Bulgaria | 9-10 October Profiler Terms ●Trace ●A record of all the events that occur for a given period in a SQL Server ●You define which events you wish to trace ●Can be saved to a file for later examination and analysis ●Some traces can be replayed ●Trace ●A record of all the events that occur for a given period in a SQL Server ●You define which events you wish to trace ●Can be saved to a file for later examination and analysis ●Some traces can be replayed
9
Sofia, Bulgaria | 9-10 October Profiler Terms ●Template ●A file that records what events and data columns to capture in a particular trace ●Profiler comes with a set of templates ●You can build your own templates to examine issues in your SQL Server ●There are several templates included with this session ●Template ●A file that records what events and data columns to capture in a particular trace ●Profiler comes with a set of templates ●You can build your own templates to examine issues in your SQL Server ●There are several templates included with this session
10
Sofia, Bulgaria | 9-10 October Scenarios ●Performance Issues ●Find the slowest running queries/stored procedures ●Identify most frequently used queries (the best candidates for performance tuning) ●Fight back from deadlocks and blocking ●Performance Issues ●Find the slowest running queries/stored procedures ●Identify most frequently used queries (the best candidates for performance tuning) ●Fight back from deadlocks and blocking
11
Sofia, Bulgaria | 9-10 October Scenarios ●Tuning ●What indexes will improve performance? ●What indexes aren’t being used and should be removed? ●How efficiently is SQL Server executing stored procedures and queries? ●Tuning ●What indexes will improve performance? ●What indexes aren’t being used and should be removed? ●How efficiently is SQL Server executing stored procedures and queries?
12
Sofia, Bulgaria | 9-10 October Scenarios ●Application Issues ●ODBC and OLE-DB can and will change your queries to provide features as needed ●Often this involves a cursor – a HUGE performance hit ●Without Profiler, you’d have NO WAY to find out that this was happening ●Application Issues ●ODBC and OLE-DB can and will change your queries to provide features as needed ●Often this involves a cursor – a HUGE performance hit ●Without Profiler, you’d have NO WAY to find out that this was happening
13
Sofia, Bulgaria | 9-10 October Other Capabilities ●Replaying Traces ●You can execute the queries from a trace into SQL Server again ●This provides a method for “proving” a fix to the database design ●Also provides a means to transfer changes to a database from one to another (such as from production to test) ●Replaying Traces ●You can execute the queries from a trace into SQL Server again ●This provides a method for “proving” a fix to the database design ●Also provides a means to transfer changes to a database from one to another (such as from production to test)
14
Sofia, Bulgaria | 9-10 October Other Capabilities ●Replaying Traces ●You have to capture all data change related events and data columns for replaying to be available ●There is a trace included with Profiler that has the right parameters set for replaying ●Replaying Traces ●You have to capture all data change related events and data columns for replaying to be available ●There is a trace included with Profiler that has the right parameters set for replaying
15
Sofia, Bulgaria | 9-10 October Performance Concerns ●Production Trace Loads ●The more you trace, the more load you exert on your SQL Server ●Be aware that very generic traces (lots of events and data columns) can significantly impact database performance ●Generic traces create HUGE trace files (have you got enough drive space) ●Production Trace Loads ●The more you trace, the more load you exert on your SQL Server ●Be aware that very generic traces (lots of events and data columns) can significantly impact database performance ●Generic traces create HUGE trace files (have you got enough drive space)
16
Sofia, Bulgaria | 9-10 October Conclusions ●Profiler provides effective means to understand what’s actually happening at the SQL Server level ●Use Profiler to identify slow queries ●Use your optimization time carefully by identifying the worst queries and stored procedures ●Profiler provides effective means to understand what’s actually happening at the SQL Server level ●Use Profiler to identify slow queries ●Use your optimization time carefully by identifying the worst queries and stored procedures
17
Sofia, Bulgaria | 9-10 October Conclusions ●The Index Tuning Wizard can tell you what indexes are missing or useless ●SQL Server behavior changes as the data changes, so use Profiler on an on- going basis ●Be aware of your application middleware is up to! ●The Index Tuning Wizard can tell you what indexes are missing or useless ●SQL Server behavior changes as the data changes, so use Profiler on an on- going basis ●Be aware of your application middleware is up to!
18
Sofia, Bulgaria | 9-10 October Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.