SlideShare una empresa de Scribd logo
1 de 45
END-TO-END
TROUBLESHOOTING CHECKLIST
FOR MICROSOFT SQL SERVER
Kevin Kline
• Director of Engineering Services, SQL Sentry
• SQL Server MVP since 2003
• Social media at @KEKline
• Blog: http://blogs.sqlsentry.com/KevinKline
Tuning blog: http://www.sqlperformance.com/
E-mail ebooks@sqlsentry.com for free copies of our e-books:
AGENDA
• Methodology for troubleshooting
• Troubleshooting tools and techniques using the native SQL
Server tool kit:
o Wait Stats
o Windows Performance Monitor (PerfMon)
o SQL Profiler, Server-Side Traces, and XEvents
o SQL Server DMVs
o Execution Plans
• Summary, Resources, and Q&A
WHERE TO BEGIN?
• There’s not a “right” or
“wrong” place to start.
You can start at any of
the points shown above.
• Start with the information
source that provides the
actionable information
most quickly
Error Logs
PerfMon
DMVs
Profiler &
Trace
SSMS
(Execution
Plan)
METHODOLOGY
• Effective troubleshooting
is like a funnel or series of
continuously more refined
sieves.
• Each successive sieve
filters out smaller
“chunks”; that is, harder
and more transient errors
and problems
• More work is required…
Identification & Resolution
Specific
SQL
Cmds
Resource
issues
Errors in
the log
TROUBLESHOOTING CHECKLIST
Shortcut! Has anything changed?
Inside or outside of SQL Server?
Is the issue caused by a SQL Server error?
Are there excessive wait stats?
Correlate wait stats against other metrics.
Follow-up
1.
2.
3.
4.
5.
6.
YOUR BEST SHORTCUT
Your best shortcut? Know what has changed!
• Sp_Configure or sys.configurations
• Sp_Dboption (pre-SQL2012) or sys.databases
(SQL2012 +)
• DDL triggers for meta-data changes:
o Developers?
o Unfettered access to databases?
Remember: Change = Risk
ERROR LOGS
• Windows Application helps eliminate non-SQL Server
problems
• SQL Server Error Log and SQL Server Agent Log
o Available both as TXT and through the GUI
o SQL Server keeps the six most recent, incrementing with each reboot
• WARNING! Always make sure to enable SQL Server
Agent notifications for severity level 18 or greater!
ACTING UPON ERROR LOGS
• No further research required
o Error found with easy fix
o Error found with difficult fix or restore required
• Further research required
o Error found, but time or symptoms of error do not correlate to the problem
o No error found
DEMO
• Error Notification
DEMO OF ERROR NOTIFICATIONS IN SSMS
ADVANCED ERROR NOTIFICATION IN SSMS
• Error notification can be
difficult with lots of SQL
Servers.
• Ease the pain by setting up
Event Forwarding under the
Advanced properties of the
SQL Server Agent.
• All events from remote servers
are forwarded to one (or more)
central servers.
• Now, only one instance of
SQLMail/DBMail are needed in
your environment.
ROCKS, GRAVEL, OR SAND
• We retrieved the top level
information, “the big
rocks”
• Now, what’s the best way
to go deeper?
WAIT STATS: IT’S ALL ABOUT
BOTTLENECKS!
• Anytime a task in SQL Server waits for something:
o It is reported as a wait type
o Reveals where the bottlenecks are
• SQL Server 2005 aggregates wait type information
• SQL Server 2008 provides new pre-emptive wait stats
SCHEDULERS & WAIT STATS
• 1 Window = 1 Scheduler
• Users are assigned
to a thread
Uh oh!
The out
of soda!
No problem. Step
aside… More syrup
for the sodas!
Goes to the waiting or
“suspended” queue
Yeah!
I’m next
in line!
WAITS BY TASK
• sys.dm_os_waiting_tasks
• Wait information
• Task level
• Very accurate
• Transient data
BUFFER AND TRANSACTION BOTTLENECKS
• PAGELATCH_xx and LATCH_xx
• PAGEIOLATCH_xx usually come from contention on the
buffer pool
• LATCH_xx commonly arise from contention on
resources other than buffer pool, especially due to heaps
or text data types
• LCK_xx arise from lots of locks and blocks, perhaps by
overlong transactions or improperly indexed tables or
poorly configured hardware
CPU BOTTLENECKS
• SOS_SCHEDULER_YIELD
Yielding processor time
• CXPACKET
• Query parallelism due to splitting
and merging overhead
IO BOTTLENECKS
• WRITELOG
• Writing transactions to the log on disk
• PAGEIOLATCH_xx
• Represent memory-to-disk transfers
• IO_COMPLETION
• Awaiting I/O task completion
EXTERNAL BOTTLENECKS
• OLEDB
• Wait on the OLEDB provider
o Full-Text Search
o Lots of linked servers
• NETWORKIO
• Often poor client response, in addition to physical
networking
OTHER BOTTLENECKS
• SLEEP_BPOOL_FLUSH
• Checkpoint IO throttling
• RESOURCE_SEMAPHORE_QUERY_CO
MPILE
• Throttling query compilations
• Compilations, re-compilations, non-
cacheable plans
• RESOURCE_SEMAPHORE
• Waiting for a memory grant
ARE THESE BOTTLENECKS?
• WAITFOR
• T-SQL WAITFOR command
• SQLTRACE_BUFFER_FLUSH
• Default trace
• LAZYWRITER_SLEEP
• System process waiting to start
TOP 10 WAITS FROM THE FIELD
CPU PRESSURE
• CPU pressure:
SOS_SCHEDULER_YIELD
• Parallelism: CXPACKET
LOCKING
• Long term blocking: LCK_X, LCK_M_U,
& LCK_M_X
MEMORY
• Buffer latch: PAGELATCH_X
• Non-buffer latch: LATCH_X
• Memory grants:
RESOURCE_SEMAPHORE
I/O
• Buffer I/O latch: PAGEIOLATCH_X
• Tran log disk subsystem: WRITELOG &
LOGBUFFER
• General I/O issues:
ASYNC_IO_COMPLETION &
IO_COMPLETION
NETWORK PRESSURE
• Network I/O: ASYNC_NETWORK_IO
CORRELATING PERF INFORMATION
• With wait stats, other older standbys are not as frequently
needed.
o But they still help!
• PerfMon
• Xevents and Traces (either Profiler or Server-side)
• DMVs
PERFMON
• Benefits: Shows the rate of resource consumption or
activity in a wide variety of areas on the server, for
example
o Disk IO; Memory; Network
o SQL Server activity - Locking, Blocking, and Deadlocking;
Cache Activity; Object Utilization
• Limitations
o Very hard to know what to track and what values indicate
good or bad performance
o Doesn’t offer good root-cause analysis, only resource
consumption info
WINDOWS PERFORMANCE MONITOR
OS PERFMON COUNTERS
Object Counter Value Notes
Paging $Usage <70% Amount of page file currently in use
Processor % Processor Time <= 80%
The higher it is, the more likely users are
delayed.
Processor % Privilege Time
<30% of %
Processor
Time
Amount of time spent executing kernel
commands like SQL Server IO requests.
Process(sqlservr)
Process (msmdsrv)
% Processor Time < 80%
Percentage of elapsed time spent on SQL Server
and Analysis Server process threads.
System
Processor Queue
Length
< 4
< 12 per CPU is good/fair, < 8 is better, < 4 is
best
IO AND MEM PERFMON COUNTERS
Object Counter Value Notes
Physical Disk Avg Disk Reads/sec < 8
> 20 is poor, <20 is good/fair, <12 is better, <8
is best
Physical Disk Avg Disk Writes/sec < 8 or <1
Without cache: > 20 poor, <20 fair, <12 better,
<8 best.
With cache > 4 poor, <4 fair, <2 better, <1 best
Memory Available Mbytes >100
Amount of physical memory available to run
processes on the machine
SQL Server: Memory
Manager
Memory Grants
Pending
~0
Current number of processes waiting for a
workspace memory grant.
SQL Server: Buffer
Manager
Free List Stalls/sec < 2
Frequency that requests for db buffer pages
are suspended because there are no buffers.
RED FLAG PERFMON COUNTERS
Object Counter Value Notes
:Access Methods Forwarded Records/sec <10*
Tables with records traversed by a pointer. Should
be < 10 per 100 batch requests/sec.
:Access Methods Page Splits/sec <20*
Number of 8k pages that filled and split into two
new pages. Should be <20 per 100 batch
requests/sec.
:Databases
Log Growths/sec;
Percent Log used
< 1 and
<80%, resp
Don’t let transaction log growth happen randomly!
:SQL Statistics Batch Requests/sec *
No firm number without benchmarking, but > 1000
is a very busy system.
:SQL Statistics
Compilations/sec;Reco
mpilations/sec
*
Compilations should be <10% of batch
requests/sec; Recompilations should be <10% of
compilations/sec
:Locks Deadlocks/sec < 1 Nbr of lock requests that caused a deadlock.
PROFILER / XEVENTS
• Monitors SQL Server for the occurrence of events
• When an event fires, Profiler logs the event and
information about it
• Useful for:
o Finding and diagnosing slow-running code.
o Capturing the series of SQL statements
that lead to a problem
o Replaying and reproducing a problem on a test machine
• Doesn’t offer resource consumption info,
just granular details
SERVER-SIDE TRACES
• Warning! Profiler can be overwhelmed by a high
throughput system!
• Server-side traces happen entirely on the server (no
client GUI) and are controlled using stored procedures
• Useful for “auto-start” logging and high performance
scenarios
• TIP! Profiler can be used to create a server-side trace.
That means no procedures to learn.
DEMO
• Correlating PerfMon and Profiler
Information
DEMO OF SQL PROFILER
• 1: Invoke SQL Profiler
• 2: Choose a template,
Standard is usually ok.
• 3: Choose your Events
from the Events Selection
tab.
• 4: Click RUN to begin the
trace.
• 5: Click STOP to end the
trace and write it to a file.
CORRELATING PERFMON AND TRACE DATA
1. After collecting a PerfMon and Profiler trace file, load the Profiler file using
File  Open  Trace File.
2. Choose File  Import Performance Data to load in the PerfMon trace file.
3. Choose the PerfMon counters to show on your analysis screen.
4. You’ll then have the overlay of PerfMon & Profiler data as shown on the
right.
5. You can click anywhere on the timeline to see what was happening at that
point in time.
DYNAMIC MANAGEMENT VIEWS (DMV)
• Tell exactly what’s happening at present inside of SQL
Server
• Multitude of DMVs, which can tell things like:
o What are the top 10 most CPU-intensive queries?
o What are the 5 biggest objects in cache?
o Which objects get the most IO?
o Which users consume the most resources?
• DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR);
ESSENTIAL DMVS
Performance & Wait Stats
• Sys.dm_os_wait_stats
• Sys.dm_os_performance_counters
• Sys.dm_os_waiting_tasks
I/O
• Sys.dm_io_virtual_file_stats
• Sys.dm_io_pending_io_requests
Transactions
• Sys.dm_tran_lock
• Sys.dm_db_index_operational_stats
• Sys.dm_db_index_usage_stats
SPID Activity & SQL Statements
• Sys.dm_os_exec_requests
• Sys.dm_exec_requests
• Sys.dm_exec_query_stats
• Sys.dm_exec{procedure | trigger}_stats
Why code it yourself? Get Glenn Berry’s latest scripts at
http://sqlserverperformance.wordpress.com/category/diagnostic-queries/
1. Inside or Outside of MSSQL?
Check Windows Server
logs. Resolve any errors
and recheck.
2. Caused by an MSSQL or SQLAgent error?
Check SQL Server and SQL
Agent logs. Resolve any
errors and recheck.
3. Excessive wait stats?
Assess wait statistics to
categorize the bottleneck
using sys.dm_wait_stats.
4. Wait stats correlate to specific
sessions or components?
Assess session wait stats
using sys.dm_waiting_tasks.
Resolve problematic user
activity or process.
Assess other problem areas
using other DMVs, like
dm.os_performance_counters.
Resolve system
misconfiguration, design
problem, or resource
shortage.
SQL SERVER MANAGEMENT STUDIO
• Once the root-problem is revealed, you still have to fix it.
• Common resolutions using SSMS include:
o Debug a SQL Server procedure or function
o Tune one or more SQL statements
o Add or alter indexes
• Tuning SQL code can be difficult unless you know how to
read an execution plan:
o SQL Sentry Plan Explorer is FREE!
EXECUTION PLANS
• Explain plans tell you all the internal steps that the SQL
Server takes to complete the action
• Read graphic explain plans from right to left. (Textual
ones from bottom to top)
• Graphic plans use icons to represent actions, while
arrows represent data flows
DEMO
• Reading Basic Execution Plans
EXECUTION PLANS
FIXING BAD CODE IN SSMS
• Fixing bad code is an exercise in experimentation
o Lots of tips & tricks to try
o Check out our tuning content at http://sqlsentry.tv
• Figure out the work done in the code, then try a new
version that might improve it:
o Different search arguments in the WHERE or JOIN clauses to make better use of
indexes
o Use an alternative pattern
o Apply a different locking strategy
o Use a query hint
• Clear you caches, then rewrite, test, repeat…
SUMMARY
PROBLEMS
• Adam Machanic’s sp_whoisactive
• Brent Ozar’s sp_askBrent, sp_blitz
• Extended events – Jonathan Kehayias
• DMVs – Glenn Berry’s diagnostic queries
• System info: dm_os_performance_counters, dm_os_wait_stats
• Query info: dm_exec_requests, dm_exec_query_stats
• Plans: dm_exec_query_plan, dm_exec_plan_attributes
• Cache/buffer pool: dm_exec_cached_plans, dm_os_buffer_descriptors
• Index info: dm_db_index_usage_stats, dm_io_virtual_file_stats
THANK YOU!
• Performance tuning blog at http://SQLPerformance.com.
• Videos at http://SQLSentry.TV
• E-mail ebooks@sqlsentry.com for free copies of our e-books:
o Just tell them where you met me

Más contenido relacionado

La actualidad más candente

SQL Server Profiler & Performance Monitor - SarabPreet Singh
SQL Server Profiler & Performance Monitor - SarabPreet SinghSQL Server Profiler & Performance Monitor - SarabPreet Singh
SQL Server Profiler & Performance Monitor - SarabPreet SinghRishu Mehra
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsTuyen Vuong
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuningSimon Huang
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsEnkitec
 
Physical architecture of sql server
Physical architecture of sql serverPhysical architecture of sql server
Physical architecture of sql serverDivya Sharma
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the TradeCarlos Sierra
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuningGuy Harrison
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsZohar Elkayam
 
Mvcc (oracle, innodb, postgres)
Mvcc (oracle, innodb, postgres)Mvcc (oracle, innodb, postgres)
Mvcc (oracle, innodb, postgres)frogd
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTanel Poder
 
Partitioning tables and indexing them
Partitioning tables and indexing them Partitioning tables and indexing them
Partitioning tables and indexing them Hemant K Chitale
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slidesmetsarin
 
Oracle Flex ASM - What’s New and Best Practices by Jim Williams
Oracle Flex ASM - What’s New and Best Practices by Jim WilliamsOracle Flex ASM - What’s New and Best Practices by Jim Williams
Oracle Flex ASM - What’s New and Best Practices by Jim WilliamsMarkus Michalewicz
 
Sql server troubleshooting
Sql server troubleshootingSql server troubleshooting
Sql server troubleshootingNathan Winters
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningScott Jenner
 
Oracle architecture ppt
Oracle architecture pptOracle architecture ppt
Oracle architecture pptDeepak Shetty
 
Part1 of SQL Tuning Workshop - Understanding the Optimizer
Part1 of SQL Tuning Workshop - Understanding the OptimizerPart1 of SQL Tuning Workshop - Understanding the Optimizer
Part1 of SQL Tuning Workshop - Understanding the OptimizerMaria Colgan
 

La actualidad más candente (20)

SQL Server Profiler & Performance Monitor - SarabPreet Singh
SQL Server Profiler & Performance Monitor - SarabPreet SinghSQL Server Profiler & Performance Monitor - SarabPreet Singh
SQL Server Profiler & Performance Monitor - SarabPreet Singh
 
MySQL Atchitecture and Concepts
MySQL Atchitecture and ConceptsMySQL Atchitecture and Concepts
MySQL Atchitecture and Concepts
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools short
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
 
Lecture2 oracle ppt
Lecture2 oracle pptLecture2 oracle ppt
Lecture2 oracle ppt
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
Physical architecture of sql server
Physical architecture of sql serverPhysical architecture of sql server
Physical architecture of sql server
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuning
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
Mvcc (oracle, innodb, postgres)
Mvcc (oracle, innodb, postgres)Mvcc (oracle, innodb, postgres)
Mvcc (oracle, innodb, postgres)
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
 
Partitioning tables and indexing them
Partitioning tables and indexing them Partitioning tables and indexing them
Partitioning tables and indexing them
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
Oracle Flex ASM - What’s New and Best Practices by Jim Williams
Oracle Flex ASM - What’s New and Best Practices by Jim WilliamsOracle Flex ASM - What’s New and Best Practices by Jim Williams
Oracle Flex ASM - What’s New and Best Practices by Jim Williams
 
Sql server troubleshooting
Sql server troubleshootingSql server troubleshooting
Sql server troubleshooting
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
 
Oracle architecture ppt
Oracle architecture pptOracle architecture ppt
Oracle architecture ppt
 
Part1 of SQL Tuning Workshop - Understanding the Optimizer
Part1 of SQL Tuning Workshop - Understanding the OptimizerPart1 of SQL Tuning Workshop - Understanding the Optimizer
Part1 of SQL Tuning Workshop - Understanding the Optimizer
 

Destacado

Top 10 DBA Mistakes on Microsoft SQL Server
Top 10 DBA Mistakes on Microsoft SQL ServerTop 10 DBA Mistakes on Microsoft SQL Server
Top 10 DBA Mistakes on Microsoft SQL ServerKevin Kline
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 
Reduce latency and boost sql server io performance
Reduce latency and boost sql server io performanceReduce latency and boost sql server io performance
Reduce latency and boost sql server io performanceKevin Kline
 
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerMarek Maśko
 
Convince me – persuasion techniques that get things done
Convince me – persuasion techniques that get things doneConvince me – persuasion techniques that get things done
Convince me – persuasion techniques that get things doneKevin Kline
 
Who wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesWho wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesKevin Kline
 
Performance Monitoring And Tuning In Sql Server 2008 Tsql
Performance Monitoring And Tuning In Sql Server 2008 TsqlPerformance Monitoring And Tuning In Sql Server 2008 Tsql
Performance Monitoring And Tuning In Sql Server 2008 Tsqlcoolajju143
 
Паралельний імпорт: економіко-правові аспекти регулювання
Паралельний імпорт: економіко-правові аспекти регулюванняПаралельний імпорт: економіко-правові аспекти регулювання
Паралельний імпорт: економіко-правові аспекти регулюванняnadeh
 
SQL Server 2016 Query store
SQL Server 2016 Query storeSQL Server 2016 Query store
SQL Server 2016 Query storeVitaliy Popovych
 
Understanding and preventing sql injection attacks
Understanding and preventing sql injection attacksUnderstanding and preventing sql injection attacks
Understanding and preventing sql injection attacksKevin Kline
 
SQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceSQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceVinod Kumar
 
Why & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryWhy & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryAntonios Chatzipavlis
 
SQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeSQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeDean Richards
 
Sql architecture
Sql architectureSql architecture
Sql architecturerchakra
 
SQL Server - Using Tools to Analyze Query Performance
SQL Server - Using Tools to Analyze Query PerformanceSQL Server - Using Tools to Analyze Query Performance
SQL Server - Using Tools to Analyze Query PerformanceMarek Maśko
 
SQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataSQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataMarek Maśko
 
SQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database PerformanceSQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database PerformanceMark Ginnebaugh
 
Microsoft sql server architecture
Microsoft sql server architectureMicrosoft sql server architecture
Microsoft sql server architectureNaveen Boda
 
Performance tuning and optimization (ppt)
Performance tuning and optimization (ppt)Performance tuning and optimization (ppt)
Performance tuning and optimization (ppt)Harish Chand
 

Destacado (20)

Top 10 DBA Mistakes on Microsoft SQL Server
Top 10 DBA Mistakes on Microsoft SQL ServerTop 10 DBA Mistakes on Microsoft SQL Server
Top 10 DBA Mistakes on Microsoft SQL Server
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
Reduce latency and boost sql server io performance
Reduce latency and boost sql server io performanceReduce latency and boost sql server io performance
Reduce latency and boost sql server io performance
 
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
 
Convince me – persuasion techniques that get things done
Convince me – persuasion techniques that get things doneConvince me – persuasion techniques that get things done
Convince me – persuasion techniques that get things done
 
Who wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesWho wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and Responsibilities
 
Performance Monitoring And Tuning In Sql Server 2008 Tsql
Performance Monitoring And Tuning In Sql Server 2008 TsqlPerformance Monitoring And Tuning In Sql Server 2008 Tsql
Performance Monitoring And Tuning In Sql Server 2008 Tsql
 
Паралельний імпорт: економіко-правові аспекти регулювання
Паралельний імпорт: економіко-правові аспекти регулюванняПаралельний імпорт: економіко-правові аспекти регулювання
Паралельний імпорт: економіко-правові аспекти регулювання
 
SQL Server 2016 Query store
SQL Server 2016 Query storeSQL Server 2016 Query store
SQL Server 2016 Query store
 
Understanding and preventing sql injection attacks
Understanding and preventing sql injection attacksUnderstanding and preventing sql injection attacks
Understanding and preventing sql injection attacks
 
SQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceSQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query Performance
 
Troubleshooting sql server
Troubleshooting sql serverTroubleshooting sql server
Troubleshooting sql server
 
Why & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryWhy & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to query
 
SQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeSQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First Time
 
Sql architecture
Sql architectureSql architecture
Sql architecture
 
SQL Server - Using Tools to Analyze Query Performance
SQL Server - Using Tools to Analyze Query PerformanceSQL Server - Using Tools to Analyze Query Performance
SQL Server - Using Tools to Analyze Query Performance
 
SQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML DataSQL Server - Querying and Managing XML Data
SQL Server - Querying and Managing XML Data
 
SQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database PerformanceSQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database Performance
 
Microsoft sql server architecture
Microsoft sql server architectureMicrosoft sql server architecture
Microsoft sql server architecture
 
Performance tuning and optimization (ppt)
Performance tuning and optimization (ppt)Performance tuning and optimization (ppt)
Performance tuning and optimization (ppt)
 

Similar a End-to-end Troubleshooting Checklist for Microsoft SQL Server

SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1sqlserver.co.il
 
SQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowSQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowDean Richards
 
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...rschuppe
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSPC Adriatics
 
Monitoring sql server
Monitoring sql serverMonitoring sql server
Monitoring sql serverJohn Martin
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACKristofferson A
 
Analyzing and Interpreting AWR
Analyzing and Interpreting AWRAnalyzing and Interpreting AWR
Analyzing and Interpreting AWRpasalapudi
 
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...LarryZaman
 
Progress OE performance management
Progress OE performance managementProgress OE performance management
Progress OE performance managementYassine MOALLA
 
Progress Openedge performance management
Progress Openedge performance managementProgress Openedge performance management
Progress Openedge performance managementYassine MOALLA
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingSveta Smirnova
 
Cognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksCognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksSenturus
 
Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502kaziul Islam Bulbul
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyAntonios Chatzipavlis
 
Common SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim RadneyCommon SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim RadneyEmbarcadero Technologies
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelDaniel Coupal
 
Improving Batch-Process Testing Techniques with a Domain-Specific Language
Improving Batch-Process Testing Techniques with a Domain-Specific LanguageImproving Batch-Process Testing Techniques with a Domain-Specific Language
Improving Batch-Process Testing Techniques with a Domain-Specific LanguageDr. Spock
 
collab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdfcollab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdfElboulmaniMohamed
 

Similar a End-to-end Troubleshooting Checklist for Microsoft SQL Server (20)

SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
SQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowSQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should Know
 
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
Application Performance Troubleshooting 1x1 - Part 2 - Noch mehr Schweine und...
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Monitoring sql server
Monitoring sql serverMonitoring sql server
Monitoring sql server
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
 
Analyzing and Interpreting AWR
Analyzing and Interpreting AWRAnalyzing and Interpreting AWR
Analyzing and Interpreting AWR
 
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
 
Progress OE performance management
Progress OE performance managementProgress OE performance management
Progress OE performance management
 
Progress Openedge performance management
Progress Openedge performance managementProgress Openedge performance management
Progress Openedge performance management
 
Performance Schema for MySQL Troubleshooting
Performance Schema for MySQL TroubleshootingPerformance Schema for MySQL Troubleshooting
Performance Schema for MySQL Troubleshooting
 
Cognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & TricksCognos Performance Tuning Tips & Tricks
Cognos Performance Tuning Tips & Tricks
 
Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctly
 
Breaking data
Breaking dataBreaking data
Breaking data
 
Common SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim RadneyCommon SQL Server Mistakes and How to Avoid Them with Tim Radney
Common SQL Server Mistakes and How to Avoid Them with Tim Radney
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
 
Improving Batch-Process Testing Techniques with a Domain-Specific Language
Improving Batch-Process Testing Techniques with a Domain-Specific LanguageImproving Batch-Process Testing Techniques with a Domain-Specific Language
Improving Batch-Process Testing Techniques with a Domain-Specific Language
 
collab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdfcollab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdf
 

Último

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Último (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

End-to-end Troubleshooting Checklist for Microsoft SQL Server

  • 1. END-TO-END TROUBLESHOOTING CHECKLIST FOR MICROSOFT SQL SERVER Kevin Kline • Director of Engineering Services, SQL Sentry • SQL Server MVP since 2003 • Social media at @KEKline • Blog: http://blogs.sqlsentry.com/KevinKline
  • 2. Tuning blog: http://www.sqlperformance.com/ E-mail ebooks@sqlsentry.com for free copies of our e-books:
  • 3. AGENDA • Methodology for troubleshooting • Troubleshooting tools and techniques using the native SQL Server tool kit: o Wait Stats o Windows Performance Monitor (PerfMon) o SQL Profiler, Server-Side Traces, and XEvents o SQL Server DMVs o Execution Plans • Summary, Resources, and Q&A
  • 4. WHERE TO BEGIN? • There’s not a “right” or “wrong” place to start. You can start at any of the points shown above. • Start with the information source that provides the actionable information most quickly Error Logs PerfMon DMVs Profiler & Trace SSMS (Execution Plan)
  • 5. METHODOLOGY • Effective troubleshooting is like a funnel or series of continuously more refined sieves. • Each successive sieve filters out smaller “chunks”; that is, harder and more transient errors and problems • More work is required… Identification & Resolution Specific SQL Cmds Resource issues Errors in the log
  • 6. TROUBLESHOOTING CHECKLIST Shortcut! Has anything changed? Inside or outside of SQL Server? Is the issue caused by a SQL Server error? Are there excessive wait stats? Correlate wait stats against other metrics. Follow-up 1. 2. 3. 4. 5. 6.
  • 7. YOUR BEST SHORTCUT Your best shortcut? Know what has changed! • Sp_Configure or sys.configurations • Sp_Dboption (pre-SQL2012) or sys.databases (SQL2012 +) • DDL triggers for meta-data changes: o Developers? o Unfettered access to databases? Remember: Change = Risk
  • 8. ERROR LOGS • Windows Application helps eliminate non-SQL Server problems • SQL Server Error Log and SQL Server Agent Log o Available both as TXT and through the GUI o SQL Server keeps the six most recent, incrementing with each reboot • WARNING! Always make sure to enable SQL Server Agent notifications for severity level 18 or greater!
  • 9. ACTING UPON ERROR LOGS • No further research required o Error found with easy fix o Error found with difficult fix or restore required • Further research required o Error found, but time or symptoms of error do not correlate to the problem o No error found
  • 11. DEMO OF ERROR NOTIFICATIONS IN SSMS
  • 12. ADVANCED ERROR NOTIFICATION IN SSMS • Error notification can be difficult with lots of SQL Servers. • Ease the pain by setting up Event Forwarding under the Advanced properties of the SQL Server Agent. • All events from remote servers are forwarded to one (or more) central servers. • Now, only one instance of SQLMail/DBMail are needed in your environment.
  • 13. ROCKS, GRAVEL, OR SAND • We retrieved the top level information, “the big rocks” • Now, what’s the best way to go deeper?
  • 14. WAIT STATS: IT’S ALL ABOUT BOTTLENECKS! • Anytime a task in SQL Server waits for something: o It is reported as a wait type o Reveals where the bottlenecks are • SQL Server 2005 aggregates wait type information • SQL Server 2008 provides new pre-emptive wait stats
  • 15. SCHEDULERS & WAIT STATS • 1 Window = 1 Scheduler • Users are assigned to a thread Uh oh! The out of soda! No problem. Step aside… More syrup for the sodas! Goes to the waiting or “suspended” queue Yeah! I’m next in line!
  • 16. WAITS BY TASK • sys.dm_os_waiting_tasks • Wait information • Task level • Very accurate • Transient data
  • 17. BUFFER AND TRANSACTION BOTTLENECKS • PAGELATCH_xx and LATCH_xx • PAGEIOLATCH_xx usually come from contention on the buffer pool • LATCH_xx commonly arise from contention on resources other than buffer pool, especially due to heaps or text data types • LCK_xx arise from lots of locks and blocks, perhaps by overlong transactions or improperly indexed tables or poorly configured hardware
  • 18. CPU BOTTLENECKS • SOS_SCHEDULER_YIELD Yielding processor time • CXPACKET • Query parallelism due to splitting and merging overhead
  • 19. IO BOTTLENECKS • WRITELOG • Writing transactions to the log on disk • PAGEIOLATCH_xx • Represent memory-to-disk transfers • IO_COMPLETION • Awaiting I/O task completion
  • 20. EXTERNAL BOTTLENECKS • OLEDB • Wait on the OLEDB provider o Full-Text Search o Lots of linked servers • NETWORKIO • Often poor client response, in addition to physical networking
  • 21. OTHER BOTTLENECKS • SLEEP_BPOOL_FLUSH • Checkpoint IO throttling • RESOURCE_SEMAPHORE_QUERY_CO MPILE • Throttling query compilations • Compilations, re-compilations, non- cacheable plans • RESOURCE_SEMAPHORE • Waiting for a memory grant
  • 22. ARE THESE BOTTLENECKS? • WAITFOR • T-SQL WAITFOR command • SQLTRACE_BUFFER_FLUSH • Default trace • LAZYWRITER_SLEEP • System process waiting to start
  • 23. TOP 10 WAITS FROM THE FIELD CPU PRESSURE • CPU pressure: SOS_SCHEDULER_YIELD • Parallelism: CXPACKET LOCKING • Long term blocking: LCK_X, LCK_M_U, & LCK_M_X MEMORY • Buffer latch: PAGELATCH_X • Non-buffer latch: LATCH_X • Memory grants: RESOURCE_SEMAPHORE I/O • Buffer I/O latch: PAGEIOLATCH_X • Tran log disk subsystem: WRITELOG & LOGBUFFER • General I/O issues: ASYNC_IO_COMPLETION & IO_COMPLETION NETWORK PRESSURE • Network I/O: ASYNC_NETWORK_IO
  • 24. CORRELATING PERF INFORMATION • With wait stats, other older standbys are not as frequently needed. o But they still help! • PerfMon • Xevents and Traces (either Profiler or Server-side) • DMVs
  • 25. PERFMON • Benefits: Shows the rate of resource consumption or activity in a wide variety of areas on the server, for example o Disk IO; Memory; Network o SQL Server activity - Locking, Blocking, and Deadlocking; Cache Activity; Object Utilization • Limitations o Very hard to know what to track and what values indicate good or bad performance o Doesn’t offer good root-cause analysis, only resource consumption info
  • 27. OS PERFMON COUNTERS Object Counter Value Notes Paging $Usage <70% Amount of page file currently in use Processor % Processor Time <= 80% The higher it is, the more likely users are delayed. Processor % Privilege Time <30% of % Processor Time Amount of time spent executing kernel commands like SQL Server IO requests. Process(sqlservr) Process (msmdsrv) % Processor Time < 80% Percentage of elapsed time spent on SQL Server and Analysis Server process threads. System Processor Queue Length < 4 < 12 per CPU is good/fair, < 8 is better, < 4 is best
  • 28. IO AND MEM PERFMON COUNTERS Object Counter Value Notes Physical Disk Avg Disk Reads/sec < 8 > 20 is poor, <20 is good/fair, <12 is better, <8 is best Physical Disk Avg Disk Writes/sec < 8 or <1 Without cache: > 20 poor, <20 fair, <12 better, <8 best. With cache > 4 poor, <4 fair, <2 better, <1 best Memory Available Mbytes >100 Amount of physical memory available to run processes on the machine SQL Server: Memory Manager Memory Grants Pending ~0 Current number of processes waiting for a workspace memory grant. SQL Server: Buffer Manager Free List Stalls/sec < 2 Frequency that requests for db buffer pages are suspended because there are no buffers.
  • 29. RED FLAG PERFMON COUNTERS Object Counter Value Notes :Access Methods Forwarded Records/sec <10* Tables with records traversed by a pointer. Should be < 10 per 100 batch requests/sec. :Access Methods Page Splits/sec <20* Number of 8k pages that filled and split into two new pages. Should be <20 per 100 batch requests/sec. :Databases Log Growths/sec; Percent Log used < 1 and <80%, resp Don’t let transaction log growth happen randomly! :SQL Statistics Batch Requests/sec * No firm number without benchmarking, but > 1000 is a very busy system. :SQL Statistics Compilations/sec;Reco mpilations/sec * Compilations should be <10% of batch requests/sec; Recompilations should be <10% of compilations/sec :Locks Deadlocks/sec < 1 Nbr of lock requests that caused a deadlock.
  • 30. PROFILER / XEVENTS • Monitors SQL Server for the occurrence of events • When an event fires, Profiler logs the event and information about it • Useful for: o Finding and diagnosing slow-running code. o Capturing the series of SQL statements that lead to a problem o Replaying and reproducing a problem on a test machine • Doesn’t offer resource consumption info, just granular details
  • 31. SERVER-SIDE TRACES • Warning! Profiler can be overwhelmed by a high throughput system! • Server-side traces happen entirely on the server (no client GUI) and are controlled using stored procedures • Useful for “auto-start” logging and high performance scenarios • TIP! Profiler can be used to create a server-side trace. That means no procedures to learn.
  • 32. DEMO • Correlating PerfMon and Profiler Information
  • 33. DEMO OF SQL PROFILER • 1: Invoke SQL Profiler • 2: Choose a template, Standard is usually ok. • 3: Choose your Events from the Events Selection tab. • 4: Click RUN to begin the trace. • 5: Click STOP to end the trace and write it to a file.
  • 34. CORRELATING PERFMON AND TRACE DATA 1. After collecting a PerfMon and Profiler trace file, load the Profiler file using File  Open  Trace File. 2. Choose File  Import Performance Data to load in the PerfMon trace file. 3. Choose the PerfMon counters to show on your analysis screen. 4. You’ll then have the overlay of PerfMon & Profiler data as shown on the right. 5. You can click anywhere on the timeline to see what was happening at that point in time.
  • 35. DYNAMIC MANAGEMENT VIEWS (DMV) • Tell exactly what’s happening at present inside of SQL Server • Multitude of DMVs, which can tell things like: o What are the top 10 most CPU-intensive queries? o What are the 5 biggest objects in cache? o Which objects get the most IO? o Which users consume the most resources? • DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR);
  • 36. ESSENTIAL DMVS Performance & Wait Stats • Sys.dm_os_wait_stats • Sys.dm_os_performance_counters • Sys.dm_os_waiting_tasks I/O • Sys.dm_io_virtual_file_stats • Sys.dm_io_pending_io_requests Transactions • Sys.dm_tran_lock • Sys.dm_db_index_operational_stats • Sys.dm_db_index_usage_stats SPID Activity & SQL Statements • Sys.dm_os_exec_requests • Sys.dm_exec_requests • Sys.dm_exec_query_stats • Sys.dm_exec{procedure | trigger}_stats Why code it yourself? Get Glenn Berry’s latest scripts at http://sqlserverperformance.wordpress.com/category/diagnostic-queries/
  • 37. 1. Inside or Outside of MSSQL? Check Windows Server logs. Resolve any errors and recheck. 2. Caused by an MSSQL or SQLAgent error? Check SQL Server and SQL Agent logs. Resolve any errors and recheck. 3. Excessive wait stats? Assess wait statistics to categorize the bottleneck using sys.dm_wait_stats. 4. Wait stats correlate to specific sessions or components? Assess session wait stats using sys.dm_waiting_tasks. Resolve problematic user activity or process. Assess other problem areas using other DMVs, like dm.os_performance_counters. Resolve system misconfiguration, design problem, or resource shortage.
  • 38. SQL SERVER MANAGEMENT STUDIO • Once the root-problem is revealed, you still have to fix it. • Common resolutions using SSMS include: o Debug a SQL Server procedure or function o Tune one or more SQL statements o Add or alter indexes • Tuning SQL code can be difficult unless you know how to read an execution plan: o SQL Sentry Plan Explorer is FREE!
  • 39. EXECUTION PLANS • Explain plans tell you all the internal steps that the SQL Server takes to complete the action • Read graphic explain plans from right to left. (Textual ones from bottom to top) • Graphic plans use icons to represent actions, while arrows represent data flows
  • 40. DEMO • Reading Basic Execution Plans
  • 42. FIXING BAD CODE IN SSMS • Fixing bad code is an exercise in experimentation o Lots of tips & tricks to try o Check out our tuning content at http://sqlsentry.tv • Figure out the work done in the code, then try a new version that might improve it: o Different search arguments in the WHERE or JOIN clauses to make better use of indexes o Use an alternative pattern o Apply a different locking strategy o Use a query hint • Clear you caches, then rewrite, test, repeat…
  • 44. PROBLEMS • Adam Machanic’s sp_whoisactive • Brent Ozar’s sp_askBrent, sp_blitz • Extended events – Jonathan Kehayias • DMVs – Glenn Berry’s diagnostic queries • System info: dm_os_performance_counters, dm_os_wait_stats • Query info: dm_exec_requests, dm_exec_query_stats • Plans: dm_exec_query_plan, dm_exec_plan_attributes • Cache/buffer pool: dm_exec_cached_plans, dm_os_buffer_descriptors • Index info: dm_db_index_usage_stats, dm_io_virtual_file_stats
  • 45. THANK YOU! • Performance tuning blog at http://SQLPerformance.com. • Videos at http://SQLSentry.TV • E-mail ebooks@sqlsentry.com for free copies of our e-books: o Just tell them where you met me