0% found this document useful (0 votes)
132 views

20764C 13-1 PDF

This document provides an overview of Module 13 which covers monitoring SQL Server. It discusses monitoring activity using dynamic management views and functions (DMVs/DMFs), activity monitor, and performance monitor. It also covers capturing and managing performance data using the SQL Server data collector to collect and store metrics in a management data warehouse. The module concludes with analyzing collected performance data through standard reports included in the data warehouse like disk usage, server activity, and query statistics reports. A lab scenario is also provided where the student will create and configure a management data warehouse to diagnose performance issues.

Uploaded by

Phil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

20764C 13-1 PDF

This document provides an overview of Module 13 which covers monitoring SQL Server. It discusses monitoring activity using dynamic management views and functions (DMVs/DMFs), activity monitor, and performance monitor. It also covers capturing and managing performance data using the SQL Server data collector to collect and store metrics in a management data warehouse. The module concludes with analyzing collected performance data through standard reports included in the data warehouse like disk usage, server activity, and query statistics reports. A lab scenario is also provided where the student will create and configure a management data warehouse to diagnose performance issues.

Uploaded by

Phil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Module 13

Monitoring SQL Server


Module Overview

• Monitoring Activity
• Capturing and Managing Performance Data
• Analyzing Collected Performance Data
Lesson 1: Monitoring Activity

• Overview of Dynamic Management Views and


Functions
• Viewing Activity by Using DMOs
• Demonstration: Using DMOs to View Activity
• Working with Activity Monitor in SQL Server
Management Studio
• Demonstration: Using Activity Monitor in SQL
Server Management Studio
• Working with Performance Monitor
• Working with SQL Server Counters
• Demonstration: Using Performance Monitor
Overview of Dynamic Management Views and
Functions

• DMVs and DMFs return server-state information:


• Can be used to monitor the health of a server instance,
diagnose problems, and tune performance
• Two types:
• Server-scoped—require VIEW SERVER STATE
permission
• Database-scoped—require VIEW DATABASE STATE
permission
• Naming convention categorizes function:
• sys.dm_ SELECT * FROM sys.dm_exec_sessions

• sys.dm_db_log_stats (example 1)
• sys.dm_os_host_info (example 2)

There are 42 in total


Viewing Activity by Using DMOs

• Distributed Management Objects (DMOs) return


two types of information:
• Real-time state information:
SELECT *
FROM sys.dm_exec_sessions AS es
JOIN sys.dm_os_waiting_tasks AS wt
ON wt.session_id = es.session_id
WHERE wt.wait_duration_ms > 3000;

• Recent historical information:


• Counters and metrics aggregated since the database engine
instance last started
Demonstration: Using DMOs to View Activity

In this demonstration, you will see how to:


• Monitor activity on a database engine instance
by using DMOs
Working with Activity Monitor in SQL Server
Management Studio

• Activity Monitor displays:


• Information about SQL Server processes
• Information about how these processes affect the
current instance of SQL Server
• It consists of tabbed panes, each for different
information
• When expanded, panes query the instance for
information
• When collapsed, all queries for that pane stop
• You can rearrange, reorder, and filter pane contents
SQL Activity Monitor
Working with Performance Monitor

• Performance Monitor is available for Windows


Server 2008 rc2, 2012 and 2016
• It provides consolidated monitoring tools
• Data collector sets enable a set of metrics to be
grouped together
• SQL Server-specific Performance Monitor
counters are added when you install SQL Server
Working with SQL Server Counters

• SQL Server provides objects that can be used to


monitor activity
• These have associated counters and statistics
• Counters can have multiple instances of objects if
there are multiple instances of associated
resources
• Some objects can have only one instance
• Performance counters only function on nodes
where SQL Server is running (when clustered)
• Statistics can be displayed for any counter:
• Server statistics only displayed when instance is
running
Lesson 2: Capturing and Managing Performance
Data

• Overview of the Data Collector


• Designing a Data Collection Topology
• Configuring the Data Collector
• Data Collection Security
• Monitoring Data Collector
• Demonstration: Configuring Data Collector
Overview of the Data Collector

• A toolkit for collecting SQL Server performance


information into a single location:
• Simplifies reporting
• Persists DMO data over service restarts
• Is disabled by default

• Data collection sets determine which metrics are


collected:
• System data collection sets are created by default
• User data collection sets can be created

• Data is held in the management data warehouse:


• Standard reports are included
Designing a Data Collection Topology

• Components of data collection:


• Data collector SQL Server Agent jobs
• Management data warehouse
• Rich reports

• Management data warehouse can be configured


in two ways:
• Local configuration for each instance
• A central management data warehouse that stores data
from many servers
Configuring the Data Collector

• Use SSMS wizards to configure:


• The management data warehouse
• Data collection on each SQL Server instance

• Space requirements:
• Allow at least 300 MB per instance for each day
• Customize the retention period to control data growth

• Impact on local systems:


• Should be minimal. If necessary, the frequency of data
collection can be customized, or disabled entirely
Data Collection Security

• Fixed roles for data collection security are created


in the msdb system database
• Management data warehouse fixed roles:
• mdw_admin
• mdw_writer
• mdw_reader

• Data collection fixed roles:


• dc_admin
• dc_operator
• dc_proxy
Monitoring Data Collector

• Manage Data Collection by using one of the


following:
• SQL Server Management Studio
• Transact-SQL stored procedures and functions
Lesson 3: Analyzing Collected Performance Data

• Overview of Data Collector Reports


• Disk Usage Reports
• Demonstration: Viewing the Disk Usage Report
• Server Activity Report
• Demonstration: Viewing the Server Activity Report
• Query Statistics Report
• Demonstration: Viewing the Query Statistics
Report
Overview of Data Collector Reports

• Data Collector reports are historical reports for


each of the system data collection sets
• Reports are accessed by using SQL Server
Management Studio
• A master report gives access to the following
subreports:
• Disk Usage report
• Server Activity report
• Query Statistics report
Disk Usage Reports

• Disk usage summary report:


• Disk usage for database subreport
• Disk usage collection set—database subreport
Server Activity Report

• View resource consumption and server activity


data for the server and for the instance of SQL
Server
• Select time range by using a timeline or calendar
• Use charts to drill through to more detailed
subreports:
• %CPU
• Memory Usage
• Disk I/O Usage
• Network Usage
• SQL Server Waits
• SQL Server Activity
Server Activity History
Server Activity Report
Lab: Monitoring SQL Server

• Exercise 1: Create and configure a Management


Data Warehouse
• Exercise 2: Use the MDW to diagnose performance
issues

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

Estimated Time: 30 minutes


Lab Scenario

Part of your role in your organization is to ensure


that all the companies’ databases are running
smoothly and efficiently. Your manager has had a
complaint from the finance department that some
of their reports have started to run slowly,
especially during their month-end processes.
You have been tasked with ensuring that all the
databases are configured to store performance
data and are able to produce reports to provide
proof that there are no health issues. Your
manager is keen to be notified if during this
process you uncover any issues that need
resolving.
Lab Review

• What are the benefits of using a central data


warehouse for SQL Server performance data,
instead of local collection on each server?
Module Review and Takeaways

• Review Question(s)
• Best Practice

You might also like