SQL Server Management (Performance & Troubleshooting) and Management Best Practices)
SQL Server Management (Performance & Troubleshooting) and Management Best Practices)
Learn how to Monitor, Manage, Diagnose and Resolve SQL Server performance issues.
Agenda
About Quest Software Accolades & Awards Quest Products Tackling Performance Issues Use Cases: Root-cause Analysis Finding & Fixing Bad SQL Testing for Scalability Backup & Recovery Demo Call to Action Q&A
Founded in 1987
'99
'00
'01
'02
'03
'04
'05
Tackling Performance Issues Finding the cause of a performance problem in SQL Server requires detailed knowledge of:
SQL Profiler Performance Monitor A variety of DBCC commands (in SQL Server 2000) or DMVs (in SQL Server 2005) Enterprise Manager & Query Analyzer (SQL2000) or SQL Server Management Studio (SQL2005)
Requires several hours to several days to figure out the problem. Well walk you through the process.
The importance of service monitoring You should begin with service monitoring = observing the health of the service in real-time. Enables DBAs to observe service behavior proactively and quantitatively. A key objective is to know, quantitatively, what the performance of a given server is and then manage to that standard. Allows you to avoid depending on user experience as the key indicator for performance Helps find problems even when users arent on the system How do you put service monitoring in place?
Proactive Monitoring
Benefits Best chance of catching errors before they occur. Gets you out of fire fighting mode. Best information about environment and apps. Better long-term decisions. Drawbacks Requires more time and deeper understanding of apps. Requires review and analysis of charts, graphs and other information on an on-going basis.
Build a baseline performance profile. Makes you familiar with the operational behavior of each app/server. Clearly documents what is normal for a server and/or application. Identifies types of problems that arise even when the server is behaving normally: Some problems require a response. Some problems have no response.
Goal of a baseline
Tells you all about the performance of a server under normal conditions. Document and understand as many as possible (if not all) background processes Build in filters to catch do not respond situations before DBAs see them; Otherwise, apathy can set in. After completing a baseline, you then benchmark the database application at higher and higher workloads until you establish the systems upper performance limit.
Building a baseline
Need a single graphic representation, along with enough information to interpret the results. Use System Monitor: real-time or saved to a log. Choose a sampling interval that balances the need for data vs. the disk I/O to record the collections. Every 15 seconds is default. Flat file vs. database repository Local vs. Remote monitoring? Pros and cons to each. Next, you must assign and assess the SysMon counters. (Need a few more counters for building the baseline than you need for daily monitoring.)
Use Cases Now that you know how to proactively monitor the SQL Server database application, you can use these tools and techniques in combination to solve many different use cases:
SQL Profiler PerfMon A variety of DBCC commands (in SQL Server 2000) or DMVs (in SQL Server 2005) Enterprise Manager & Query Analyzer (SQL2000) or SQL Server Management Studio (SQL2005)
Youll have to correlate the data returned by each tool in turn with the next tool in order to construct a complete picture of the error, what happened, and how it can be fixed.
Use Case #2 Finding & Fixing Bad SQL Bad SQL are SQL statements that require too many resources, such as CPU, IO, or cause blocking locks Finding bad SQL statements requires:
Deep knowledge of the query engine and how to read query plans SQL Profiler to find out when bad SQL statements are invoked, compiled, or recompiled A variety of DBCC commands (SQL2000) or DMVs (SQL2005)
Once you find the bad SQL, youll have to rewrite it, evaluate the new execution plan, and (if the new plan is no better) try again.
Use Case #3 Testing for Scalability You want to ensure your database application can run with a certain number of user connections (e.g. 500, 1000, etc). But how? Testing for scalability using native tools requires:
Capturing a sample workload using SQL Profiler Creating a new test database and possibly an entire server Opening multitudes of Query Analyzer or Management Studio sessions to spawn and thereby simulate the proper number of user connections Collect server performance metrics, collate reports, and compare test results
Building the test infrastructure, running the test, watching SQL Servers performance, then collecting metrics and determining the results can take hours or even days
Use Case #4 Backup & Recovery Backing up a large SQL Server database:
Consumes nearly as much space as the database itself. Thus, a 1tb database backup will require as much as 980gb of space. Is unencrypted and readable with a simple text-editor Can take hours and hours (depending on the disk subsystem)
Recovery time is directly dependent on the size of the backup file and the number of data pages that need to be read.
Demo Quest tools make all of these difficult processes much easier and faster, in many cases immediate and instantaneous:
Spotlight for root-cause analysis Performance Analysis and SQL Tuning for finding & fixing bad SQL Benchmark Factory for scalability testing Litespeed for fast & easy backups and restores
Call to Action Next Steps Attend a live demo: http://www.quest.com/landing/qc_demos.asp Download white papers: http://www.quest.com/whitepapers Get a trial versions: http://www.quest.com/solutions/download.asp Email us with your questions:
sales@quest.com call 949.754.8000
Q&A Send questions to: Send broader technical questions to: info@quest.com Send sales & licensing questions to: sales@quest.com
THANK YOU!