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. --
Author: Christian Bolton
Publisher: John Wiley & Sons
Release Date: 2010-06-22
A hands-on resource for SQL Server 2008 troubleshooting methods and tools SQL Server administrators need to ensure that SQL Server remains running 24/7. Authored by leading SQL Server experts and MVPs, this book provides in-depth coverage of best practices based on a deep understanding of the internals of both SQL Server and the Windows operating system. You'll get a thorough look at the SQL Server database architecture and internals as well as Windows OS internals so that you can approach troubleshooting with a solid grasp of the total processing environment. Armed with this comprehensive understanding, readers will then learn how to use a suite of tools for troubleshooting performance problems whether they originate on the database server or operating system side. Topics Covered: SQL Server Architecture Understanding Memory SQL Server Waits and Extended Events Working with Storage CPU and Query Processing Locking and Latches Knowing Tempdb Defining Your Approach To Troubleshooting Viewing Server Performance with PerfMon and the PAL Tool Tracing SQL Server with SQL Trace and Profiler Consolidating Data Collection with SQLDiag and the PerfStats Script Introducing RML Utilities for Stress Testing and Trace File Analysis Bringing It All Together with SQL Nexus Using Management Studio Reports and the Performance Dashboard Using SQL Server Management Data Warehouse Shortcuts to Efficient Data Collection and Quick Analysis Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.
DBA Survivor is a book to help new database administrators understand more about the world of database administration. More and more people are moving into the DBA profession, and many are looking for a getting-started guide. Blogs are written about how to be an exceptional DBA and what to do in your first 100 days. This book takes a different approach, injecting some humor into helping you understand how to hit the ground running, and most importantly how to survive as a DBA. And it’s not just survival that matters. Author Thomas LaRock wants much more for you than mere survival. He wants you to have excellence, competence, visibility, confidence, and service. These are the traits and characteristics of DBAs who truly succeed and become respected in their profession. Don’t settle for just muddling through your job each day. Strive to excel. Aim to make a difference, for your clients, and for your colleagues. Focuses on the soft skills that distinguish truly exceptional DBAs Takes a humorous approach to keep readers engaged Written by a SQL Server "Most Valuable Professional" and board member of PASS
SQL Server Hardware will provide the fundamental knowledge and resources you need to make intelligent decisions about choice, and optimal installation and configuration, of SQL Server hardware, operating system and the SQL Server RDBMS.
"Congratulations! You are going to WIN your next SQL Server interview. “SQL The One” book can guide you to achieve the success in your next interview. This book covers Microsoft SQL Server interview experiences, questions and answers for a range of SQL DBA’s and SQL Server Professionals. All of these questions have been collected from the people who attended interviews at various multinational companies across the world. It also covers “How to prepare for a SQL DBA interview?” and “How to become an expert in your career?” Salient Features of Book All interview questions are asked in various MNC Covers 1090 real time questions and answers 254 questions on SQL Server Performance Tuning Covers all SQL Server HA & DR features 316 questions on SQL Server HA & DR features Lots of scenario based questions Covers SQL Server 2005, 2008, 2008 R2, 2012, 2014 and 2016 Questions are categorized In-depth explanations An Interview Experience with Microsoft Useful as a reference guide for SQL DBA Interview preparation
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. --
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: Sebastian Meine
Publisher: Red Gate Books
Release Date: 2013-08
It is a common requirement to make data that lives on one server available on another. Cross-server queries may be quicker by providing a local copy of the data; data may be made available to resource intensive reporting queries without affecting the OLTP load, maybe even with an intentional delay in synchronization, so that reports run against complete days only; or a complete database may be replicated to a secondary 'standby' server for high availability. In each case, SQL Server Replication is an option. This book provides the hands-on introduction needed to get started and explores all of the technology's most important strengths and weaknesses. It will help the reader decide whether replication meets requirements and which type of replication will be appropriate. It also offers guidance on when to avoid replication in favor of features such as simple log shipping, or the "Always On" feature set. This practical guide illustrates all major concepts with exercises. --
Author: Grant Fritchey
Publisher: Red Gate Books
Release Date: 2012
Every day, out in the various online forums devoted to SQL Server, and on Twitter, the same types of questions come up repeatedly: Why is this query running slowly? Why is SQL Server ignoring my index? Why does this query run quickly sometimes and slowly at others? My response is the same in each case: have you looked at the execution plan? An execution plan describes what's going on behind the scenes when SQL Server executes a query. It shows how the query optimizer joined the data from the various tables defined in the query, which indexes it used, if any, how it performed any aggregations or sorting, and much more. It also estimates the cost of all of these operations, in terms of the relative load placed on the system. Every Database Administrator, developer, report writer, and anyone else who writes T-SQL to access SQL Server data, must understand how to read and interpret execution plans.My book leads you right from the basics of capturing plans, through how to interrupt them in their various forms, graphical or XML, and then how to use the information you find there to diagnose the most common causes of poor query performance, and so optimize your SQL queries, and improve your indexing strategy.
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.
Gain a solid understanding of T-SQL—and write better queries Master the fundamentals of Transact-SQL—and develop your own code for querying and modifying data in Microsoft SQL Server 2012. Led by a SQL Server expert, you’ll learn the concepts behind T-SQL querying and programming, and then apply your knowledge with exercises in each chapter. Once you understand the logic behind T-SQL, you’ll quickly learn how to write effective code—whether you’re a programmer or database administrator. Discover how to: Work with programming practices unique to T-SQL Create database tables and define data integrity Query multiple tables using joins and subqueries Simplify code and improve maintainability with table expressions Implement insert, update, delete, and merge data modification strategies Tackle advanced techniques such as window functions, pivoting and grouping sets Control data consistency using isolation levels, and mitigate deadlocks and blocking Take T-SQL to the next level with programmable objects
In his new book, Brad's Sure Guide to SQL Server Maintenance Plans, Brad McGehee takes you on a comprehensive tour of two SQL Server tools designed to help DBAs ensure that a "required minimum" level of maintenance takes place on their SQL Server instances: the Maintenance Plan Wizard and the Maintenance Plan Designer. Table of Contents * Chapter 01: Why is Database Maintenance Important? Chapter 02: Before you Create any Maintenance Plans Chapter 03: Getting Started with the Maintenance Plan Wizard Chapter 04: Task Scheduling Chapter 05: Check database Integrity Task Chapter 06: Shrink Database Task Chapter 07: Rebuild Index Task Chapter 08: Reorganize Index Task Chapter 09: Update Statistics Task Chapter 10: Execute SQL Server Agent Job Task Chapter 11: History Cleanup Task Chapter 12: Define Back Up Database (Full) Task Chapter 13: Define Back Up Database (Differential) Task Chapter 14: Back Up Database (Transaction Log) Task Chapter 15: Maintenance Cleanup Task Chapter 16: Using the Maintenance Plan Designer Why read this book? Millions of SQL Server instances run in the offices of small and medium-sized organizations and there are many "accidental" DBAs out there whose job it is to maintain them. Often, they find that they don't have the knowledge, experience, or critically the time, to perform the correct level of maintenance on their SQL Server databases, much as they might like to. This can mean poor performance and reduced availability. Regardless of the size of your organization, if your mission critical data becomes unavailable, then business will suffer greatly. The Maintenance Plan Wizard and Designer allow you to configure and schedule eleven core database maintenance tasks, ranging from integrity checks, to database backups, to index reorganizations and rebuilds. Brad walks through every one of these tasks covering: * The intent of each task and why it's important * How to configure each task and what all the options mean * Scheduling considerations: when and how often should you run the task? * Customizing and extended your Maintenance Plans using the Designer Used carefully, these Maintenance Plan tools represent powerful time-saving devices for any DBA. At each stage of the book, Brad explains clearly the correct and incorrect uses for the tool, and indicates where more advanced solutions, using T-SQL or PowerShell scripting, would be more appropriate.
This book will flow in a "Question & Answer" mode from start to finish to help you grasp concepts faster and get to the point quickly. Once you understand the concepts, it gets easier to see twists using that concept within a scenario and to ultimately solve them. Though each of these chapters are geared towards convenience we highly recommend reading each of the sections irrespective of the roles you might be doing since each of the sections have some interesting trivia about working with SQL Server. In the industry the role of accidental DBA's (especially with SQL Server) is very common. Hence if you have performed the role of DBA for a short stint and want to brush-up your fundamentals then the upcoming sections will be a great review.
Delve inside the core SQL Server engine—and put that knowledge to work—with guidance from a team of well-known internals experts. Whether database developer, architect, or administrator, you’ll gain the deep knowledge you need to exploit key architectural changes—and capture the product’s full potential. Discover how SQL Server works behind the scenes, including: What happens internally when SQL Server builds, expands, shrinks, and moves databases How to use event tracking—from triggers to the Extended Events Engine Why the right indexes can drastically reduce your query execution time How to transcend normal row-size limits with new storage capabilities How the Query Optimizer operates Multiple techniques for troubleshooting problematic query plans When to force SQL Server to reuse a cached query plan—or create a new one What SQL Server checks internally when running DBCC How to choose among five isolation levels and two concurrency models when working with multiple concurrent users
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.