Dynamic Management Views (DMVs) are a significant and valuable addition to the DBA's troubleshooting armory, laying bare previously unavailable information regarding the under-the-covers activity of your database sessions and transactions. Why, then, aren't all DBAs using them? Why do many DBAs continue to ignore them in favour of "tried and trusted" tools such as sp_who2, DBCC OPENTRAN, and so on, or make do with the "ready made" reports built into SSMS? Why do even those that do use the DMVs speak wistfully about "good old sysprocesses"? There seem to be two main factors at work. Firstly, some DBAs are simply unaware of the depth and breadth of the information that is available from the DMvs, or how it might help them troubleshoot common issues. This book investigates all of the DMVs that are most frequently useful to the DBA in investigating query execution, index usage, session and transaction activity, disk IO, and how SQL Server is using or abusing the operating system. Secondly, the DMVs have a reputation of being difficult to use. In the process of exposing as much useful data as possible, sysprocesses has been de-normalized, and many new views and columns have been added. This fact, coupled with the initially-baffling choices of what columns will be exposed where, has lead to some DBAs to liken querying DMVs to "collecting mystic spells." In fact, however, once you start to write your own scripts, you'll see the same tricks, and similar join patterns, being used time and again. As such, a relatively small core set of scripts can be readily adapted to suit any requirement. This book is here to de-mystify the process of collecting the information you need to troubleshoot SQL Server problems. It will highlight the core techniques and "patterns" that you need to master, and will provide a core set of scripts that you can use and adapt for your own systems, including how to: * Root out the queries that are causing memory or CPU pressure on your system * Investigate caching, and query plan reuse * Identify index usage patterns * Track fragmentation in clustered indexes and heaps * Get full details on blocking and blocked transactions, including the exact commands being executed, and by whom. * Find out where SQL Server is spending time waiting for resources to be released, before proceeding * Monitor usage and growth of tempdb The DMVs don't make existing, built-in, performance tools obsolete. On the contrary, they complement these tools, and offer a flexibility, richness and granularity that are simply not available elsewhere. Furthermore, you don't need to master a new GUI, or a new language in order to use them; it's all done in a language all DBAs know and mostly love: T-SQL.
Author: Ian W. Stirk
Publisher: Manning Publications Company
Release Date: 2011
Every action in SQL Server - queries, updates, whatever - leaves a set of tiny footprints; SQL Server records all that valuable data and makes it visible through Dynamic Management Views, or DMVs. A DBA or developer can use this incredibly detailed information to significantly improve the performance of queries and better understand what's really going on inside a SQL Server system SQL Server DMVs in Action is a practical guide that shows how to obtain, interpret, and act on the information captured by DMVs to keep SQL Server in top shape. The 100+ samples provided in this book will help readers master DMVs and also give them a tested, working, and instantly reusable SQL code library. Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.
Author: Benjamin Nevarez
Publisher: McGraw Hill Professional
Release Date: 2014-10-10
Optimize Microsoft SQL Server 2014 queries and applications Microsoft SQL Server 2014 Query Tuning & Optimization is filled with ready-to-use techniques for creating high-performance queries and applications. The book describes the inner workings of the query processor so you can write better queries and provide the query processor with the quality information it needs to produce efficient execution plans. You’ll also get tips for troubleshooting underperforming queries. In-Memory OLTP (Hekaton), a key new feature of SQL Server 2014, is fully covered in this practical guide. Understand how the query optimizer works Troubleshoot queries using extended events, SQL trace, dynamic management views (DMVs), the data collector, and other tools Work with query operators for data access, joins, aggregations, parallelism, and updates Speed up queries and dramatically improve application performance by creating the right indexes Understand statistics and how to detect and fix cardinality estimation errors Maximize OLTP query performance using In-Memory OLTP (Hekaton) features, including memory-optimized tables and natively compiled stored procedures Monitor and promote plan caching and reuse to improve application performance Improve the performance of data warehouse queries using columnstore indexes Handle query processor limitations with hints and other methods
This book describes, diagnoses, and solves the most common problems with SQL Server 2005, 2008, and 2008 R2. The authors explain a basic approach to troubleshooting and the essential tools. They explore areas in which problems arise with regularity: high disk I/O (RAID misconfiguration, inadequate I/O throughput, poor workload distribution, SAN issues, disk partition misalignment); high CPU usage (insufficient memory, poorly written queries, inadequate indexing, inappropriate configuration option settings); memory mismanagement; missing indexes; blocking (caused mainly by poorly designed databases that lack proper keys and indexing, and applications that apply needlessly restrictive transaction isolation levels); deadlocking (Bookmark Lookup, Serializable Range Scan, Cascading Constraint); full transaction logs (lack of log backups, hefty index maintenance operations, long running transaction, problems with replication and mirroring environments); and accidentally-lost data. Finally, the authors discuss diagnosing tools such as the Performance Monitor, Dynamic Management Views, and server-side tracing. --
Design and configure SQL Server instances and databases in support of high-throughput applications that are mission-critical and provide consistent response times in the face of variations in user numbers and query volumes. Learn to configure SQL Server and design your databases to support a given instance and workload. You’ll learn advanced configuration options, in-memory technologies, storage and disk configuration, and more, all toward enabling your desired application performance and throughput. Configuration doesn’t stop with implementation. Workloads change over time, and other impediments can arise to thwart desired performance. High Performance SQL Server covers monitoring and troubleshooting to aid in detecting and fixing production performance problems and minimizing application outages. You'll learn a variety of tools, ranging from the traditional wait analysis methodology to the new query store, and you'll learn how improving performance is really an iterative process. High Performance SQL Server is based on SQL Server 2016, although most of its content can be applied to prior versions of the product. This book is an excellent complement to performance tuning books focusing on SQL queries, and provides the other half of what you need to know by focusing on configuring the instances on which mission-critical queries are executed. Covers SQL Server instance-configuration for optimal performance Helps in implementing SQL Server in-memory technologies Provides guidance toward monitoring and ongoing diagnostics What You Will Learn Understand SQL Server's database engine and how it processes queries Configure instances in support of high-throughput applications Provide consistent response times to varying user numbers and query volumes Design databases for high-throughput applications with focus on performance Record performance baselines and monitor SQL Server instances against them Troubleshot and fix performance problems Who This Book Is For SQL Server database administrators, developers, and data architects. The book is also of use to system administrators who are managing and are responsible for the physical servers on which SQL Server instances are run.
This book is a deep dive into perhaps the single-most important facet of good performance: indexes, and how to best use them. The book begins in the shallow waters with explanations of the types of indexes and how they are stored in databases. Moving deeper into the topic, and further into the book, you will look at the statistics that are accumulated both by indexes and on indexes. You’ll better understand what indexes are doing in the database and what can be done to mitigate and improve their effect on performance. The final destination is a guided tour through a number of real life scenarios showing approaches you can take to investigate, mitigate, and improve the performance of your database. Defines the types of indexes and their implementation options Provides use cases and common patterns in applying indexing Describes and explain the index metadata and statistics Provides a framework of strategies and approaches for indexing databases
Learn effective and scalable database design techniques in a SQL Server 2016 and higher environment. This book is revised to cover in-memory online transaction processing, temporal data storage, row-level security, durability enhancements, and other design-related features that are new or changed in SQL Server 2016. Designing an effective and scalable database using SQL Server is a task requiring skills that have been around for forty years coupled with technology that is constantly changing. Pro SQL Server Relational Database Design and Implementation covers everything from design logic that business users will understand, all the way to the physical implementation of design in a SQL Server database. Grounded in best practices and a solid understanding of the underlying theory, Louis Davidson shows how to "get it right" in SQL Server database design and lay a solid groundwork for the future use of valuable business data. The pace of change in relational database management systems has been tremendous these past few years. Whereas in the past it was enough to think about optimizing data residing on spinning hard drives, today one also must consider solid-state storage as well as data that are constantly held in memory and never written to disk at all except as a backup. Furthermore, there is a trend toward hybrid cloud and on-premise database configurations as well a move toward preconfigured appliances. Pro SQL Server Relational Database Design and Implementation guides in the understanding of these massive changes and in their application toward sound database design. Gives a solid foundation in best practices and relational theory Covers the latest implementation features in SQL Server 2016 Helps you master in-memory OLTP and use it effectively Takes you from conceptual design to an effective, physical implementation What You Will Learn Develop conceptual models of client data using interviews and client documentation Recognize and apply common database design patterns Normalize data models to enhance scalability and the long term use of valuable data Translate conceptual models into high–performing SQL Server databases Secure and protect data integrity as part of meeting regulatory requirements Create effective indexing to speed query performance Who This Book Is For Programmers and database administrators of all types who want to use SQL Server to store data. The book is especially useful to those wanting to learn the very latest design features in SQL Server 2016, features that include an improved approach to in-memory OLTP, durability enhancements, temporal data support, and more. Chapters on fundamental concepts, the language of database modeling, SQL implementation, and of course, the normalization process, lay a solid groundwork for readers who are just entering the field of database design. More advanced chapters serve the seasoned veteran by tackling the very latest in physical implementation features that SQL Server has to offer. The book has been carefully revised to cover all the design-related features that are new in SQL Server 2016.
Author: Tony Davis
Publisher: Red Gate Books
Release Date: 2012
This book provides an understanding of the SQL Server transaction log, what it does and how it works, and its role in ensuring data integrity. Topics covered include: write ahead logging; how to perform transaction log backup and restore in FULL and BULK_LOGGED recovery models; managing log growth, and dealing correctly with an overgrown or full log; and optimizing log throughput and availability, and how to avoid log fragmentation. --
The SQL Server Query Optimizer is perceived by many to be a magic black box, transforming SQL queries into high performance execution plans in the blink of an eye through some unknowable process. The truth is that, while the Query Optimizer is indeed the highly-complex result of decades of research, learning how it works its magic is not only possible, but immensely useful to DBAs and Developers alike. A better understanding of what the Query Optimizer does behind the scenes can help you to improve the performance of your databases and applications, and this book explains the core concepts behind how the SQL Server Query Optimizer works. With this knowledge, you'll be able to write superior queries, provide the Query Optimizer with all the information it needs to produce efficient execution plans, and troubleshoot the cases when the Query Optimizer is not giving you the best plan possible. With over 15 years of experience in the use of Relational Databases (including SQL Server since version 6.5), Benjamin has watched the SQL Server Query Optimizer grow and evolve. His insight will leave you with an excellent foundation in the practicalities of the Query Optimizer, and everything you need to know to start tuning your queries to perfection.
Queries not running fast enough? Wondering about the in-memory database features in 2014? Tired of phone calls from frustrated users? Grant Fritchey’s book SQL Server Query Performance Tuning is the answer to your SQL Server query performance problems. The book is revised to cover the very latest in performance optimization features and techniques, especially including the newly-added, in-memory database features formerly known under the code name Project Hekaton. This book provides the tools you need to approach your queries with performance in mind. SQL Server Query Performance Tuning leads you through understanding the causes of poor performance, how to identify them, and how to fix them. You’ll learn to be proactive in establishing performance baselines using tools like Performance Monitor and Extended Events. You’ll learn to recognize bottlenecks and defuse them before the phone rings. You’ll learn some quick solutions too, but emphasis is on designing for performance and getting it right, and upon heading off trouble before it occurs. Delight your users. Silence that ringing phone. Put the principles and lessons from SQL Server Query Performance Tuning into practice today. Covers the in-memory features from Project Hekaton Helps establish performance baselines and monitor against them Guides in troubleshooting and eliminating of bottlenecks that frustrate users
Author: Paul Nielsen
Publisher: Manning Publications Company
Release Date: 2009
This book presents the collective wisdom of more than 30 of today's leading SQL Server experts. This high-powered group is writing because of another passion it shares--all author royalties will be donated to help child victims of war, worldwide.
Expert SQL Server Practices 2012 Edition is an anthology of high-end wisdom from a group of accomplished database administrators who are quietly but relentlessly pushing the performance and feature envelope of Microsoft SQL Server 2012. With an emphasis upon performance—but also branching into release management, auditing, and other issues—the book helps you deliver the most value for your company’s investment in Microsoft’s flagship database system. Each chapter is a deep-dive into a specific problem, technology, or feature set. Each author has chosen their topic out of the strong belief that what they share can make a positive difference in your ability to be successful in your job and get home in time for dinner with your family. Don’t let your database manage you! Instead let the Expert SQL Server Practices author team show you how to take control, plan for and monitor performance, troubleshoot effectively when things go wrong, and be in control of your SQL Server environment. Goes beyond the manual to cover good techniques and best practices Delivers knowledge usually gained only by hard experience Focuses upon performance, scalability, reliability Helps achieve the predictability needed to be in control at all times What you’ll learn Migrate to the new Extended Events framework for troubleshooting performance problems Automate the tracking of key performance indicators such as available disk space, cpu utilization, index fragmentation, and more Design performance into your database and its applications from the very beginning Manage staged releases from development to test through to production Diagnose resource and performance problems via dynamic management views Analyze I/O patterns and plan reliably to obtain the performance you need Who this book is for Expert SQL Server Practices is aimed at SQL Server professionals who want to further their careers through expert-level practices in performance management, scalability, predictability, and security.
Author: Robert Pearl
Release Date: 2015-06-01
"Robert Pearl, a well-known DBA in the SQL community, explains his holistic vision of a database instance that needs regular check-ups and gives the tools, scripts, and best practices he has collected over the years." Alberto Bolchini, Computing Reviews, May 9, 2016 Healthy SQL is about ensuring the ongoing performance health of a SQL Server database. An unhealthy database is not just an inconvenience; it can bring a business to its knees. And if you are the database administrator, the health of your SQL Server implementation can be a direct reflection on you. It's in everyone's best interest to have a healthy SQL implementation. Healthy SQL is built around the concept of a medical checkup, giving you the tools you need to assess the current health of your database and take action to improve upon that health and maintain good performance to your business. Healthy SQL aids in developing a rigorous routine so that you know how healthy your SQL Server machines are, and how you can keep those same servers healthy and fit for duty. The book is filled with practical advice and a time-tested strategy, helping you put together a regimen that will ensure your servers are healthy, your implementation is fully optimized, your services are redundant and highly available, and you have a plan for business continuity in the event of a disaster. If your current environment doesn't match up with these criteria, then pick up a copy of Healthy SQL today and start your journey on the road to a fit and tight SQL Server deployment.
Author: Ken Henderson
Publisher: Addison-Wesley Professional
Release Date: 2004
bull; Contains the most depth and breadth of coverage of any book on SQL Server architecture, internals, and tuning bull; Will be a key reference for anyone working with SQL Server, no matter what their skill level bull; The latest book in the bestselling series of Guru's Guides from Ken Henderson