Sei sulla pagina 1di 26

Module 10

Monitoring, Tracing, and Baselines


Module Overview

• Monitoring and Tracing


• Baselining and Benchmarking
Lesson 1: Monitoring and Tracing

• Dynamic Management Objects


• Windows Performance Monitor
• Activity Monitor
• Extended Events
• SQL Server Profiler
• SQL Trace
• The Default Trace
• Analyzing Trace Data
• Trace Replay
• Demonstration: Analyzing Performance Monitor
Data
Dynamic Management Objects

• Used to monitor SQL Server health


• Server-scoped: stored in sys schema of master
database
• Database-scoped: stored in sys schema of each
database
• Queried using Transact-SQL
Windows Performance Monitor

• Displays real-time performance data


• Monitors system and application health
• Saves performance data to text files or database
• Enables creation of custom data collector set
• Can respond to alerts
Activity Monitor

• Provides information about:


• Active expensive queries
• Data file I/O
• Processes
• Recent expensive queries
• Resource waits
• Server status
Extended Events

• Extended events packages


• Extended events targets
• Extended events engine
• Extended events session
SQL Server Profiler

• Captures, manages, and analyses SQL Server


traces
• Useful for:
• Finding resource-intensive queries
• Finding long-running queries
• Replaying transactions to resolve issues

• Impacts performance of the SQL Server instance


• Has been deprecated and may be removed from
a future version of SQL Server
SQL Trace

• Provides real-time server activity information


• Is created and configured by using system stored
procedures
• Incurs less overhead than SQL Profiler but still
impacts performance
The Default Trace

• Is enabled by default
• Records a variety of events useful for:
• Reviewing schema changes
• Monitoring autogrowth
• Analyzing sort and hash warnings
• Monitoring security events
Analyzing Trace Data

• SQL Profiler
• Useful for preliminary analysis
• Do not use for new projects

• Transact-SQL Queries

• Database Engine Tuning Advisor

• RML Utilities Readtrace Tool


Trace Replay

• Apply a real-life load on a test system

• Use:
• SQL Server Profiler
• Distributed Replay
Demonstration: Analyzing Performance Monitor Data

In this demonstration, you will see how to:


• Analyze Performance Monitor data
Lesson 2: Baselining and Benchmarking

• Methodology for Creating Baselines


• Stress-Testing Tools
• Data Collection Using DMVs
• Data Collection Using Perfmon Counters
• Analyzing Collected Data
• Database Engine Tuning Advisor
• Demonstration: Collecting Performance Data
using DMVs
Methodology for Creating Baselines

• Baseline-usual state of a SQL Server instance

• What to capture?
• Performance Monitor counters
• DMV output
• Trace data
Stress-Testing Tools

• Stress testing and load testing can be carried out


using Microsoft SQL Server Distributed Replay
Data Collection Using DMVs

• Some of the important DMVs that you should


consider when you capture a baseline are as
follows:
Data Collection Using Perfmon Counters

• Graphical utility used to monitor real-time


system performance
• Data collection can be triggered in response to
events
• Data collection can be scheduled
Analyzing Collected Data

• Microsoft Excel:
• Use relog to create csv data
• Apply aggregations in a worksheet
• Database:
• Use the relog utility to import data into a database
• Analyze data by using Transact-SQL
Database Engine Tuning Advisor

• Enables tuning with no knowledge of underlying


databases
• Accepts a variety of workloads:
• Plan cache
• SQL Server Profiler trace
• Transact-SQL
• XML
Demonstration: Collecting Performance Data using
DMVs

• In this demonstration, you will see how to collect


performance data by using DMVs
Lab: Monitoring, Tracing, and Baselining

• Exercise 1: Collecting and Analyzing Data Using


Extended Events
• Exercise 2: Implementing Baseline Methodology

Logon Information
Virtual machine: 10987C-MIA-SQL
User name: ADVENTUREWORKS\Student
Password: Pa55w.rd

Estimated Time: 60 minutes


Lab Scenario

You are investigating why a new SQL Server


instance is so slow; users frequently complain that
their workloads run very slowly during peak hours
of business. In addition, to troubleshoot
performance issues in future and take more
informed corrective measures, you decide to
establish a baseline for SQL Server performance.
In this lab, you will set up data collection for
analyzing workload during peak business hours
and implement a baseline methodology to collect
performance data at frequent intervals, so that
comparisons can be made with the baseline.
Lab Review

You will now be able to:


• Collect and analyze performance data by using
Extended Events.
• Implement a methodology to establish a baseline.
Module Review and Takeaways

Constant monitoring and tracing is the key to


identifying performance issues that are happening
in their environment. Benchmarks and baselines are
the key to implanting a robust performance
troubleshooting methodology.
Course Evaluation

• Your evaluation of this course will help Microsoft


understand the quality of your learning
experience.
• Please work with your training provider to access
the course evaluation form.
• Microsoft will keep your answers to this survey
private and confidential and will use your
responses to improve your future learning
experience. Your open and honest feedback is
valuable and appreciated.

Potrebbero piacerti anche