Академический Документы
Профессиональный Документы
Культура Документы
The information contained in this document represents the current view of Microsoft Corporation on the
issues discussed as of the date of publication. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot
guarantee the accuracy of any information presented after the date of publication.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN
THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights
under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval
system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights
covering subject matter in this document. Except as expressly provided in any written license agreement
from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks,
copyrights, or other intellectual property.
The descriptions of other companies products in this document, if any, are provided only as a convenience
to you. Any such references should not be considered an endorsement or support by Microsoft. Microsoft
cannot guarantee their accuracy, and the products may change over time. Also, the descriptions are
intended as brief highlights to aid understanding, rather than as thorough coverage. For authoritative
descriptions of these products, please consult their respective manufacturers.
2013 Microsoft Corporation. All rights reserved. Any use or distribution of these materials without express
authorization of Microsoft Corp. is strictly prohibited.
Microsoft and Windows are either registered trademarks of Microsoft Corporation in the United States
and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their respective
owners.
Page ii
Executive Summary
The purpose of this document is to provide a single reference point for those wishing to gain
a better understanding of SQL Server. This document will be updated over time, but please
ensure that you personally check for the latest updates to the material covered. By this we
mean, suggestions can change over time and from one service pack to another. Ensure you
learn the latest recommendations to be up to date and best placed to assist customers.
The key aims of this guide are to:
1. Provide a single source of information that can help you learn the key concepts of SQL
Server.
2. Provide an overview of key SQL Server components
3. Highlight dependencies and other information that an SQL Server engineer would need
to know
3|Page
Table of Contents
Executive Summary ............................................................................................................................................................ 3
1 Installing and Configuring SQL Server ................................................................................................................. 5
2 Maintaining SQL Server Instances ......................................................................................................................... 6
2.1 SQL Server backup and restore ..................................................................................................................................... 6
2.2 SQL Server Security ............................................................................................................................................................. 6
2.3 SQL Server Maintenance Plans: ..................................................................................................................................... 8
3 Performing Data Management Tasks ................................................................................................................. 10
3.1 Data import/export options in SQL Server : .......................................................................................................... 10
Data compression on SQL Server ....................................................................................................................................... 10
3.2 Managing Indexes: ........................................................................................................................................................... 10
Collations best practice: ......................................................................................................................................................... 11
4 Monitoring and Troubleshooting SQL Server .................................................................................................. 12
4.1 SQL Server monitoring: .................................................................................................................................................. 12
5 Optimizing SQL Server Performance .................................................................................................................. 13
5.1 Resource Governor: ......................................................................................................................................................... 13
5.2 Extended Events in SQL Server: .................................................................................................................................. 13
6 SQL Server High Availability ................................................................................................................................. 15
6.1 SQL Server Clustering: .................................................................................................................................................... 15
6.2 SQL Server Database mirroring: ................................................................................................................................. 15
6.3 SQL Server Replication: .................................................................................................................................................. 17
6.4 Storage and Capacity Planning for SQL Server: ................................................................................................... 19
4|Page
5|Page
The SQL Server backup and restore component provides an essential safeguard for protecting critical
data stored in your SQL Server databases. To minimize the risk of catastrophic data loss, you need to
back up your databases to preserve modifications to your data on a regular basis. A well-planned
backup and restore strategy helps protect databases against data loss caused by a variety of failures.
Basics of backup and restore of databases,
http://msdn.microsoft.com/en-us/library/ms187048.aspx
How backup and recovery works in SQL Server,
http://msdn.microsoft.com/en-us/library/ms187048.aspx
SQL Server: Recovering from Disasters Using Backups
http://technet.microsoft.com/en-us/magazine/ee677581.aspx
Best practice recommendations in database backup in SQL Server,
http://support.microsoft.com/kb/2027537
Internals: How does SQL Server Backup and Restore select transfer sizes
http://blogs.msdn.com/b/psssql/archive/2008/02/06/how-it-works-how-does-sql-serverbackup-and-restore-select-transfer-sizes.aspx
Clearing some myths on backup and restore,
http://sqlskills.com/BLOGS/PAUL/post/A-SQL-Server-DBA-myth-a-day-(3030)-backupmyths.aspx
Tuning the Performance of Backup Compression in SQL Server 2008
http://sqlcat.com/sqlcat/b/technicalnotes/archive/2008/04/21/tuning-the-performance-ofbackup-compression-in-sql-server-2008.aspx
Some known issues in backup/restore discussed,
http://blogs.msdn.com/b/sqlserverfaq/archive/tags/backup/
2.2
This session is about discussing the SQL Server 2008 Security best practices from Operational
and administration point of view
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2008/techtalk_61
This whitepaper brings together the recommended best practices for security in SQL Server
2005 environment,
SQL Server 2005 Security Best Practices: Operational and Administrative Tasks
6|Page
7|Page
2.3
Maintenance plans create a workflow of the tasks required to make sure that your database is
optimized, is backed up on a regular basis, and is free of inconsistencies. Maintenance plans create an
Integration Services package that is run by a SQL Server Agent job. These maintenance tasks can be
run manually or automatically at scheduled intervals. You can use the Maintenance Plan Wizard to
create core maintenance plans, but creating plans manually gives you more flexibility.
8|Page
9|Page
3.2
Managing Indexes:
Best practices white paper on the indexing and the advantage/disadvantage of using clustered
index and non-clustered indexes.
http://msdn.microsoft.com/en-us/library/cc917672.aspx
Partitioned table and index strategies in SQL Server 2008
http://download.microsoft.com/download/D/B/D/DBDE7972-1EB9-470A-BA1858849DB3EB3B/PartTableAndIndexStrat.docx
10 | P a g e
11 | P a g e
There are a variety of tools and techniques that can be used to monitor Microsoft SQL Server.
Understanding how to monitor SQL Server can help you. There are 3rd party tools to monitor the SQL
Server but we will provide only the ones that are available in SQL server itself and not the outside
tools.
Perf monitoring how to topics listed,
http://msdn.microsoft.com/en-us/library/ms187830(v=sql.105).aspx
How to use activity monitor to check the sql server details,
http://msdn.microsoft.com/en-us/library/hh212951
How to use the system monitor to monitor the resource usage on Windows server, including the
SQL Server components,
http://msdn.microsoft.com/en-us/library/ms191246.aspx
Monitor SQL Server log shipping,
http://msdn.microsoft.com/en-us/library/ms190224.aspx
Guidance on how to monitor the SQL Server performance,
http://msdn.microsoft.com/en-us/library/ee377023(v=bts.10).aspx
12 | P a g e
Resource Governor:
Resource Governor enables you to manage SQL Server workloads and resources by specifying limits
on resource consumption by incoming requests. In the Resource Governor context, workload is a set
of similarly sized queries or requests that can, and should be, treated as a single entity. This is not a
requirement, but the more uniform the resource usage pattern of a workload is, the more benefit you
are likely to derive from Resource Governor. Resource limits can be reconfigured in real time with
minimal impact on workloads that are executing.
The how and what concepts of resource governor explained here,
http://technet.microsoft.com/en-us/library/bb933866.aspx
This whitepaper discusses about the methods on how to use the SQL server resource governor,
http://msdn.microsoft.com/en-us/library/ee151608(v=sql.100).aspx
Some good questions about the resource governor answered here by the support team,
http://blogs.msdn.com/b/psssql/archive/2008/01/10/sql-server-2008-resource-governorquestions.aspx
5.2
Extended Events (Extended Events) is a general event-handling system for server systems. The
Extended Events infrastructure supports the correlation of data from SQL Server, and under certain
conditions, the correlation of data from the operating system and database applications. In the latter
case, Extended Events output must be directed to Event Tracing for Windows (ETW) to correlate the
event data with operating system or application event data.
Extended Events is a highly scalable and highly configurable architecture that allows users to collect as
much or as little information as is necessary to troubleshoot or identify a performance problem. SQL
Server Extended Events (Extended Events) builds on existing concepts, such as an event or an event
consumer, uses concepts from Event Tracing for Windows, and introduces new concepts.
Extended events basics and concepts explained,
http://technet.microsoft.com/en-us/library/bb630282.aspx
Jonathan kehayias has done a series of blogs for the extended events which is a great learning
series for the beginners,
http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/12/01/a-xevent-a-day-31-days-ofextended-events.aspx
Extended events object model is explained in detail by the program manager for xevents in SQL
Server team,
http://blogs.msdn.com/b/extended_events/archive/2011/01/20/introducing-the-extendedevents-object-model.aspx
13 | P a g e
How to use the new Extended events user interface in SQL Server 2012,
http://blogs.msdn.com/b/extended_events/archive/2011/07/13/introducing-the-extendedevents-user-interface.aspx
From SQL Server 2012 onwards, extended events replaces SQL profiler trace for the data
collection activities. SQL profiler is already a handy tool for the DBA during the troubleshooting.
So refer to this article which talks about how to ease the pain of migrating to extended events
from profiler traces.
http://blogs.msdn.com/b/extended_events/archive/2010/12/10/migrating-from-sql-trace-toextended-events.aspx
14 | P a g e
6.2
Database mirroring maintains two copies of a single database that must reside on different server
instances of SQL Server Database Engine. Typically, these server instances reside on computers in
different locations. Starting database mirroring on a database, initiates a relationship, known as a
database mirroring session, between these server instances
15 | P a g e
A basic database mirroring configuration mentioned above with principal, witness and mirror being
separate instances.
Database mirroring technology overview,
http://technet.microsoft.com/en-us/library/cc917680.aspx
Database Mirroring Best Practices and Performance Considerations
http://technet.microsoft.com/en-us/library/cc917681.aspx
Database mirroring and log shipping details and comparisons explained,
http://msdn.microsoft.com/en-us/library/ms187016.aspx
Troubleshooting guide for setting up database mirroring,
http://msdn.microsoft.com/en-us/library/ms189127.aspx
Database Mirroring and Log Shipping Working Together
http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx
Implementing Application Failover with Database Mirroring:
http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx
Database Mirroring Best Practices and Performance Considerations
http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx
Database Mirroring FAQ:
http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirfaq.mspx
Performance Boost for Database Mirroring:
http://www.sqlskills.com/blogs/paul/post/SQL-Server-2008-Performance-boost-for-DatabaseMirroring.aspx
(Some of these were written for SQL 2005 but still apply to SQL 2008 and later)
16 | P a g e
6.3
17 | P a g e
18 | P a g e
6.4
19 | P a g e
20 | P a g e
21 | P a g e