Online Class • Core Lesson
This lesson teaches you how professional DBAs find performance problems fast and fix them safely.
You will learn what to monitor, what “normal” looks like, how to capture evidence, and how to troubleshoot the four
most common bottlenecks in SQL Server: CPU, Memory, I/O, and Blocking.
By the end, you’ll have a repeatable workflow you can use in production without guessing.
Monitoring is how you detect performance issues early and prevent outages. Troubleshooting is how you respond when
users complain: “the database is slow,” “the app is timing out,” or “everything is stuck.”
In real life, you rarely get one perfect clue. You get symptoms, partial information, and pressure.
This lesson gives you a structured system to work under pressure and still get the right answer.
Performance troubleshooting is not “tuning by instinct.” It is evidence collection + root cause analysis.
You observe the system, measure the right signals, identify the real bottleneck, apply a targeted fix, and validate results.
If you can’t prove it, you can’t trust it.
90–150 minutes (lecture + live diagnosis demo + lab)
Monitoring is continuous observation: you collect metrics and trends so you can detect problems early.
Troubleshooting is incident response: users are already impacted and you must diagnose quickly.
Key teaching point: Most outages aren’t “sudden.” They are trends you could see days or weeks in advance
(data growth, memory pressure, increasing I/O waits, rising blocking).
When performance drops, DBAs must follow a safe workflow. This prevents panic changes and protects production stability.
Use this every time.
Rule: During an incident, do not start by rebuilding indexes, changing MAXDOP, or “restarting SQL Server.”
Always capture evidence first. A restart destroys the evidence you need to fix the real root cause.
Think of SQL Server like a patient in a hospital. You monitor vital signs so you can spot danger early.
These are the signals DBAs watch most often:
A baseline is your reference point. At minimum, you should know:
SQL Server provides built-in tools that are powerful enough for professional troubleshooting. In production, many teams
add third-party monitoring, but you must first master the built-in signals.
Query Store captures query performance history over time. It helps answer questions like:
“Which query got worse after deployment?” and “Did the execution plan change?”
If you have Query Store enabled, troubleshooting becomes dramatically easier.
DMVs show what SQL Server is doing right now: active requests, waits, memory grants, and more.
DMVs are especially useful during incidents.
In this class, we focus on safe, high-signal DMVs:
sys.dm_exec_requests, sys.dm_exec_sessions, sys.dm_os_wait_stats,
and a few I/O views.
Wait stats show what SQL Server threads are waiting on.
You never use waits alone to “declare a verdict.” You use waits as clues, then validate with other evidence.
Blocking happens when one session holds locks and other sessions must wait.
Blocking can make the system “feel down” even when CPU is low.
DBAs must quickly find: the lead blocker and why it’s holding locks.
Most real-world SQL Server performance issues fall into one of these bottlenecks. Your job is to determine which one is dominating:
CPU bottlenecks happen when SQL Server is doing too much compute work (large scans, heavy joins, sorts, scalar functions,
or too many concurrent requests).
Typical fixes: reduce reads, improve predicates, add targeted indexes, rewrite queries, fix plan regressions.
SQL Server uses memory to cache pages (buffer pool) and to execute sorts/hashes (memory grants).
Memory pressure can make performance unstable: queries are fast sometimes and slow other times.
Typical fixes: reduce reads/row counts, fix estimates (stats), tune big queries, review memory settings carefully.
I/O bottlenecks happen when storage cannot keep up with reads/writes. This can be caused by slow disks,
overloaded storage, or queries that read far too many pages.
Typical fixes: reduce reads, optimize indexes/queries, review file layout, improve storage, reduce TempDB spills.
Blocking happens when sessions compete for the same data and one transaction holds locks.
This is one of the most common “everything is frozen” incidents in SQL Server.
Typical fixes: find the lead blocker, shorten transactions, batch changes, add supporting indexes,
review isolation strategy.
The scripts below are safe (read-only) and are designed for students to use in lab environments.
They help you capture evidence during incidents and build baselines. In production, always follow your company’s change policies.
-- Active requests (high signal during incidents) SELECT r.session_id, s.login_name, s.host_name, s.program_name, r.status, r.command, r.cpu_time, r.total_elapsed_time, r.reads, r.writes, r.logical_reads, r.wait_type, r.wait_time, r.blocking_session_id, DB_NAME(r.database_id) AS database_name FROM sys.dm_exec_requests r JOIN sys.dm_exec_sessions s ON r.session_id = s.session_id WHERE r.session_id <> @@SPID ORDER BY r.total_elapsed_time DESC;
How to interpret: Look for sessions with high elapsed time, high logical reads, high CPU time,
or a non-zero blocking_session_id.
-- Waits snapshot (since last restart) SELECT TOP (20) wait_type, waiting_tasks_count, wait_time_ms, signal_wait_time_ms FROM sys.dm_os_wait_stats WHERE wait_type NOT LIKE 'SLEEP%' ORDER BY wait_time_ms DESC;
How to interpret: Waits are clues, not verdicts. Use them to narrow the investigation, then validate with
active requests, I/O latency, and blocking evidence.
-- I/O latency per file (read-only) SELECT DB_NAME(vfs.database_id) AS database_name, mf.type_desc, mf.physical_name, vfs.num_of_reads, vfs.num_of_writes, vfs.io_stall_read_ms, vfs.io_stall_write_ms, CASE WHEN vfs.num_of_reads = 0 THEN 0 ELSE vfs.io_stall_read_ms / vfs.num_of_reads END AS avg_read_ms, CASE WHEN vfs.num_of_writes = 0 THEN 0 ELSE vfs.io_stall_write_ms / vfs.num_of_writes END AS avg_write_ms FROM sys.dm_io_virtual_file_stats(NULL, NULL) vfs JOIN sys.master_files mf ON vfs.database_id = mf.database_id AND vfs.file_id = mf.file_id ORDER BY (vfs.io_stall_read_ms + vfs.io_stall_write_ms) DESC;
How to interpret: High average read latency points to data file pressure. High average write latency on LOG files
points to a log bottleneck (common in write-heavy systems).
-- Blocking overview (who is blocking whom) SELECT r.session_id, r.blocking_session_id, r.status, r.wait_type, r.wait_time, r.total_elapsed_time, r.logical_reads, r.reads, r.writes, DB_NAME(r.database_id) AS database_name FROM sys.dm_exec_requests r WHERE r.blocking_session_id <> 0 ORDER BY r.total_elapsed_time DESC;
How to interpret: The lead blocker is often the session ID that appears as a blocker but is not itself blocked.
The goal is to find the lead blocker and understand what it is doing (long transaction, big update, missing index, etc.).
Below are common incidents DBAs face. Read each scenario and follow the playbook. This is how you build real troubleshooting skill.
This is often blocking. CPU may be low because sessions are waiting, not working.
Peak-time slowness usually indicates a concurrency problem: blocking, resource saturation, or a workload spike.
Students will capture a “mini incident report” using DMVs and explain what the evidence suggests.
This trains you to diagnose without guessing.
Prompt:
“A user says: ‘The database is slow.’ What are the first three things you would check and why?
Your answer must include one DMV, one bottleneck category (CPU/I/O/Memory/Blocking), and one metric.”
In the next lesson, we move into Advanced SQL Server Configurations and Best Practices for Performance Tuning.
Monitoring tells you what the bottleneck is, but configuration determines how SQL Server behaves under load. You will learn which settings
matter most, how to change them safely, and why “copying best settings from the internet” is risky without context.
Not a member yet? Register now
Are you a member? Login now