SQL Server 2005 Tuning, Optimization, and Troubleshooting (M2784, M2790)
Optimize your database to improve query response times.
This course is not currently offered by Global Knowledge. Information here is provided for reference only.
In this intensive instructor-led workshop, database developers who work in enterprise environments and use Microsoft SQL Server 2005 will gain the knowledge and skills to evaluate and improve queries and query response times as well as to understand the overall process of troubleshooting. In the workshop, students will focus on systematic identification and optimization of database factors that impact query performance, establishing monitoring standards and baselines, determining performance thresholds, and focusing the investigation on specific issues.
This course incorporates material from the following Official Microsoft Learning Products:
- 2784: Implementing a Microsoft SQL Server 2005 Database
- 2790: Troubleshooting and Optimizing Database Servers Using Microsoft SQL Server 2005
Prerequisites:
- Familiar with SQL Server 2005 features, tools, and technologies
- Microsoft Certified Technology Specialist: Microsoft SQL Server 2005 credential or equivalent experience
- Working knowledge of data storage, specifically, knowledge about row layout, fixed-length field placement, and varying-length field placement.
- Familiarity with index structures and index utilization, specifically, an understanding of the interaction between non-clustered indexes, clustered indexes, and heaps and why a covering index can improve performance
- At least three years of experience as a full-time database developer in an enterprise environment
- Familiar with the locking model, including an understanding of lock modes, lock objects, and isolation levels and familiarity with process blocking
- Understand Transact-SQL syntax and programming logic, specifically, be completely fluent in advanced queries, aggregate queries, subqueries, user-defined functions, cursors, control of flow statements, CASE expressions, and all types of joins
- Ability to design a database to third normal form (3NF) and know the trade offs when backing out of the fully normalized design (denormalization) and designing for performance and business requirements in addition to being familiar with design models, such as Star and Snowflake schemas
- Strong monitoring and troubleshooting skills, including using monitoring tools
- Basic knowledge of the operating system and platform, that is, how the operating system integrates with the database, what the platform or operating system can do, and how interaction between the operating system and the database works
- Basic knowledge of application architecture, that is, how applications can be designed in three layers, what applications can do, how interaction between the application and the database works, and how the interaction between the database and the platform or operating system works
- Ability to use a data modeling tool
- Working knowledge of SQL Server 2005 architecture including indexing, SQL execution plans, and SQL Server basic configuration
- Basic monitoring and troubleshooting skills, such as on-the-job experience with Sysmon and Perfmon
- Working knowledge of the operating system and platform, including an understanding of how the operating system integrates with the database, what the platform or operating system can do, and the interaction between the operating system and the database.
- Basic understanding of server architecture such as CPU and memory utilization and I/O
- Basic knowledge of application architecture, including how applications can be designed in three layers, what applications can do, the interaction between applications and the database, and the interaction between the database and the platform or operating system
- Understanding of Transact-SQL syntax and programming logic
- Basic knowledge of Microsoft Windows networking, including how Domain Name Service (DNS) operates and how servers communicate between domains
- Course 6052: Maintaining a Microsoft SQL Server 2005 Database
For SATV redemption: If you are planning to redeem your SATVs for this course, please note that two SATV voucher numbers are required. One voucher number should reflect three days of training, and the second should reflect two days of training.
What You'll Learn
- Normalize databases
- Design a normalized database
- Optimize a database design by denormalizing
- Optimize data storage
- Manage concurrency
- Select a locking granularity level
- Optimize and tune queries for performance
- Optimize an indexing strategy
- When cursors are appropriate
- Identify and resolve performance-limiting problems
- Design a baseline performance monitoring solution
- Narrow down performance issues
- Guidelines for monitoring database servers and instances
- Utilize Profiler and Sysmon for monitoring
- Load and perform analysis against Profiler traces using SQL Server queries
- Run SQLdiag.exe as an additional troubleshooting tool
- Determine the database-level reasons for poor query performance
- Troubleshoot common SQL Server problems, including DNS issues, network authentication issues, and SQL Server 2005 endpoint issues
- Troubleshoot issues at a data level, including torn pages and invalid data
- Offending objects that cause concurrency issues
Who Needs to Attend
Current professional database developers and administrators who have three or more years of on-the-job experience developing SQL Server database solutions in an enterprise environment
Prerequisites
See Course Description.
Follow-On Courses
There are no follow-ons for this course.
Course Outline
1. Measuring Database Performance
This unit provides students with an opportunity to measure database performance and identify database performance bottlenecks. Students will use a sample script to identify performance and concurrency problems, capture baseline performance, and prioritize identified problems for optimization.
- Importance of Benchmarking
- Key Measures for Query Performance: Sysmon
- Key Measures for Query Performance: Profiler
- Guidelines for Identifying Locking and Blocking
2. Optimizing Physical Database Design
In this unit, students work with strategies for optimizing physical database design. Students will optimize a database schema using normalization, generalization, and denormalization.
- Performance Optimization Model
- Schema Optimization Strategy: Keys
- Schema Optimization Strategy: Responsible Denormalization
- Schema Optimization Strategy: Generalization
3. Optimizing Queries for Performance
In this unit students experience optimizing and tuning queries to improve performance. In the lab, students will optimize stored procedures, views, and non-cursor aggregate queries to improve database performance and user experience. Each query that is optimized improves the overall system because the query will use fewer resources, freeing up those resources for other queries and reducing the amount of locking done by the query. The domino effect is profound.
- Performance Optimization Model: Queries
- What Is Query Logical Flow?
- Considerations for Using Subqueries
- Guidelines for Building Efficient Queries
4. Refactoring Cursors into Queries
In this unit, students will work with strategies for refactoring cursors into queries. In the lab, students will work to optimize a database by replacing slow iterative code with faster set-based code.
- Performance Optimization Model: Query-Set-Based Solutions
- Five Steps to Building a Cursor
- Strategies for Refactoring Cursors
5. Optimizing an Indexing Strategy
In this unit, students will work on optimizing indexing strategies. Students will work with a given database to add and delete indexes by providing the optimum bridge between the query and the data without any redundancies.
- Performance Optimization Model: Indexes
- Considerations for Using Indexes
- Best Uses of the Clustered Index
- Best Practices for Non-Clustered Index Design
- How to Document an Indexing Strategy
6. Managing Concurrency
This unit provides students with the opportunity to work with concurrency management. Students will look for concurrency issues and then solve them by optimizing transactions and adjusting the transaction isolation level.
- Performance Optimization Model: Locking and Blocking
- Multimedia: "How to Use Efficient Queries to Reduce Locking and Blocking"
- Strategies to Reduce Locking and Blocking
7. Building a Monitoring Solution for SQL Server Performance Issues
This unit provides an opportunity for the student to build a monitoring solution that will help to identify SQL Server performance issues. Students will design a baseline performance monitoring solution.
- Narrowing Down a Performance Issue to an Environment Area
- Guidelines for Monitoring Database Servers and Instances by Using Profiler and Sysmon
- Guidelines for Auditing and Comparing Test Results
8. Troubleshooting Database and Database Server Performance Issues
This unit provides an opportunity for students to troubleshoot SQL Server performance issues. Students analyze the sample monitoring output to determine the issue. This unit includes information on a new feature in SQL Server 2005 which allows students to automatically sync a Sysmon log and Profiler trace. It also allows students to load and perform analysis against a Profiler trace using SQL Server queries. Finally, it allows students to run SQLdiag.exe as an additional troubleshooting tool.
- Narrowing Down a Performance Issue to a Database Object
- How Profiler Can Help Narrow a Search to a Specific Issue
- How the SQLdiag Tool Can Be Used to Analyze Outputs
9. Optimizing the Query Performance Environment
This unit gives students an opportunity to determine the database-level reasons for poor query performance, such as bad indexes and outdated index column statistics. Students are provided with samples from a Profiler trace or a listing of poorly performing queries and directed to investigate possible reasons.
- The Methodology of Optimizing a Query Environment
- The Query Performance Troubleshooting Process
10. Troubleshooting SQL Server Connectivity Issues
This unit explains the troubleshooting of common SQL Server problems. Examples include DNS issues, network authentication issues, and SQL Server 2005 endpoint issues.
- The Methodology of Troubleshooting SQL Server Connectivity Issues
- Areas to Troubleshoot for Common Connectivity Issues
- What Are SQL Server 2005 Endpoints?
11. Troubleshooting SQL Server Data Issues
This unit lets students troubleshoot issues at a data level. One exercise will be used to identify and recover a torn page. The second exercise is a business unit report which contains invalid data. The goal is for the Database Administrator to track down the reasons for the invalid data.
- The Methodology of Troubleshooting SQL Server Data Issues
- The Process of Troubleshooting Data Integrity Issues
- How Torn Pages Can be Resolved Using a Single-Page Restore
12. Troubleshooting SQL Server Data Concurrency Issues
This module lets the students identify the offending objects that cause concurrency issues. The first exercise shows students how to determine stored procedures involved in a deadlocked situation. The second exercise shows students how to determine the source of a blocking issue. The third exercise shows students how to evaluate wait types and latches.
- The Methodology of Troubleshooting Concurrency Issues
- What Are SQL Server Latches?
- Activity: Choosing a Blocking Monitoring Solution
Labs
Lab 1: Measuring Database Performance
- Reviewing Tables and Scripts
- Determining Performance Baselines
- Prioritizing Identified Problems
Lab 2: Optimizing SchemasOptimizing Memberships
- Optimizing Events
- Normalizing Event Sponsorships
- Denormalizing Membership Visits
- Cleaning Up Schema
- Adapting the Solution to the New Database Schema
- Determining Performance
Lab 3: Optimizing Queries
- Optimizing and Rewriting Slow Performing Stored Procedures
- Optimizing and Rewriting Slow Performing Views
- Optimizing and Rewriting Slow Performing Non-Cursor Aggregate Queries
- Determining Performance
Lab 4: Refactoring Cursors into Queries
- Refactoring the pMembershipCategory Cursor
- Refactoring the pCommunityImpact Cursor
- Refactoring the pMemberInvitation Cursor
- Determining Performance
Lab 5: Optimizing an Indexing Strategy
- Identifying Tables to Optimize
- Designing Indexes
- Determining Performance
Lab 6: Reducing Blocking
- Identifying Code with Locking and Blocking Issues
- Reducing Concurrency Issues
- Determining Final Performance
Lab 7: Building a Monitoring Solution for SQL Server Performance Issues
- Determining Which Indicators to Monitor
- Implementing a Monitoring Solution
- Auditing Monitoring Results to Identify Problem Areas
Lab 8: Troubleshooting Database and Database Server Performance Issues
- Analyzing Sysmon and Profiler Traces
- Analyzing a Profiler Trace by Using SQL Server Queries
- Determining Database Server Issues by Using SQLdiag.exe
Lab 9: Optimizing the Query Performance Environment
- Reviewing an Execution Plan for Clues to Poor Performance
- Performing Index Analysis by Using the Database Tuning Advisor (DTA)
Lab 10: Troubleshooting SQL Server Connectivity Issues
- Troubleshooting Server-Not-Found Issues.
- Troubleshooting an Authentication Error Message.
- Troubleshooting Endpoint Issues.
Lab 11: Troubleshooting SQL Server Data Issues
- Troubleshooting and Repairing Torn Pages
- Troubleshooting a Data Issue
Lab 12: Troubleshooting SQL Server Data Concurrency Issues
- Identifying the Objects Involved in a Deadlock
- Identifying the Objects Involved in a Blocking Issue
- Determining Concurrency Issues by Using Latch Wait Types
Canada [
