Performance Monitoring And Tuning In Sql Server 2008 Tsql

1,686 views
1,570 views

Published on

Performance Monitoring and Tuning in SQL Server 2008

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,686
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Performance Monitoring And Tuning In Sql Server 2008 Tsql

  1. 1. Performance Tuning and Monitoring in SQL Server 2008 <ul><li>[email_address] </li></ul>
  2. 2. <ul><li>Prepare for performance problems </li></ul><ul><li>Understand the architecture of Perf. Studio </li></ul><ul><li>Enable performance data collection </li></ul><ul><li>Analyze the results for diagnostics </li></ul><ul><li>Manage the management data warehouse db </li></ul><ul><li>Use Policy Based Management to standardize </li></ul>What we will cover
  3. 3. Prepare for Performance Problems <ul><li>Causes of SQL Server performance problems </li></ul><ul><li>Collect information to narrow down problems </li></ul><ul><li>Establish server performance baseline </li></ul><ul><li>Use proper tools for the specific version </li></ul>Prepare
  4. 4. <ul><li>Application design problems </li></ul><ul><li>SQL Server configuration </li></ul><ul><li>System resource contention </li></ul><ul><li>Blocking </li></ul><ul><li>A particular set of queries or stored procedures with long execution times </li></ul><ul><li>Causes of SQL Server Performance Problems </li></ul>Prepare
  5. 5. <ul><li>What is slow? </li></ul><ul><li>When is it slow? </li></ul><ul><li>Can we reproduce the problem? </li></ul><ul><li>Is it a dedicated SQL Server box? </li></ul><ul><li>What applications accessing database server? </li></ul><ul><li>Any scheduled batch/job running? </li></ul><ul><li>Any data move to/from other servers? </li></ul><ul><li>Collect information to narrow down problems </li></ul>Prepare
  6. 6. <ul><li>T ake performance measurements at regular intervals over time </li></ul><ul><li>Compare each new set of measurements with those taken earlier </li></ul><ul><li>At a minimum, use baseline measurements to determine: </li></ul><ul><ul><li>Peak and off-peak hours of operation </li></ul></ul><ul><ul><li>Production-query or batch response times </li></ul></ul><ul><li>Establish server perf. baseline </li></ul>Prepare
  7. 7. <ul><li>Version 2000: </li></ul><ul><ul><li>Profiler, Perfmon, Blocker Script, or PSSDiag </li></ul></ul><ul><li>Version 2005: </li></ul><ul><ul><li>PSSDiag, DMVs, DMVStats, SQL Nexus </li></ul></ul><ul><li>Version 2008: </li></ul><ul><ul><li>Data Collector, MDW, Policies, Activity Monitor, XEvents </li></ul></ul><ul><li>Use proper tools </li></ul>Prepare
  8. 8. SQL Server 2008 Performance Monitoring Tools <ul><li>Data Collector </li></ul><ul><li>Management Data Warehouse </li></ul><ul><li>Activity Monitor </li></ul><ul><li>Resource Governor </li></ul><ul><li>XEvents </li></ul><ul><li>Performance Reports </li></ul><ul><li>SQL Profiler </li></ul><ul><li>Dynamic Management Views </li></ul><ul><li>Database Engine Tuning Advisor </li></ul><ul><li>DMVStats (Codeplex.com) </li></ul><ul><li>SQL Nexus (Codeplex) </li></ul>New Tools Existing Tools Architecture
  9. 9. <ul><li>Part of SQL Server Management Studio (SSMS) </li></ul><ul><li>A framework ties together: </li></ul><ul><ul><li>Data collection </li></ul></ul><ul><ul><li>Performance monitoring, troubleshooting, tuning </li></ul></ul><ul><ul><li>Persistence of diagnostics data </li></ul></ul><ul><ul><li>Reporting </li></ul></ul><ul><li>Foundation for future </li></ul><ul><ul><li>Provide enhanced data collection, reports </li></ul></ul>What is Performance Studio? Architecture
  10. 10. Performance Studio Overview Architecture
  11. 11. System Collection Set Reports (RS) Management Data Warehouse Performance Studio Architecture Custom Collection Set Reports (RS) SQL Server Management Studio Collection Item1– TSQL Collector Type System Collection Set Custom Collection Set C.I.2–Perform. Counters C. Type Collection Item1–SQL Trace Collector Type C.I.2– Query Activity C. Type Architecture
  12. 12. Data Collector Architecture Architecture
  13. 13. Data Collection Run-Time Processing Architecture
  14. 14. <ul><li>Enable Performance Data Collection </li></ul>DEMO-1 Enable
  15. 15. <ul><li>Find and Diagnose Past Issues </li></ul>DEMO-2 Analyze
  16. 16. <ul><li>Find and Diagnose Active Issues </li></ul>DEMO-3 Analyze
  17. 17. Manage the MDW <ul><li>Centralize </li></ul><ul><li>Plan to collect on different server to avoid measuring Data Collector itself </li></ul><ul><li>Use a central server </li></ul><ul><ul><li>For others to access the MDW Reports at one place </li></ul></ul><ul><ul><li>To distribute policies from one location </li></ul></ul><ul><li>Built-in schedules upload every 15mins </li></ul><ul><li>Consider adjusting start time if there are multiple uploads from multiple servers </li></ul><ul><li>Consider running an archive job scheduled to run just before the purge </li></ul><ul><li>Plan for around 200-500 MB per day </li></ul><ul><li>Archive the data – don’t lose it! </li></ul>Manage <ul><li>Control Upload Schedules </li></ul><ul><li>Space requirements </li></ul>
  18. 18. Policy Based Management <ul><li>Facet: </li></ul><ul><li>What you are managing; sql instance, db etc. </li></ul><ul><li>Condition: </li></ul><ul><li>The state you want the Facet to be in </li></ul><ul><li>Execution Mode: </li></ul><ul><li>How you test for the condition </li></ul><ul><li>- On Demand – On Change – On Schedule </li></ul>Policy
  19. 19. <ul><li>Prevent future issues </li></ul><ul><li>Ensure desired levels of performance </li></ul>DEMO-4 Policy
  20. 20. Questions?
  21. 21. Thank You

×