Sunteți pe pagina 1din 15

SQL Server

Performance Data Collection &


Analysis
Using
SQLDiag, SQL Nexus and PAL
Ramkumar Gopal
Chennai SQL Server User Group Meet
04-Aug-2012

About me
4 years as a faculty with APTECH
8+ years as a Developer/DBA
Blogging Internals on SQLServerCentral
CTS Academy trainer on Internals/tuning topics
MCTS, MCITP in SQL Server
Working for HCL as Associate Consultant

Agenda
Performance Data Collection Tools and Features
SQLDiag
SQL Nexus
PAL

Performance data
collection
Perfmon

Profiler
DBCC
Task Manager
SSMS Activity Monitor
SSMS Performance Reports
DMVs (Glenn Berry)
Management Data Warehouse
Extended Events
SQLDiag/PSSDiag
SQL Nexus and PAL etc..

SQLDiag
SQLDiag is a data collection utility
SQLNexus and PAL tools can be used to analyze
data collected by the SQLDiag
used by Microsoft Product Support Services
team
Both SQLDiag and PSSDiag tools are similar in
all aspects
SQLDiag is available out of the box in SQL
Server 2005 and all later versions
Configuration XML

SQLDiag what is collects?

Windows Event Logs (Application, System, and Security)


in .CSV files

PerfMon counters in .BLG file/s

SQL Server Profiler traces in .TRC file/s

SQL Server Blocking chains in a _BLK.TRC file

SQL Server error logs, configuration, point-in-time


snapshots of several DMVs in a .OUT file

System information via the Msinfo32 utility in a .TXT file

SQLDiag - Scenarios

Intermittent CPU spikes on the SQL Server box

Performance degradation during specific duration

Troubleshooting Blocking chains in SQL Server

Analyzing overall performance bottlenecks in SQL Server


using wait statistics

Identifying top queries by CPU, Duration, Reads and Writes


during a specific timeframe (say between 9:00 AM and 5:00
PM)

Top databases and logins consuming maximum CPU and IO

Troubleshooting performance issues with a batch job

SQLDiag - parameters

http://msdn.microsoft.com/en-us/library/ms162833.a

SQLDiag - Examples

SQLDiag

SQLDiag /B +01:00:00 /E +03:00:00

sqldiag /B +00:01:00 /E +00:02:00


/od:\PerfData

Data collected by SQLDiag


-> Errorlogs
-> sp_configure
-> sp_who
-> sp_lock
-> xp_msver
-> sysprocesses
-> sysdatabases
-> sys.master_files
-> Stats for currently running queries
-> Head blockers
-> SELECT @@version:
-> SQL Server name
(@@SERVERNAME):
->
sys.dm_tran_database_transactions
-> sys.dm_os_cluster_nodes
-> sys.dm_db_session_space_usage

->
->
->
->
->
->
->
->
->
->
->
->
->

sys.dm_tran_active_transactions
sys.dm_os_sys_info
sys.dm_os_threads
sys.dm_os_workers
sys.dm_os_tasks
sys.dm_io_pending_io_requests
sys.dm_io_virtual_file_stats
sys.dm_os_latch_stats
sys.dm_os_latch_stats
sys.dm_os_memory_clerks
sys.dm_os_wait_stats
sys.dm_os_waiting_tasks
sysperfinfo snapshot #1

SQL Nexus
Prerequesties:
Report Viewer 2008 Redistributable
http://www.microsoft.com/en-us/download/details.aspx?id=3841
RML Utilities
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=7EDFA95AA32F-440F-A3A8-5160C8DBE926&displaylang=en
PerfStat Scripts
http://sqlnexus.codeplex.com/wiki/PageInfo?title=Sql2005PerfStatsScript
Run StartSQLDiagTrace200[x].cmd in Command prompt (SQLDiag)
SQL Nexus Tool
http://sqlnexus.codeplex.com/

SQL Nexus Reports


Import, Reports and Export

PAL (Performance Analysis of


Logs)
Prerequesite:
Microsoft Chart Control
http://www.microsoft.com/en-us/download/details.aspx?id=14422
PAL Tool download
http://pal.codeplex.com/

PAL Wizard
Input .blg file (Perfmon counter values against known threshold)

Reference

http://blogs.msdn.com/b/pamitt/archive/2011/02/25/howto-use-the-sqldiag-the-sqlnexus-and-the-pal-tools-to-a
nalyze-performance-issues-in-sql-server.aspx
http://msdn.microsoft.com/en-us/library/ms162833.asp
x
http://pal.codeplex.com/
http://sqlnexus.codeplex.com/wiki/PageInfo?title=Sql20
05PerfStatsScript
http://sqltwist.com/archives/138

S-ar putea să vă placă și