Gather SQL Server Performance Data with PowerShell

Slides:



Advertisements
Similar presentations
SQL Server 2012 New Performance Tuning Tools. Who am I? Menzo Steinhorst Senior Premier Field Engineer SQLRAP, WS+ SQL Server Performance Tuning, WS+
Advertisements

How to Perform a SQL Server Health Check
SQL Server Wait Statistics Capture, Report, Analyse Rob Risetto Principal Consultant with StrataDB
Automating SQL Buildouts With Hyper-V and SQL Server 2008 R2 Robert L Davis, Sr. DBA, Microsoft Corp.
James Boother Blog: INTRODUCTION TO POWERSHELL.
The Dirty Dozen: PowerShell Scripts for the Busy DBA DBA-237 Aaron
Social Computing for the Database Professional Jason Massie, Terremark Brent Ozar, Quest Software.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 11: Monitoring Server Performance.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
Chapter 11 - Monitoring Server Performance1 Ch. 11 – Monitoring Server Performance MIS 431 – created Spring 2006.
Managing a “0 Downtime” Shop Session Code Session Title About Me 15 years as a DBA (Wells Fargo, Anthem, Yellow Pages, Pulte…) SQL.
Utility Database Chris
Introduction Paul Turley SqlServerBiBlog.com Mentor, SQL Server MVP
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
© Wiley Inc All Rights Reserved. MCSE: Windows Server 2003 Active Directory Planning, Implementation, and Maintenance Study Guide, Second Edition.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
Allen White UpSearch Technology Services SQL Server MVP SESSION CODE: DAT306 Gather SQL Server Performance Data with PowerShell.
Agenda for Today Do Chapter 14 Final Project Review for Final.
Performance Dash A free tool from Microsoft that provides some quick real time information about the status of your SQL Servers.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
BizTalk Throttling & Thresholds
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Perfmon and Profiler 101.
SQLRX – SQL Server Administration – Tips From the Trenches SQL Server Administration – Tips From the Trenches Troubleshooting Reports of Sudden Slowdowns.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
Sofia, Bulgaria | 9-10 October The Query Governor Richard Campbell Stephen Forte Richard Campbell Stephen Forte.
Enterprise Database Administration & Deployment SIG ▪ 313M ▪ Sept 29, 2005 ▪ 10:15 AM SQL Server 2005 Performance Diagnosis and Tuning using SQL Tools.
October 11-14, Seattle, WA Top 10 Ways To Break Your Deployments Or: How to Avoid Your Sorry Fate Dev Nambi Senior Software Engineer Microsoft.
1 Chapter Overview Monitoring Access to Shared Folders Creating and Sharing Local and Remote Folders Monitoring Network Users Using Offline Folders and.
ObjectCounterLook For Processor% Processor Time
Distributed Replay Testing With Your Data, Your Way! ca.linkedin.com/in/melodyzacharias.
Diagnosing Performance with Wait Statistics Robert L Davis Principal Database
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
Perfmon Basics Rick Heiges, SQL Server MVP.  Our Sponsors  Our Venue  SQLPASS NYC Chapter  Volunteers for SQL Saturday #380  Our Speakers Thank You.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
No more waiting. Sponsors About me  Database Technology Specialist  MVP  Blogger  Author 3
Load Testing with SQL Server Tools Neil Hambly SQL Server Practice Lead Northdoor PLC.
10 Things All BI Administrators Should Know Robert L Davis Database Engineer
AX Performance Tools Present and Future
An introduction to Wait Statistics
Benchmarking like a PRO
W04 Connecting 3rd Party Application to ODBC
Benchmarking the forgotten Role of Performance Tuning
Query Performance Tuning: Start to Finish
DBA and IT Professional for ~9 years. Currently I am a Data Architect
SQL Server Monitoring Overview
Rick Heiges, SQL Server MVP
Summit Nashville /28/2018 8:42 PM
SQL Server & PowerShell
Visual Studio 2010 Database Projects
Where to Start, What You Need
Simplifying XEvents Management with dbatools
DevOps Database Administration
Auditing in SQL Server 2008 DBA-364-M
Troubleshooting SQL Server Basics
SQLSaturday 393- May 16, Redmond, WA
Getting To Know Your Indexes
DevOps Database Administration
Azure SQL Database - Managing your database on the cloud
DBA for ~4+years, IT Professional for 7.5 years.
Targeting Wait Statistics with Extended Events
SQL Server Management Studio Tips and Tricks
Governing Your Enterprise with Policy-Based Management
Advanced Dashboard Creation with PerformancePoint Services 2010
Using wait stats to determine why my server is slow
SharePoint 2013 Best Practices
The DBA Quit and now you’re it:
Presentation transcript:

Gather SQL Server Performance Data with PowerShell Allen White SQL Server MVP

About Me SQL Server Consultant with Upsearch Over 35 years in IT Career covered multiple disciplines – operations, development, telecommunications, network design/administration and database design and administration Started using Sybase in 1992, MS SQL Server in 1995 Microsoft Certified IT Professional: Database Administrator and Database Developer, Microsoft Certified Trainer (MCT) Awarded Microsoft MVP Award for SQL Server for last 3 years DBA-451 Gather SQL Server Performance Data with PowerShell

Wednesday 11:30 Spotlight Theater 53 MVPs Coalesce Book Launch at PASS 2009 Wednesday 11:30 Spotlight Theater www.SQLServerMVPDeepDives.com

Agenda Performance Counters Capture Options PowerShell Script Performance Analysis Report DBA-451 Gather SQL Server Performance Data with PowerShell

Goal - Capture Performance Baseline Baseline shows normal performance Deviations from Baseline require investigation Problem Data comes from disparate sources Coordination of multiple gathering tools Synchronizing data for true baseline analysis Solution PowerShell DBA-451 Gather SQL Server Performance Data with PowerShell

Key Performance Indicators Which counters show us system health There’s no “right” answer These are my choices DBA-451 Gather SQL Server Performance Data with PowerShell

Operating System Counters Object Counter Look For Processor % Processor Time <= 80% Memory Available MBytes Low Memory, Server Paging Paging File(_Total) % Usage Should be < 70% PhysicalDisk(*) Disk Reads/sec Baseline, watch for unusual variations Disk Writes/sec System Processor Queue Length > 10 threads/proc and CPU > 80% DBA-451 Gather SQL Server Performance Data with PowerShell

SQL Server Counters Object Counter Look For Access Methods Forwarded Records/sec < 10 per 100 batch requests/sec Page Splits/sec <20 per 100 batch requests/sec Buffer Manager Buffer cache hit ratio below 90% is bad Page life expectancy >=300 General Statistics Processes blocked Baseline, check for changes SQL Statistics Batch Requests/sec > 1000 is busy system SQL Compilations/sec <10% of batch requests/sec SQL Re-Compilations/sec <10% of compilations/sec DBA-451 Gather SQL Server Performance Data with PowerShell

Sources for Performance Data Perfmon Save data to .CSV Use SSIS or PowerShell to import results DMVs Great source of SQL Server data sys.dm_os_performance_counters Only returns SQL Server current instance counters WMI Allows access to all aspects of server Crunching the numbers can be tricky DBA-451 Gather SQL Server Performance Data with PowerShell

Performance Data in PowerShell Get-Counter cmdlet (PowerShell 2.0) Invocation sets own interval handler System.Diagnostics.PerformanceCounter Support directly within .NET Results directly match Perfmon values Accessible from PowerShell Demo DBA-451 Gather SQL Server Performance Data with PowerShell

Performance Database Every Admin should have one Store Baseline Data Store Server Side Trace info Store Server and Instance info Keep all management info in one place DBA-451 Gather SQL Server Performance Data with PowerShell

Scripting the Data Capture Capture the counter data Insert into Performance Database Wait defined interval and do it again # Initialize Perfcounters $ppt = new-object System.Diagnostics.PerformanceCounter $ppt.CategoryName = 'Processor' $ppt.CounterName = '% Processor Time' $ppt.InstanceName = '_Total' $pptv = $ppt.nextvalue() DBA-451 Gather SQL Server Performance Data with PowerShell

Logic Flow for getperf.ps1 DBA-451 Gather SQL Server Performance Data with PowerShell

Demo getperf.ps1 DBA-451 Gather SQL Server Performance Data with PowerShell

Creating the Analysis Reports Create Basic Report Add Table for Counter Data Add Graphs to see Trends Demo DBA-451 Gather SQL Server Performance Data with PowerShell

Define Attention Levels Once Baseline is understood Define deviation amount for warning Define deviation amount for error condition Build notification mechanisms If warning send email If error send text message Add Dashboard Report to SSMS Demo DBA-451 Gather SQL Server Performance Data with PowerShell

References Master-PowerShell | With Dr. Tobias Weltner http://powershell.com/cs/blogs/ebook/default.aspx Let PowerShell do an Inventory of your Servers http://www.simple-talk.com/sql/database- administration/let-powershell-do-an-inventory-of- your-servers/ Initialize-SqlpsEnvironment.ps1 script http://blogs.msdn.com/mwories/archive/2008/06/14/ SQL2008_5F00_Powershell.aspx Midnight DBA – PowerShell webcasts http://midnightdba.itbookworm.com/ DBA-451 Gather SQL Server Performance Data with PowerShell

Complete the Evaluation Form & Win! You could win a Dell Mini Netbook – every day – just for handing in your completed form! Each session form is another chance to win! Pick up your Evaluation Form: Within each presentation room At the PASS Booth near registration area Drop off your completed Form: Near the exit of each presentation room Sponsored by Dell DBA-451 Gather SQL Server Performance Data with PowerShell

for attending this session and the 2009 PASS Summit in Seattle Thank you for attending this session and the 2009 PASS Summit in Seattle