You are on page 1of 127

Administering and

Automating Microsoft®
SQL Server™ 2005
Databases and Servers
Delivery Guide
Course Number: 2789

MCT USE ONLY. STUDENT USE PROHIBITED


Beta
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. 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.

© 2005 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows NT, <plus other appropriate product names or titles.
The publications specialist replaces this example list with the list of trademarks provided by the
copy editor. Microsoft, MS-DOS, Windows, and Windows NT are listed first, followed by all
other Microsoft trademarks listed in alphabetical order.> are either registered trademarks or
trademarks of Microsoft Corporation in the U.S.A. and/or other countries.

<The publications specialist inserts mention of specific, contractually obligated to, third-party
trademarks, provided by the copy editor>

The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.

Beta

MCT USE ONLY. STUDENT USE PROHIBITED


Administering and Automating Microsoft® SQL Server™ 2005 Databases and Servers iii

Contents

MCT USE ONLY. STUDENT USE PROHIBITED


MCT USE ONLY. STUDENT USE PROHIBITED
About This Course
This section provides you with a brief description of the course, audience,
suggested prerequisites, and course objectives.
Description
Audience
Student prerequisites This course requires that students meet the following prerequisites:
„

Course objectives After completing this course, the student will be able to:
„

MCT USE ONLY. STUDENT USE PROHIBITED


2 Error! No text of specified style in document.

Course Timing
The following schedule is an estimate of the course timing. Your timing may
vary.

Day 1
Start End Module
9:00 9:30 Introduction
Module x: Title
Break
Lab x: Title
Lunch
Lab x: Title (continued)
Break

4:00

Day 2
Start End Module
9:00 9:30 Day 1 review

Break

Lunch

Break

4:00

MCT USE ONLY. STUDENT USE PROHIBITED


Error! No text of specified style in document. 3

Day 3
Start End Module
9:00 9:30 Day 2 review

Break

Lunch

Break

4:00

Day 4
Start End Module
9:00 9:30 Day 3 review

Break

Lunch

Break

4:00

Day 5
Start End Module
9:00 9:30 Day 4 review

Break

Lunch

Break

4:00

MCT USE ONLY. STUDENT USE PROHIBITED


4 Error! No text of specified style in document.

Trainer Materials Compact Disc Contents


The Trainer Materials compact disc contains the following files and folders:
„ Autorun.inf. When the compact disc is inserted into the compact disc drive,
this file opens StartCD.exe.
„ Default.htm. This file opens the Trainer Materials Web page.
„ Readme.txt. This file explains how to install the software for viewing the
Trainer Materials compact disc and its contents and how to open the Trainer
Materials Web page.
„ StartCD.exe. When the compact disc is inserted into the compact disc drive,
or when you double-click the StartCD.exe file, this file opens the compact
disc and allows you to browse the Trainer Materials compact disc.
„ StartCD.ini. This file contains instructions to launch StartCD.exe.
„ xxxxz_ms.doc. This file is the Manual Classroom Setup Guide. It contains
the steps for manually setting up the classroom computers.
„ xxxxz_sg.doc. This file is the Automated Classroom Setup Guide. It contains
a description of classroom requirements, classroom configuration,
instructions for using the automated classroom setup scripts, and the
Classroom Setup Checklist.
„ Errorlog. This folder may contain an error log.
„ Powerpnt. This folder contains the Microsoft PowerPoint® slides that are
used in this course.
„ Pptview. This folder contains the Microsoft PowerPoint Viewer, which can
be used to display the PowerPoint slides if Microsoft PowerPoint 2002 is
not available. Do not use this version in the classroom.
„ Setup. This folder contains the files that install the course and related
software to computers in a classroom setting.
„ Student. This folder contains the Web page that provides students with links
to resources pertaining to this course, including additional reading, review
and lab answers, lab files, multimedia presentations, and course-related Web
sites.
„ Tprep. This folder contains the Trainer Preparation Presentation for this
course. Review these materials before teaching this course.
„ Webfiles. This folder contains the files that are required to view the course
Web page. To open the Web page, open Windows Explorer, and in the root
directory of the compact disc, double-click StartCD.exe.

MCT USE ONLY. STUDENT USE PROHIBITED


Error! No text of specified style in document. 5

Student Materials Compact Disc Contents


The Student Materials compact disc contains the following files and folders:
„ Autorun.inf. When the compact disc is inserted into the compact disc drive,
this file opens StartCD.exe.
„ Default.htm. This file opens the Student Materials Web page. It provides
you with resources pertaining to this course, including additional reading,
review and lab answers, lab files, multimedia presentations, and course-
related Web sites.
„ Readme.txt. This file explains how to install the software for viewing the
Student Materials compact disc and its contents and how to open the
Student Materials Web page.
„ StartCD.exe. When the compact disc is inserted into the compact disc drive,
or when you double-click the StartCD.exe file, this file opens the compact
disc and allows you to browse the Trainer Materials compact disc.
„ StartCD.ini. This file contains instructions to launch StartCD.exe.
„ xxxxz_ms.doc. This file is the Manual Classroom Setup Guide. It contains a
description of classroom requirements, classroom setup instructions, and the
classroom configuration.
„ Addread. This folder contains additional reading pertaining to this course.
„ Appendix. This folder contains appendix files for this course.
„ Democode. This folder contains demonstration code.
„ Flash. This folder contains the installer for the Macromedia Flash browser
plug-in.
„ Fonts. This folder contains fonts that may be required to view the Microsoft
Word documents that are included with this course.
„ Jobaids. This folder contains the job aids pertaining to this course.
„ Labfiles. This folder contains files that are used in the hands-on labs. These
files may be used to prepare the student computers for the hands-on labs.
„ Media. This folder contains files that are used in multimedia presentations
for this course.
„ Mplayer. This folder contains the setup file to install Microsoft Windows
Media® Player.
„ Practices. This folder contains files that are used in the hands-on practices.
„ Sampapps. This folder contains the sample applications associated with this
course.
„ Sampcode. This folder contains sample code that is accessible through the
Web pages on the Student Materials compact disc.
„ Webfiles. This folder contains the files that are required to view the course
Web page. To open the Web page, open Windows Explorer, and in the root
directory of the compact disc, double-click StartCD.exe.
„ Wordview. This folder contains the Word Viewer that is used to view any
Word document (.doc) files that are included on the compact disc.

MCT USE ONLY. STUDENT USE PROHIBITED


6 Error! No text of specified style in document.

Document Conventions
The following conventions are used in course materials to distinguish elements
of the text.
Convention Use

Bold Represents commands, command options, and syntax that must


be typed exactly as shown. It also indicates commands on menus
and buttons, dialog box titles and options, and icon and menu
names.
Italic In syntax statements or descriptive text, indicates argument
names or placeholders for variable information. Italic is also
used for introducing new terms, for book titles, and for emphasis
in the text.
Title Capitals Indicate domain names, user names, computer names, directory
names, and folder and file names, except when specifically
referring to case-sensitive names. Unless otherwise indicated,
you can use lowercase letters when you type a directory name or
file name in a dialog box or at a command prompt.
ALL CAPITALS Indicate the names of keys, key sequences, and key
combinations — for example, ALT+SPACEBAR.
monospace Represents code samples or examples of screen text.
[] In syntax statements, enclose optional items. For example,
[filename] in command syntax indicates that you can choose to
type a file name with the command. Type only the information
within the brackets, not the brackets themselves.
{} In syntax statements, enclose required items. Type only the
information within the braces, not the braces themselves.
| In syntax statements, separates an either/or choice.
Ç Indicates a procedure with sequential steps.
... In syntax statements, specifies that the preceding item may be
repeated.
. Represents an omitted portion of a code sample.
.
.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction
Time estimated:
Presentation: 30 minutes
Table of contents
Module 0: Introduction ........................................................................................................................... 1
At the end of this module, you will be able to describe this course and its purpose. ................. 2
Introduction ........................................................................................................................................ 3
Introduce yourself, and provide a brief description of your background. ................................... 3
Course Materials ............................................................................................................................. 4
Identify and describe the course materials .................................................................................. 4
Microsoft Learning Product Types ................................................................................................. 6
Facilities.......................................................................................................................................... 8
Inform students of class logistics and rules for the training site. ................................................ 8
Microsoft Learning ......................................................................................................................... 9
Describe other Microsoft learning courses related to this one. ................................................... 9
Microsoft Certification Program ................................................................................................... 10
Fact: Describe certifications for which this course helps you prepare...................................... 10
About This Course ........................................................................................................................ 13
Describe the audience prerequisites and objectives for this course. ......................................... 13
Course Outline .............................................................................................................................. 15
Describe the course outline ....................................................................................................... 15
Setup ............................................................................................................................................. 16
Describe the student computer configuration for this course.................................................... 16
Demonstration: Using Virtual PC ................................................................................................. 18
Describe how to use Virtual PC ................................................................................................ 18
Expectations for This Course ........................................................................................................ 20
Describe the expectations for this course.................................................................................. 20
What Matters Most in This Course? ............................................................................................. 21
Describe what matters most in this course. ............................................................................... 21
Introduction to Adventure Works Cycles ..................................................................................... 23
Describe the fictitious company used in the lab scenarios ........................................................ 23

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 2

At the end of this module, you will be able to describe this course and its purpose.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 3

Introduction

Introduce yourself, and provide a brief description of your background.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 4

Course Materials

Identify and describe the course materials


Course kit
The following materials are included with your kit:
Name card
Write your name on both sides of the name card.
Student workbook
The student workbook contains the material covered in class, in addition to the hands-on lab
exercises.
Student Materials compact disc
The Student Materials compact disc (CD) contains the Web page that provides links to resources
pertaining to this course, including additional reading, review and lab answers, lab files,
multimedia presentations, and course-related Web sites. To open the Web page, insert the Student
Materials CD into the CD-ROM drive, and then, in the root directory of the CD, double-click
Autorun.exe or Default.htm.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 5

Course evaluation
You will have the opportunity to provide feedback about the course, training facility, and
instructor by completing an online evaluation near the end of the course.
Document conventions
The following conventions are used in course materials to distinguish elements of the text.

Convention Use
Bold Represents commands, command options, and syntax that
must be typed exactly as shown. It also indicates commands
on menus and buttons, and indicates dialog box titles and
options, and icon and menu names.
Italic In syntax statements or descriptive text, indicates argument
names or placeholders for variable information. Italic is also
used for introducing new terms, for book titles, and for
emphasis in the text.
Title Capitals Indicate domain names, user names, computer names,
directory names, and folder and file names, except when
specifically referring to case-sensitive names. Unless
otherwise indicated, you can use lowercase letters when you
type a directory name or file name in a dialog box or at a
command prompt.
ALL CAPITALS Indicate the names of keys, key sequences, and key
combinations — for example, ALT+SPACEBAR.
try/Try Keywords in Microsoft® Visual C#® and Visual Basic®
.NET are separated by a forward slash when casing differs.
monospace Represents code samples or examples of screen text.
[] In syntax statements, enclose optional items. For example,
[filename] in command syntax indicates that you can choose
to type a file name with the command. Type only the
information within the brackets, not the brackets themselves.
{} In syntax statements, enclose required items. Type only the
information within the braces, not the braces themselves.
| In syntax statements, separates an either/or choice.

Ç Indicates a procedure with sequential steps.

... In syntax statements, specifies that the preceding item may


be repeated. It also represents an omitted portion of a code
sample.

Providing feedback
To provide additional comments or feedback about the course, send e-mail to
support@mscourseware.com. To ask about the Microsoft Certification Program, send e-mail to
mcphelp@microsoft.com.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 6

Microsoft Learning Product Types

Fact: Describe the different kinds of Microsoft Learning products.


Microsoft Learning product types
Microsoft Learning offers four instructor-led Official Microsoft Learning Product types. Each type is
specific to a particular audience and level of experience. The various product types also tend to suit
different learning styles. These types are as follows:
Courses are for information technology (IT) professionals and developers who are new to a particular
product or technology and for experienced individuals who prefer to learn in a traditional classroom
format. Courses provide a relevant and guided learning experience that combines lecture and practice
to deliver thorough coverage of a Microsoft product or technology. Courses are designed to address
the needs of learners engaged in the planning, design, implementation, management, and support
phases of the technology adoption lifecycle. They provide detailed information by focusing on
concepts and principles, reference content, and in-depth, hands-on lab activities to ensure knowledge
transfer. Typically, the content of a course is broad, addressing a wide range of tasks necessary for the
job role.
Workshops are for knowledgeable IT professionals and developers who learn best by doing and
exploring. Workshops provide a hands-on learning experience in which participants can use Microsoft
products in a safe and collaborative environment based on real-world scenarios. Workshops are the
learning products in which students learn by doing through scenario and through troubleshooting
hands-on labs, targeted reviews, information resources, and best practices, with instructor facilitation.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 7

Clinics are for IT professionals, developers, and technical decision makers. Clinics offer a detailed
presentation that may describe the features and functionality of an existing or new Microsoft product
or technology, provide guidelines and best practices for decision making, and/or showcase product
demonstrations and solutions. Clinics focus on how specific features will solve business problems.
Stand-alone Hands-On Labs provide IT professionals and developers with hands-on experience with
an existing or new Microsoft product or technology. Hands-on labs provide a realistic and safe
environment to encourage knowledge transfer by learning through doing. The labs provided are
completely prescriptive so that no lab answer keys are required. There is very little lecture or text
content provided in hands-on labs, aside from lab introductions, context setting, and lab reviews.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 8

Facilities

Inform students of class logistics and rules for the training site.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 9

Microsoft Learning

Describe other Microsoft learning courses related to this one.


Introduction
Microsoft Learning develops Official Microsoft Learning Products for computer professionals who
use Microsoft products and technologies to design, develop, support, implement, or manage solutions.
These learning products provide comprehensive, skills-based training in instructor-led and online
formats.
Related courses
Each course relates in some way to another course. A related course might be a prerequisite, a follow-
up course in a recommended series, or a course that offers additional training.
Other related courses might become available in the future, so for up-to-date information about
recommended courses, visit the Microsoft Learning Web site.
Microsoft Learning information
For more information, visit the Microsoft Learning Web site at http://www.microsoft.com/learning/.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 10

Microsoft Certification Program

Fact: Describe certifications for which this course helps you prepare.
Introduction
Microsoft Learning offers a variety of certification credentials for developers and IT professionals.
The Microsoft Certified Professional (MCP) program is the leading certification program for
validating your experience and skills, keeping you competitive in today’s changing business
environment.
Related certification exams
This course helps students to prepare for:
• Exam 70–431: TS: Microsoft® SQL Server™ 2005 - Implementation and Maintenance
• Exam 70–444: PRO: Optimizing and Maintaining a Database Administration Solution by
Using Microsoft SQL Server 2005

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 11

MCP certifications
The Microsoft Certified Professional program includes the following certifications.
MCDST on Microsoft Windows®
The Microsoft Certified Desktop Support Technician (MCDST) certification is designed for
professionals who successfully support and educate end users and troubleshoot operating system
and application issues on desktop computers running the Windows operating system.
MCSA on Microsoft Windows Server™ 2003
The Microsoft Certified Systems Administrator (MCSA) certification is designed for
professionals who implement, manage, and troubleshoot existing network and system
environments based on the Windows Server 2003 platform. Implementation responsibilities
include installing and configuring parts of systems. Management responsibilities include
administering and supporting systems.
MCSE on Microsoft Windows Server 2003
The Microsoft Certified Systems Engineer (MCSE) credential is the premier certification for
professionals who analyze business requirements and design and implement infrastructure for
business solutions based on the Windows Server 2003 platform. Implementation responsibilities
include installing, configuring, and troubleshooting network systems.
MCAD
The Microsoft Certified Application Developer (MCAD) for Microsoft .NET credential is
appropriate for professionals who use Microsoft technologies to develop and maintain
department-level applications, components, Web or desktop clients, or back-end data services, or
who work in teams developing enterprise applications. This credential covers job tasks ranging
from developing to deploying and maintaining these solutions.
MCSD
The Microsoft Certified Solution Developer (MCSD) credential is the premier certification for
professionals who design and develop leading-edge business solutions with Microsoft
development tools, technologies, platforms, and the Microsoft Windows DNA architecture. The
types of applications that MCSDs can develop include desktop applications and multiuser, Web-
based, N-tier, and transaction-based applications. The credential covers job tasks ranging from
analyzing business requirements to maintaining solutions.
MCDBA on Microsoft SQL Server™ 2000
The Microsoft Certified Database Administrator (MCDBA) credential is the premier certification
for professionals who implement and administer SQL Server databases. The certification is
appropriate for individuals who derive physical database designs, develop logical data models,
create physical databases, create data services by using Transact-SQL, manage and maintain
databases, configure and manage security, monitor and optimize databases, and install and
configure SQL Server.
MCP
The Microsoft Certified Professional (MCP) credential is for individuals who have the skills to
successfully implement a Microsoft product or technology as part of a business solution in an
organization. Hands-on experience with the product is necessary to successfully achieve
certification.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 12

MCT
Microsoft Certified Trainers (MCTs) demonstrate the instructional and technical skills that qualify
them to deliver Official Microsoft Learning Products through a Microsoft Certified Partner for
Learning Solutions (CPLS).
Certification requirements
Certification requirements differ for each certification category and are specific to the products and
job functions addressed by the certification. To become a Microsoft Certified Professional, you must
pass rigorous certification exams that provide a valid and reliable measure of technical proficiency
and expertise.

For More Information


See the Microsoft Learning Web site at http://www.microsoft.com/learning/.

You can also send e-mail to mcphelp@microsoft.com if you have specific certification questions.
Acquiring the skills tested by an MCP exam
Official Microsoft Learning Products can help you develop the skills that you need to do your job.
They also complement the experience that you gain while working with Microsoft products and
technologies. However, no one-to-one correlation exists between Official Microsoft Learning
Products and MCP exams. Microsoft does not expect or intend for the courses to be the sole
preparation method for passing MCP exams. Practical product knowledge and experience is also
necessary to pass MCP exams.
To help prepare for MCP exams, use the preparation guides that are available for each exam. Each
Exam Preparation Guide contains exam-specific information, such as a list of the topics on which you
will be tested. These guides are available on the Microsoft Learning Web site at
http://www.microsoft.com/learning/.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 13

About This Course

Describe the audience prerequisites and objectives for this course.


Description
The purpose of this 1-day course is to teach database administrators working in enterprise
environments to administer and automate databases and servers. It emphasizes that students should
think about their whole environment, including business needs; and network, systems, and database
considerations during design.
Audience
The audience of this course is professional-level database administrators (DBAs).
Course prerequisites
This course has the following prerequisites:
• Must understand how replication works and how replication is implemented.
• Must have working knowledge of source control software. Specifically, what it is used for
and how it works.
• Must have working knowledge of networking. Specifically, how to isolate a failure to
identify where a failure is occurring.
• Must have basic working knowledge of security infrastructures. Specifically, Active
Directory infrastructure.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 14

• Must have some experience with database design. Specifically, they must fully understand
Third Normal Form (3NF), be able to design a database to 3NF (fully normalized), and know
the tradeoffs when backing out of the fully normalized design (denormalization; that is,
designing for performance and or business requirements). They should also be familiar with
specific design models, such as Star and Snowflake schemas.
• Must have basic monitoring and troubleshooting skills.
• Must have working 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 the interaction between the operating system and the database.
• Must have basic knowledge of application architecture. That is, how applications can be
designed in three layers, what applications can do, interactions between applications and the
database, and interactions between the database and the platform or operating system.
• Must know how to use:
o Third-party database administration and management tools
o Source control software
• Must have been exposed to the new features and terminology of Microsoft SQL Server
2005.
Important
This learning product will be most useful to people who are already working in the job role of
Database Administrator and who intend to use their new skills and knowledge on the job immediately
after training.
Course objectives
After completing the course, you will be able to:
• Manage and automate databases and servers.
• Manage supporting services.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 15

Course Outline

Describe the course outline


Course outline
Module 1: Managing and Automating Databases and Servers provides you the guidelines and
considerations for planning automated systems for databases and servers. This module also provides
you the knowledge required to maintain a run book.
Module 2: Managing SQL Server Supporting Services introduces the concept of SSIS packages and
provides the guidelines to deploy and manage SSIS packages. This module also provides the
guidelines and considerations for maintaining replication and reporting services.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 16

Setup

Describe the student computer configuration for this course


Virtual PC configuration
In this course, you will use Microsoft Virtual PC 2004 to perform the hands-on practices and labs.
There is one virtual machine for each module, and the virtual machines are named 2789A-MIA-SQL-
nn, where nn is the module number.

Important
If, when performing the hands-on activities, you make any changes to the virtual machine and do not
want to save them, you can close the virtual machine without saving the changes. This will take the
virtual machine back to the most recently saved state. To close a virtual machine without saving the
changes, perform the following steps: 1. On the virtual machine, on the Action menu, click Close. 2.
In the Close dialog box, in the What do you want the virtual machine to do? list, click Turn off
and delete changes, and then click OK.

If you save changes, any operation that affects system configuration or files on drive C will be
persisted between modules, but each module has its own D drive.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 17

Software configuration
The classroom computers use the following software:
• Microsoft Windows Server 2003
• Microsoft SQL Server 2005
• Microsoft Office 2003.
Course files
There are files associated with the demonstrations, practices, and labs in this course. The files are
located on each student computer, on drive D.
Classroom setup
Each classroom computer will have the same virtual machine configured in the same way. Windows
Server 2003 is installed in a workgroup and has the server name MIAMI. Three instances of SQL
Server 2005 are installed: a default instance and two named instances with the names
SQLINSTANCE1 and SQLINSTANCE2.
Course hardware level
To ensure a satisfactory student experience, Microsoft Learning requires a minimum equipment
configuration for trainer and student computers in all Microsoft Certified Partner for Learning
Solutions (CPLS) classrooms in which Official Microsoft Learning Products are used. This course
requires computers that meet or exceed the following specification:

Component Requirement

Processor Pentium III or equivalent personal computer with processor speed greater than or equal to 1 GHz

Hard Disk At least 18 GB 7200 RPM; larger drives are recommended where storage of multiple–Virtual PC courses
is desired.

RAM At least 1 GB

DVD/CD CD-ROM/DVD

Network Adapter 10/100 Mb/s required** full duplex

Sound Card yes

Video Adapter At least 4 MB

Monitor Super VGA monitor (17 inch/ 43 cm)

Ports PCI bus must meet 2.1 specs

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 18

Demonstration: Using Virtual PC

Describe how to use Virtual PC


Virtual PC demonstration
In this demonstration, your instructor will help familiarize you with the Virtual PC environment in
which you will work to complete the practices and labs in this course. You will learn:
• How to start Virtual PC.
• How to start a virtual machine.
• How to log on to a virtual machine.
• How to switch between full screen and window modes.
• How to distinguish the virtual machines that are used in the practices for this course.
• That the virtual machines can communicate with each other and with the host computer, but
they cannot communicate with computers that are outside the virtual environment. (For
example, no Internet access is available from the virtual environment.)
• How to close Virtual PC.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 19

Keyboard shortcuts
While working in the Virtual PC environment, you might find it helpful to use keyboard shortcuts. All
Virtual PC shortcuts include a key that is referred to as the HOST key or the RIGHT-ALT key. By
default, the HOST key is the ALT key on the right side of your keyboard. Some useful shortcuts
include:
• RIGHT-ALT+DELETE to log on to the Virtual PC.
• RIGHT-ALT+ENTER to switch between full-screen and window modes.
• RIGHT-ALT+RIGHT ARROW to display the next virtual machine.
For more information about using Virtual PC, see Virtual PC Help.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 20

Expectations for This Course

Describe the expectations for this course.


Expectations
This course will prepare you for the job of designing SQL Server maintenance and automation
strategies. Also, the strategies are not presented as rules because they can implemented in a number of
different ways. Finally, the class is a collaborative experience and you will get more out of it if you
fully participate and are willing to share previous experiences with the class.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 21

What Matters Most in This Course?

Describe what matters most in this course.


Introduction
The design of this course emphasizes a number of key topics and skills. The following table
summarizes the types of learning you will be doing and the associated skills you will acquire by the
end of the course. The course is an intensive one day course and concentrates on knowledge and skills
that can be put into immediate practice in automating the administration and maintenance of SQL
Server 2005 databases and servers in enterprise environments.

Categories Achievement targets for this title (and proposed place to teach and/or reinforce)
Most important o Best practices for administering and managing SSIS packages (Module 2)
conceptual o Best practices for administering and managing RS packages (Module 2)
knowledge and o Best practices for administering and managing replication (Module 2)
understanding o Good change control strategies (Module 1)
o Methods for automating the management of large numbers of servers (Module 1)
o The ramifications of server maintenance on performance and availability (e.g.,
index rebuilds) (Module 1)
o The role of automation in increasing productivity. Management takes a lot of time,
need to automate daily activities. (Module 1 and 2)
o

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 22

Categories Achievement targets for this title (and proposed place to teach and/or reinforce)
Most important o Deciding which types of tasks can benefit from automation and which can’t
problems for (Module 1)
students to solve o Maximize the availability and minimize the performance impact of server
maintenance (Module 1 and 2)
o Managing development, test, and product databases (Module 1)

Most important o Design change management procedures (Module 1)


classroom o Design and implement a database maintenance strategy (Module 1)
performance skills o Manage packages (Module 2)
(instructor, others, o Manage reports (Module 2)
or self must be able o Manage replication (Module 2)
to observe this skill
being performed)
Most important o Database run book (a personal log) (Module 1)
products to create o Database maintenance strategy document (Module 1)
during the class o Database change control solution (Module 1)

Most important o Attention to detail, meticulous


dispositions o Ability to handle significant pressure and responsibility
(attitudes, interests, o Ability to say no to developers
beliefs) o Understanding the importance of the data and protecting it; stewardship

Note to design team Due to the time constraints of our courses, students do NOT need
to demonstrate these dispositions (or even agree with them). However, for ILT, this
information should at least be communicated to instructors, who can share this
information with students, watch for these things during learner activities, and praise
students individually for what they see them demonstrate. This information could also
be shared with students via a “What Matters Most” appendix or some other way.

Important
As the course progresses, if you feel that you have not adequately learned something mentioned in this
table, ask questions of the instructor and your peers until you are satisfied that you understand a
concept or know how to do something. Also, you will not be able to learn everything you need to do
this complex job in a one-day course. Take note of the recommended additional reading included
throughout the course, and schedule yourself some additional time to read the supplementary
materials. Your instructor and peers will have additional and more up-to-date ideas about where to go
for additional information. Ask them about additional resources that you can use after class.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 23

Introduction to Adventure Works Cycles

Describe the fictitious company used in the lab scenarios


Introduction
Adventure Works Cycles is a dynamically evolving company undergoing rapid growth. It has a
number of offices and changing database requirements. During this course, you will work with a
number of different issues that are facing Adventure Works Cycles to address the problems that its
growth is creating, particularly with regard to daily administration and maintenance of its SQL Server
2005 databases and servers.
Company Overview
• Company Name: Adventure Works Cycles, Inc.
• URL: http://www.adventure-works.com
Adventure Works Cycles is a company that is about to become a publicly traded company (IPO). They
had added additional database administration staff to begin the process of becoming Sarbanes/Oxley
compliant. The company manufactures and sells metal and composite bicycles to North American,
European, and Asian commercial markets. Although its base operation is located in Bothell,
Washington, with 140 employees, several regional sales teams are located throughout its market base.
Branch sales offices are located in Barcelona and Hong Kong, and manufacturing is located in a
wholly owned subsidiary in Mexico.
The Adventure Works Computing Environment
The company began with fairly basic computing requirements and facilities. It has steadily grown and
required additional computing resources in order to support its growth as an Internet-based global

MCT USE ONLY. STUDENT USE PROHIBITED


Module 0: Introduction 24

business. It has a number of servers as described below and is suffering from problems with lack of
storage space, a part-time database administrator who is struggling to keep up with the demands of the
business growth, and increasing need for data availability and reporting.
As the company is heavily focused on an internet sales strategy it needs a reliable 24x7 computing
infrastructure environment to support its head office and regional sales offices.
Network Environment
Adventure Works runs a database server, an Exchange server, a Web server, and a file server that is
running out of space.
Database Server Environment
The main OLTP database for Adventure Works Cycles is AdventureWorks, housed at the
headquarters. Another database that serves as a data warehouse is also installed on the
AdventureWorks database server. SQL Server 2005 Reporting Services is also used.
Current Situation
The part-time DBA has not identified an automation strategy. Therefore, you need to establish the
automation strategy and maintain the administration and automation document. The reporting services
load is high, the data warehouse is becoming more important to the business operations, and the
company is considering scaling out to another database server.
Your role in Adventure Works Cycles
Adventure Works Cycles has not been able to afford a full-time DBA and has been getting by with
part-time database support. You have been hired to provide full-time DBA support and are now
working on fixing gaps that have been identified in the Adventure Works systems. There are several
key requirements: to automate the running and maintenance of this highly demanding environment, to
provide a stable database environment that can reliably support the business critical data warehouse,
and the increasing demands of the reporting services. From its experience with part-time DBAs, the
management of the company is insistent that the new DBAs properly document the system and keep
documentation up-to-date with any changes to environment, processes, or procedures.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases
and Servers
Time estimated: 160 minutes
Module 1: Managing and Automating Databases and Servers ............................................................... 1
Lesson 1: Planning an Automated System for Database Maintenance ............................................... 4
Plan an automated system for database maintenance.................................................................. 4
Considerations for Automating Database Administration .............................................................. 5
Principle: Evaluate considerations for automating database administration. .............................. 5
Considerations for Using SQL Server Agent.................................................................................. 7
Fact: Describe considerations for using SQL Server Agent........................................................ 7
Guidelines for Assessing System Dependencies on the Database .................................................. 9
Principle: Apply guidelines to assess system dependencies on the database. ............................. 9
Demonstration: Considerations for Monitoring and Verifying Scheduled Tasks ......................... 11
Principle: Evaluate considerations for monitoring and verifying automation........................... 11
Considerations for Identifying Maintenance Needs...................................................................... 15
Principle: Evaluate considerations for identifying maintenance needs..................................... 15
Guidelines for Automating Database Maintenance Plans............................................................. 19
Principle: Apply guidelines for automating database maintenance plans. ................................ 19
Lesson 2: Planning an Automated System for Server Maintenance ................................................. 21
Plan an automated system for server maintenance.................................................................... 21
Guidelines for Implementing Application Database Changes ...................................................... 22
Principle: Apply guidelines for implementing application database changes........................... 22
Considerations for Implementing Windows and SQL Server Updates......................................... 24
Principle: Evaluate considerations for implementing Windows and SQL Server updates. ...... 24
Multimedia: Considerations for Managing Multiple Servers in the Enterprise Environment....... 26
Principle: Evaluate considerations for managing multiple servers in the enterprise................. 26
Lesson 3: Documenting Administration and Automation Information............................................. 28
Document administration and automation information in a run book. ..................................... 28
Multimedia: The Importance of Documenting Information.......................................................... 29
Fact: Explain the importance of documenting administration and automation information in a
run book. ................................................................................................................................... 29
Discussion: Considerations for Implementing a Run Book .......................................................... 31

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 2

Principle: Evaluate considerations for implementing a run book. ............................................ 31


Guidelines for Maintaining a Run Book ....................................................................................... 34
Principle: Apply guidelines for maintaining a run book. .......................................................... 34
The SQL Health and History Tool ................................................................................................ 36
Concept: Explain the concept of the SQL H2 tool.................................................................... 36
Lab: Managing and Automating Databases and Servers................................................................... 38
Exercise 1: Creating Maintenance Plans...................................................................................... 40
Exercise 2: Creating Database Change Control Procedures ........................................................ 46
Exercise 3: Configuring and Using the SQL H2 Tool ................................................................. 47

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 3

Module objective:
After completing this module you will be able to:
Manage and automate databases and servers.
Introduction
In the daily administration of a Microsoft® SQL Server installation there are a number of tools and
techniques that can make the everyday running, maintenance, and record keeping about the
installation less burdensome for the database administrator (DBA). A well-run installation that uses
proactive management techniques is less likely to have performance problems, database corruption,
faulty backups, or other problems than sites that do not use automation and documentation properly.
Such automation also reduces problems caused by human error. If you carefully plan and document
the various automated processes and procedures, you can minimize downtime in the event of database
disaster recovery situations and other routine DBA interventions, such as rolling back an incorrect
global update.
In this module, you will learn how to plan and implement automation procedures and processes that
help you maintain SQL Server databases and servers. You will also learn how to document these plans
and procedures in a run book so that the information about the entire set of processes is properly
described and maintained. This planning and implementation make it much easier for any DBA, even
a temporary contract DBA, to know what activity to do, how to do it, and when to do it.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 4

Lesson 1: Planning an Automated System for Database Maintenance

Lesson objective
After completing this lesson, you will be able to:

Plan an automated system for database maintenance.


Introduction
Many database maintenance tasks are repetitive and sometimes tedious. Through careful planning and
proper implementation of database administration and maintenance plans, the DBA can ensure that
databases are fully and properly maintained in a timely manner. By documenting those policies and
procedures in a run book, the DBA can also ensure that, even when he or she is not on site, other
DBAs can properly administer and maintain the databases and associated systems.
In this lesson, you will learn about the benefits of automating database maintenance tasks and how to
plan automated database maintenance solutions. You will learn to identify database maintenance
tasks, evaluate their effect on a database system and other processes, and monitor and verify the
execution of these tasks. You will also learn why you need maintenance plans and see how SQL
Server Management Studio helps you schedule maintenance plans and other automated activities.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 5

Considerations for Automating Database Administration

Principle: Evaluate considerations for automating database administration.


What to automate
At the database level there are many activities that benefit from automation.
Tasks that must be performed at scheduled intervals
• Index and fill-factor maintenance
• Backups of databases and transaction logs
• Backups of system databases
• Regular data imports from other data sources (such as Microsoft Office Access, Microsoft
Office Excel®, Oracle, or DB2)
• Routine execution of SQL Server Integration Services (SSIS) packages
• Regular archiving of data from active tables into historic tables
• Reporting and replication activities
Commonly occurring ad hoc tasks
• Password resets
• New user creation

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 6

Database consistency checking tasks


• Scheduled database consistency checks
• Regular data sampling and extraction for testing or other review
• Execution of system procedures to collect database data
• Execution of user-defined procedures or system procedures to automatically produce key
metrics and documentation
Tasks that respond to periodic, critical, or predictable events
• Response to alerts generated by database events (for example, transaction logs becoming full)
• Responses to critical database security events (for example, audit trail alerting)
• Scheduled refresh of statistics on infrequently used tables just prior to their monthly use, for
example
• Responses to various Key Performance Indicators (KPIs) which have been defined as
business-critical
• Responses to database instance performance conditions
What not to automate
Although it is possible to automate most operations in SQL Server 2005, you must carefully weigh the
benefits of automation against the time and effort taken to implement automation. Automation of the
following types of tasks generally provides little benefit.
Tasks that occur only once
• Server configuration changes
• Adding storage devices
• Adding backup devices
• One-off tasks that involves data import or use of Microsoft Office products (for example,
Microsoft Office Word, Excel, or Access), in which application menu options already provide
the required functionality
Tasks that take a long time to automate
• A complex sequence of steps that involves multiple data sources in a one-off data load
scenario
Tasks that can cause unanticipated exceptions
• Warnings in Reporting Services
• Faulty application processes
.

Tip
Often, these cases not to automate are not entirely clear-cut. It might be worthwhile to automate some
activities that are susceptible to exceptions to see how long it takes, so you can decide whether it is
worthwhile for other similar activities. Additionally, an activity that started off as a low-frequency
event might become more common, and then the investment in the time to automate the process or
procedure can prove to be more beneficial than first thought. Consequently, it is important to review
your database administration processes and requirements on a regular basis.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 7

Considerations for Using SQL Server Agent

Fact: Describe considerations for using SQL Server Agent.


Security considerations for SQL Server Agent
The security context for SQL Server Agent jobs and tasks must be explicitly managed, and the DBA
must also consider how to manage the capability to create, run, and manage SQL Server Agent jobs,
alerts, and operators. This access is controlled by the requirement that to use SQL Server Agent a user
must be a member of one or more of the following fixed database roles:
• SQLAgentUserRole
• SQLAgentReaderRole
• SQLAgentOperatorRole

With the exception of the sysadmin fixed server role, the default condition is that no user is a member
of any of these roles. So, aside from the sysadmin role, all SQL Server Agent access must be explicitly
granted for all users who need such access.
To manage the security of the SQL Server Agent environment you must consider the following:
• SQL Server Agent best practice operation assumes the use of proxy accounts.
• Proxy accounts allow for predictable behavior and restricted execution permissions.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 8

• Running the SQL Server Agent service under a Microsoft Windows account that is a member
of the Windows Administrators is quite risky and dangerous.
• Proxy accounts are “purpose-built” accounts that are designed by the system administrator to
have only the privileges that are required for a particular job or job step. They can be used by
members of the various SQL Server Agent roles. The system administrator can also create
jobs that run under the SQL Service Agent service account.
For more information
For more details on the use of proxies with SQL Server Agent, see the topic “Security for SQL Server
Agent Administration” in Books Online.
Considerations for capturing and using SQL Server Agent scripts
You should make sure that you allow time for capturing SQL Server Agent jobs as scripts so they can
be reused, distributed, or used for documentation. You must also consider how you will do the
captures, who will do them, and whether you will use them. Specifically, consider the following:
1. To capture SQL Server Agent job step scripts, you must be connected to the appropriate SQL
Server instance.
2. Under the SQL Server Agent object in the Object Explorer, expand the Jobs list.
3. Select the job that you are interested in. right click the context menu, click the Script Job As
option, and click either the CREATE To or DROP To item.
From that point, choose one of the following three options:
• New Query Editor Window
• File
• Clipboard

You can then work with the script as you need to, add documentation comments, and save the
completed script in Microsoft Visual SourceSafe® for purposes of security and version control. You
might also want to store the scripts as part of your run book.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 9

Guidelines for Assessing System Dependencies on the Database

Principle: Apply guidelines to assess system dependencies on the database.


Introduction
System dependencies must be identified before you organize, plan, and correct system performance.
In large-scale systems and enterprise environments, this task is critical, but it is also extremely
important as a best practice in smaller database environments.
There are always constraints on the time available for system maintenance, so it is helpful to identify
inter-task dependencies so that maintenance can be performed with minimum conflicts between tasks
and requirements. This is especially important because if you miss a crucial dependency you might
cause a ripple effect that can influence many other systems.
Assessing system dependencies on the database
Use the following guidelines to assess system dependencies on the database.
• Identify inter-job dependencies. For example, a job that consolidates sales data must be
executed after the completion of the job that collects sales data from external servers. Some of
those dependencies are accomplished as job steps, and you should identify those
dependencies that must be executed sequentially because they are owned by different
processes.
• Identify other systems that might affect your work. Determine what steps need to be taken to
avoid conflict with other business processes and staff.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 10

• Identify the restrictions of executing jobs concurrently. Because of resources accessed, the
concurrency of the jobs can be compatible or incompatible.
Compatible Concurrency
Two or more operations can run concurrently if they are fully compatible. If they
are partially compatible, they might run satisfactorily together, but it might be
preferable that they run sequentially for overall efficiency. For example, a re-
indexing operation in one database can run concurrently with a full backup job
of another database, but it is preferable that they do not run concurrently due to
the high input/output (I/O) activity that both operations produce.
Incompatible concurrency
Incompatible concurrency means that you cannot run two operations
simultaneously. For example, you should not re-index a table with a data
archiving operation that affects the same table.
• Coordinate with other enterprise activities to avoid conflicts. For example:
Tape Backup
A tape backup is a sequential device, and only one resource can access it at a
time. Multiple resources accessing a tape drive can lead to conflicts.
ELT routine
Data extraction and load routines might conflict with other database activities. It
does not make good sense to try to import large quantities of data into a table
when that table is being heavily used.
Periodic activity
Periodic activities, such as month-end closing jobs that populate summary tables,
can lead to conflicts with other jobs. You can avoid such conflicts by
coordinating the job execution.
• Build a job dependency diagram to avoid conflicts and coordinate jobs efficiently. You must
clearly define the inputs and outputs of a job, and update the diagram. Inputs are resources
that provide value to a process, and outputs are results of a process. Examples of inputs and
outputs can include offices, servers, physical devices, databases, and database objects.
• Consider the granularity for a job definition when you build the dependency diagram. For
example, you can design a diagram to show that one job depends on another job or you can
show specific steps within the jobs to reflect particular process dependencies. The DBA’s task
is to identify the appropriate level of detail for dependency analysis. It is usually best to use
the more granular approach and determine specific steps.
Tip
If you do not have a lot of practice creating such diagrams, sometimes it is best to step through the
dependencies for tasks with which you are familiar, such as the dependencies in feeding a pet or doing
a particular maintenance task on a car or motorbike.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 11

Demonstration: Considerations for Monitoring and Verifying Scheduled Tasks

Principle: Evaluate considerations for monitoring and verifying automation.


Introduction
To automate jobs, you should monitor and verify job processes, including monitoring task execution,
task completion, and task results or notifications, if applicable. This is very important because
automating a job should not compromise the accuracy of the tasks to be performed.
This demonstration shows how to monitor and verify an automated job, as well as how to configure
notification alerts.
When you monitor and verify scheduled tasks, you should keep the following considerations in mind.
Considerations for monitoring and verifying active tasks
It is important to consider the appropriate manner for monitoring or verifying active tasks. For
example, you can use the Job Activity monitor in SQL Server Management Studio to monitor the
execution of tasks that are under development, or use Dynamic Management Views to see the
status in a set-based format. You should consider creating specific views, functions, or stored
procedures to improve or personalize the results that the standard Dynamic Management Views
implement.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 12

Considerations for monitoring and verifying completed tasks


You should consider using tools such as event log, SQL Server Agent alerts, and notifications for
monitoring and verifying completed tasks. The information that can be traced includes step state,
success or failure finish state, and causes for a failure. When designing jobs, you should create the
appropriate infrastructure to broadcast alerts to interested parties about the state of the steps you
consider risky. For example, in a backup maintenance, you can design an e-mail alert message to
inform to personnel in charge of managing the backup devices in case of an error in the tapes. The
DBA can also be informed with a different severity because the personnel operating the backup
devices are instructed to restart the backup activities.

Preparation
Ensure that the virtual machine 2789A-MIA-SQL-01 is running and that you are logged on as
Student.
If a virtual machine has not been started, perform the following steps:
1. Close any other running virtual machines.
2. Start the virtual machine.
3. In the Log On to dialog box, complete the logon procedure by using the user name Student
and the password Pa$$w0rd.

Create jobs
To create jobs, perform the following steps.
1. Start SQL Server Management Studio, connecting to the MIAMI Database Engine by using
Windows authentication.
2. In SQL Server Management Studio, open the 1-
prerequisites_table_and_stored_procedure_creation.sql script in D:\Democode and
execute it. Connect to MIAMI by using Windows authentication when prompted.
3. Open the 2-prerequisites_job_creation1.sql script in D:\Democode and execute it. Connect
to MIAMI by using Windows authentication when prompted.
4. Open the 3-prerequisites_job_creation2.sql script in D:\Democode and execute it. Connect
to MIAMI by using Windows authentication when prompted.

To start a job
To start a job, perform the following steps.
1. In SQL Server Management Studio, open Object Explorer, expand SQL Server Instance,
expand SQL Server Agent, and then expand Jobs.
2. Right-click the Fill ProductSalesInCurrentDay1 in AdventureWorks job, and then click
Start Job. Perform the next procedure as soon as the job begins.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 13

To monitor job activity by using the Job Activity monitor


To monitor job activity by using the Job Activity monitor, perform the following steps.
1. In SQL Server Management Studio, open Object Explorer, expand SQL Server Instance,
expand SQL Server Agent, right-click Job Activity Monitor, and then select View Job
Activity.
2. To set the refresh frequency, click View refresh settings in the Status panel, and in the
Refresh Settings window set 5 seconds as time frequency. Then click OK.
3. To filter the displayed jobs, click View filter settings in the Status panel, and in the Filter
Settings window, select Executing in the Status list. Then click OK.

To monitor job activity by using system views and stored procedures


To monitor job activity by using system views and stored procedures, perform the following steps.
1. Ensure that the Fill ProductSalesInCurrentDay1 in AdventureWorks job is still running.
If it has stopped, click Close in the Start Jobs dialog box and then restart the job.
2. Click the New Query button, and in the new query window, type and execute the following
code.
SELECT program_name, login_time, host_name
FROM sys.dm_exec_sessions
WHERE status = 'running'
3. Ensure that the Fill ProductSalesInCurrentDay1 in AdventureWorks job is still running.
If it has stopped, click Close in the Start Jobs dialog box and then restart the job.
4. Type the following code, and then select and execute it to see information such as running job
names, running job ID, description of the job, and the running step
EXEC msdb.[dbo].[sp_help_job]
@execution_status = 1
5. Wait for the Fill ProductSalesInCurrentDay1 in AdventureWorks job to complete, and
then click Close in the Start Jobs dialog box.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 14

To create job notifications


To monitor job activity by using system views and stored procedures, perform the following steps.
1. In Object Explorer, right-click the Fill ProductSalesInCurrentDay2 in AdventureWorks job
and click Properties.
2. Click the Notifications page, and then select the Write to the Windows Application event
log option, and select the When the job fails option in the list.
3. To update the job, click OK.
4. Right-click the Fill ProductSalesInCurrentDay1 in AdventureWorks job, and then select
Start Job.
5. Right-click the Fill ProductSalesInCurrentDay2 in AdventureWorks job, and then select
Start Job.
6. In Object Explorer, expand SQL Server Agent, expand Error Logs, right-click the current
archive, and then select View Agent Log.
7. Clear the SQL Server Agent check box, and then expand Windows NT and select the
Application check box to verify that the failed job has been logged. Then click Close.
8. In the query window, type the following code and then select and execute it. The column
last_run_outcome indicates what was the result of the last execution of the job; the possible
values are 0 for failed, 1 for succeeded, 3 for canceled, and 5 for unknown.
EXEC msdb.[dbo].[sp_help_job]
9. Click Close in the two open Start Jobs dialog boxes, and then close SQL Server
Management Studio without saving any files.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 15

Considerations for Identifying Maintenance Needs

Principle: Evaluate considerations for identifying maintenance needs.


Backup considerations
It is possible to lose databases as a result of natural disasters, other disasters, or losses of
infrastructure, either permanent or temporary.

Note
You might want to discuss this topic with your business managers as well as members of this class.
Many businesses have been unpleasantly surprised to discover that they did not have adequate systems
in place to deal with disasters. It might also be of interest to DBAs to investigate the area generally
known as “business continuity” and their role in providing such continuity.
It is impossible to overemphasize the degree to which some critical databases affect businesses or
people’s lives. One of the assessments the DBA should make of each and every database is the degree
to which it is mission critical for any particular activity or purpose. One of the most important things
for DBAs to appreciate is that the businesses or organizations for which they work might well cease to
exist if major problems strike the database and proper steps have not been taken to ensure that these
databases are intact, are properly backed up, and are coherent. You must define the appropriate
backup strategy based on the business requirements of the organization.

Tip
Create a list of all the ways in which the databases you deal with could contribute to the success or
failure of your company or organization. Discuss this list with your staff and your managers to
identify any gaps in your understanding of business criticality.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 16

It is important to consider how much time the system requires to perform the backups, what is the
amount of allowable data loss in case of a system disaster, and how to minimize the downtime of the
system during a recovery. Factors that you need to consider include the following:
Impact of backup operations on system performance
The frequency and type of backups you choose to implement can have a major impact on database
performance. For highly active databases, you might consider using filegroup backups to reduce the
time a backup operation takes and therefore minimize the impact on performance.
Backup plan complexity
Your backup plan can be as simple as performing regular full database backups or it can involve a
combination of full, differential, and log backups. Consider the business requirements in selecting
your strategy for availability and recoverability.
Point of recovery
In some cases, you might need to be able to recover a database to a specific point in time to back out
unwanted changes. If this is the case, you need to design your backup plan to include log backups.
Recovery time
You need to consider the impact of the time taken to get the database back online and operational.
Scheduling an additional differential backup every three hours would increase the complexity of a
backup plan, but significantly reduce the amount of time required to recover the database.
Impact on warm spare servers
Evaluate the backup strategy’s impact on all the servers involved in warm spares. For example, in a
full synchronous database mirroring scenario, you should consider how the principal server will be
affected by database backups in the mirror server. In log shipping scenarios, you should consider how
the full database backup affects the transaction log backups that are transferred to the secondary
servers.
Data Definition Language (DDL) changes
The software life cycle involves different servers, such as development servers, quality assurance
servers, and production servers. Changes made in development environments have to be applied first
to quality assurance servers and then eventually to production servers during maintenance windows.
You should carefully consider the update process and make backups before applying DDL changes.
You should also consider what types of DDL changes create risks and be especially cautious when
applying those changes to production systems.
It is important to identify backup needs and requirements that in turn require additional hardware,
software tools, routines, or personnel. Failure to attend to the entire range of issues involved can cause
the system to run poorly; data to be lost; users to be frustrated; manufacturing or sales to affected
adversely; and critical control systems in medicine, scientific, or engineering data environments to
fail, sometimes with catastrophic effects.
Index Maintenance Considerations
Regular maintenance of indexes on tables and views can make significant differences to performance,
user satisfaction, and productivity. It is important to identify indexing needs through proactive and
thoughtful design, systematic analysis, and regular system health checks on indexing. Tools to
maintain indexes include system procedures, tuning wizards, and SQL Query Analyzer.

For more information


For example, see the following topics in Books Online: “System Stored Procedure (Transact-SQL)”
for a list by categories of use, “Differences Between Database Engine Tuning Advisor and Index
Tuning Wizard,” and “Checklist for Analyzing Slow-Running Queries.” There are many other related
topics you should explore if you have not already done so.
The following activities merit particular attention in your automation planning related to indexing:

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 17

Statistics update
Automatic maintenance of statistics is generally the best way to go. If you determine that automatic
updating is not needed or desirable, you need to determine the update frequency and automate it.
Defragmentation: online/offline
You must determine the appropriate defragmentation. You need to consider whether to perform the
defragmentation operation online (a new mode available in SQL Server 2005 Enterprise Edition) or
offline (the default). Online operations avoid blocking, thereby permitting more concurrency, but they
are more time-consuming. DBAs should consider the defragmentation needs of the database with the
amount of live activity to avoid affecting overall server performance.
Reorganization
Although defragmentation operations rebuild the index structure, reorganization operations
defragment the leaf-level pages of an index. Although time-consuming, reorganization operations are
less resource-intensive and more suitable for concurrency. Reorganization can be applied as a solution
in situations where you cannot perform defragmentation operations.
Query analysis and index appropriateness
There should be thorough query analysis, testing, and verification processes in place during all stages
of the software life cycle. Indexes should be checked for use, efficiency, and the degree to which they
are being used by routine production queries.

Database integrity monitoring considerations


Data can become inconsistent on occasion, sometimes due to invalid hardware I/O operations.
Depending on the “page verify” option set at the database level, there might be risks of a data page
becoming corrupt due to a disk I/O error. You must consider the type and frequency of data integrity
checks. Such integrity monitoring and assessment might require you to restore data from a backup,
rebuild indexes, or engage in other maintenance tasks to ensure that corporate data are intact and
usable.

Important
DBCC commands are familiar to most DBAs but you should check the topics “DBCC (Transact-
SQL)” and “Check Database Integrity Task” for the SQL Server 2005 thinking on these tools. The
emphasis is changing to a heavier reliance on the automatic tasks. See the indicated topics and the
related topics. Also notice in topics such as “DBCC INDEXDEFRAG (Transact-SQL)” that a number
of DBCC commands will be removed in future versions of SQL Server. Ensure that your automation
does not rely on commands or features that will eventually disappear from the product.

Coordination with other types of activities


Maintenance activities need to be coordinated with activities related to business and regulatory
requirements. Such activities include deleting archived data, moving data into archives, and other
database maintenance tasks driven by business rules. By coordinating activities, you can avoid slow or
insignificant operations.
Many database environments are, by their very nature, busy ones. It is important to determine whether
your business requirements indicate a need to do systematic archiving, deletions, table truncations,
table refreshes, or other periodic activities. These activities can be driven by business processes,
business rules, or legal requirements (for example, taxation requirements to maintain records for a
certain length of time).

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 18

DBAs need to communicate with other sections of the business and establish regular ways of staying
informed about business processes and requirements, particularly ones that might change. Various
other forms of automation, e-mail alias use, and project management can aid such communications.
On the management side, both IT and business managers need to clearly communicate their
requirements to the DBAs. Understanding business needs, being able to communicate well in both
spoken and written forms, and using techniques such as company intranets for maintaining status
information and other information pertinent to the use of corporate databases are all key activities in
which DBAs should be involved.
In addition to serving the needs of the business it is also important to ensure that database maintenance
activities do not adversely affect daily operations. As all DBAs are aware, the use of SQL Server
automation can be used to guarantee that particular operations (such as rebuilding indexes) occur
when there is little load on the system and operators can be notified that the operation in question has
completed properly.
In all these cases and all other maintenance scenarios, the automation of activities must be tuned to the
particular situation and requirements. Each case is unique, although there are similar patterns involved
in almost every situation. So one of the critical abilities required of a DBA is to think creatively and
laterally about what needs to be covered by the database maintenance activities and the best ways to
achieve those ends. To do this requires detailed knowledge of the databases, the applications, and the
tools that can be applied.
For example, performing a maintenance operation and data movement between servers, both I/O-
intensive tasks, will affect the performance of each other because of the high use of I/O resources.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 19

Guidelines for Automating Database Maintenance Plans

Principle: Apply guidelines for automating database maintenance plans.

Automating database maintenance plans


Consider the following guidelines when automating database maintenance plans.
Determine the best tool to use.
The Maintenance Plan design surface provides a “free form” environment in which to place
maintenance objects on the design surface and link them together. The links between objects
allow for various types of evaluation operations (that is, constraint, expression, constraint AND
expression, constraint OR expression) and can be edited to allow for conditions of “Success,”
“Failure,” or “Completion.” The Database Maintenance Plan Wizard provides a structured
experience that progresses through a series of steps to produce a customized and sequenced
maintenance plan on a particular server and for one or more databases according to your choices.
Although not as flexible as the design surface, it is a quick and easy way to put a maintenance
plan together. After the plan is defined through the wizard, it can be modified in the normal
manner in the design surface.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 20

Determine the sequence of maintenance tasks.


Each maintenance plan has a sequence of tasks. Using the graphical tools, you can easily define
the position of each task in a diagram. You should determine which steps will report the failure of
a maintenance task.
Identify the hierarchy of different maintenance plans.
You must identify the order of execution of maintenance plans. For example, you can define the
order according to the databases to be maintained, their importance, or any other order determined
by organizational policies and standards.
Identify maintenance operations not implemented in the built-in tools.
You must identify tasks that you need to execute that are not implemented in the built-in
maintenance tools. For example, cleaning working tables, executing auditing commands by using
Dynamic Management Views, and calling .NET stored procedures that implement operation
system–level operations are not implemented in the built-in maintenance tools.
Use custom Transact-SQL for backup tasks.
Options such as mirroring backups, checksum, block size, and passwords are not included in the SQL
Server Management Studio graphical user interface (GUI). Therefore, you should back up data by
creating custom Transact-SQL commands.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 21

Lesson 2: Planning an Automated System for Server Maintenance

Lesson objective:
After completing this lesson, students will be able to:

Plan an automated system for server maintenance.


Introduction
Many of the SQL Server maintenance activities are routine and repetitive. Some server maintenance
activities, such as index maintenance, backups, database service packs, operating system security
updates, and metrics collection, might not require DBA interaction. Other activities, such as
promotion of changes through the software life-cycle environments, are also routine and repeatable,
but might require DBA interaction. Just as with database automation, there is a range of tools and
techniques available to DBA and system engineers to do this automation and facilitate daily
administration and system documentation. In a similar fashion, reducing the time spent on routine
server administration frees up DBA staff to do other database or server work which cannot be easily
automated, thus again reducing pressure on staff, increasing the reliability of the server systems, and
decreasing the chance for human errors in routine tasks.
In this lesson, you will learn to plan and automate server maintenance. You will evaluate guidelines
for implementing application database changes. You will learn considerations for applying service
packs and security updates to SQL Server and the underlying operating system and hardware
component firmware. You will also evaluate considerations for automating multiple server
management in your business environment.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 22

Guidelines for Implementing Application Database Changes

Principle: Apply guidelines for implementing application database changes.


Implementing application database changes
Use the following guidelines for implementing changes in application databases. The software life
cycle diagram illustrates in a generic manner the types of stages in the life cycle of most software
development.
• Identify the required software life cycle. A software life cycle should include designing and
planning processes that support iterative development. This life cycle might include data-
modeling tools, bug-tracking systems, coding standards, security standards, and change-
control procedures. Each project will require the right combination of processes between
environments to achieve the correct balance of costs and quality that is necessary for that
project. Some common processes that are part of possible environments are unit testing,
integrated development, quality assurance (QA), customer acceptance, preproduction, load
testing, and production environments. You should perform the following tasks to identify the
required software life cycle:
• Analyze the existing environment.
• Establish quality requirements.
• Design an optimal software life-cycle strategy.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 23

• Establish a change-promotion policy. You should perform the following tasks to establish a
change-promotion policy:
• Define database developers’ roles in promotions. Besides the defined roles in the
change-promotion process, database developers should develop and test new
requirements and enhancements, and fix bugs requiring database changes before
introducing them to any integrated environment, and create roll back scripts. After
the development and testing are complete, developers should package all changes
and deliver them to the persons responsible for the promotion to the next
environment in the software life-cycle hierarchy.
• Define DBAs’ roles in promotions. The primary role of a DBA in the promotion
process is to ensure that the elements of the change-promotion policy have been
followed properly and consistently. This involves ensuring compliance with coding
standards, performance guidelines, and existence of accurate rollback scripts. A DBA
also needs to ensure that the risks of introducing changes are kept to a minimum.
• Use SQL Server Management Studio projects integrated with Visual SourceSafe.
Use SQL Server Management to create database projects and integrate them with
Visual SourceSafe. SQL Server Management Studio projects enable you to save
several data-source configurations. Therefore, a DBA, a change-promotion specialist,
or an application can execute an application with the appropriate connection without
making any changes to the tested scripts.
• Plan the coordination between application changes and database changes. In most
cases, the procedures used at the application layer will not be identical to those used
at the database layer. To ensure consistency in the application layer and the database
layer, it is important to determine a method to coordinate application layer changes
and data layer changes.
• Document change-control procedures. You must document all the processes required to
implement changes in a database application. These changes can relate to system
requirements, restrictions such as service level agreement (SLA) terms and application
dependencies, and scripts. The objective of this activity is to properly document processes so
that the correct responses to all successful or failed situations are clearly defined at the time a
change is implemented. The documentation should be updated as the system evolves.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 24

Considerations for Implementing Windows and SQL Server Updates

Principle: Evaluate considerations for implementing Windows and SQL Server updates.
Considerations
Considerations for implementing Windows and SQL Server updates include the following:
Risks and benefits of automatic updates
You must consider the scheduling and deployment needs, and the flexibility and control
granularity required to determine the tools that are appropriate for your requirements. You must
evaluate the benefits and risks of automatic updates on servers. If an update is applied
automatically to all servers in an organization, there is a risk of applying an update without
assessing the impact on the overall infrastructure. This can lead to security issues that block ports,
disable services, or change security access. On the other hand, if you do not apply a fix, you might
be exposed to instability or vulnerability issues solved by the fix.

Best practices
Research by the Microsoft SQL Server group after the Slammer Worm indicated that almost without
exception damage to SQL Server databases and servers reported to the group was from sites that had
not applied the updates when they were released and so left their systems exposed. The problem had
in fact been fixed several months before the Slammer Worm hit.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 25

Service packs and security updates


You must evaluate the impact of applying service packs and security updates on your
environment. Read the documentation associated with each service pack or security update and
analyze the overall impact on the systems. You must have a preproduction environment similar to
the production environment to test service packs and security updates. Schedule the testing of
security updates to fit with system activities.
Change coordination between servers
You must consider how to apply changes to different servers in an environment and based on the
highest benefit rule, prioritize the update of an application to the servers. You should identify
incompatibilities between servers where changes have been applied and servers where they have
not been applied. It is imperative to document such differences.
Instance components and overall system performance
When adding new components to a SQL Server instance, you must consider the overall
performance of a server and its related system. For example, adding a SQL Server Reporting
Services instance involves enabling Internet Information Services (IIS) and applying IIS updates
and available updates to the instance. If you want to enable full-text search services, you should
review the available updates for full-text search services before deploying the installation.
Quick updates versus database stability
Weigh the need to install an update against database stability. Your decision must be based on
whether the server is exposed to the issue, and whether the issue is solved by the update. When
you must act quickly to prevent security exploits, thorough testing might be less important than
quickly getting an update in place to protect the production environment. Before a threat is
identified or a security update is made available, you can discuss with all business stakeholders
and decide when standard change practices and testing can be circumvented to implement security
updates to thwart a high-risk breach.

Note
Analyze changes in the system behavior following update installation and the overall impact on the
system. The preferred method to implement updates should be to first test them in a preproduction
environment. Report any problems with updates to Microsoft.
Tracking system software updates
Tracking software updates, service packs, and versions helps you analyze system malfunctions
and the behavior of the environment with and without an update. Keeping an historical record of
updates permits you to detect anomalies in the environment, and you can later compare them with
scenarios using various updates. Consider the use of tools such as Windows Server Update
Services (WSUS) and Microsoft System Management Server for tracking the system software
updates.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 26

Multimedia: Considerations for Managing Multiple Servers in the Enterprise


Environment

Principle: Evaluate considerations for managing multiple servers in the enterprise.


Introduction
The need for centralizing multiple server management is directly related to the reduction of common
tasks in servers. The goal is to manage common tasks to be performed in the remaining servers from a
single server, also known as a master (MSX) server. For example, you might consider creating general
backup copy strategies for all servers and implement a validation test and server restore plan in testing
servers. You should note that this design will lead to a single point of failure because the tasks are
managed from the master server.
Class Discussion
Q How would you use multiserver administration in a loading scenario for a data
warehouse? Is this a good scenario for multiserver administration?
A You can use multiserver administration to monitor tasks that run on the production
server and the data warehouse server. Using multiserver administration to load from
several servers into a data warehouse in this way will terminate the process on both
servers if a problem occurs on one of the servers. This is a good scenario for multiserver
administration if scheduled jobs on both servers are used because tasks common to the
data-load process can be coordinated. Otherwise, because jobs on the target server run
concurrently, you will be aware of the workload on the warehouse server because of
data load processes. If all tasks used in the data load originate on the data warehouse

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 27

server, multiserver administration is less desirable because all the tasks are already
located on the data warehouse server.
Q What are the problems and advantages of using a single multiserver administration
master server for database servers across all software life-cycle environments?
A
• Problems:
• Obstructs the testing of multiserver changes in a nonproduction environment
before implementing them in a production environment.
• Creates a dependency between production systems and nonproduction systems.
The dependency can affect the stability of the production environment.
• Limits the capability of the master server to access all servers if firewalls,
nontrusted Windows domains, or network subnets separate them.
• Advantages
• Provides a single point of control for tracking and managing all SQL Server Agent
scheduled activity.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 28

Lesson 3: Documenting Administration and Automation Information

Lesson objective
After completing this lesson, students will be able to:

Document administration and automation information in a run book.


Introduction
By documenting administration and automation information, you can ensure that the policies and
procedures that guarantee high availability of database servers and databases are known and
understood. With the help of documented information, DBA staff can examine administration-related
and automation-related problems, understand them, and solve them.
This lesson describes the use of run books and the information that a run book should contain. You
will evaluate guidelines to maintain a run book, and know the importance of updating a run book. You
will also evaluate considerations for using the SQL Health and History (SQL H2) Tool.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 29

Multimedia: The Importance of Documenting Information

Fact: Explain the importance of documenting administration and automation information in a run
book.
Facilitate Knowledge Sharing
Knowledge or information about an organization is shared among its employees. Mission-critical
processes and tasks form a major portion of this information. Documenting the tasks and processes
ensures that this information is available to all employees around the clock. If you cannot perform a
task due to the unavailability of an employee, any qualified employee should be able to use the
documented information to complete the task. You also need to document resource information that
includes member and supplier contact information, and hardware and software component
specifications. You must also document procedural information for all operational and emergency
tasks and keep a record of the history of administrative details, such as security settings and data
monitoring.

Best practices
It is very useful to have an electronic run book on the corporate intranet, where DBA staff can easily
access and use it.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 30

Ensure Business Continuity


By designing appropriate recovery processes, an organization can prepare for diverse contingencies
and ensure that day-to-day operations do not stop. Document and test the recovery process thoroughly
so that you can apply the process without any doubt or improvisation. In case of contingencies, you
can identify the organizational resource requirements. You can also use the documentation of existing
resources as a reference to determine the resources that you will need to overcome contingencies.
Provide Clarity to Operational Procedures
You should document information on operational procedures, including detailed steps about how to
perform tasks by using relevant tools. These procedures should follow the established organizational
standards. You should also define standard business practices, such as coding standards, naming
standards, or customization standards.
Help Record Baselines and Benchmarks
You need to identify operational baselines as well as recording benchmarks when a system exceeds its
expected operational capacity. You should periodically record and compare the baselines and
benchmarks to actual data, identifying the need to tune, scale horizontally, scale vertically, or make
other adjustments an ad hoc process. Making business decisions becomes possible with well-
documented baselines and benchmarks, and detailed information on how you created the baselines and
benchmarks.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 31

Discussion: Considerations for Implementing a Run Book

Principle: Evaluate considerations for implementing a run book.


Introduction
You use a run book to organize and document so you can turn the data into a cohesive set of
information. A run book includes documents, scripts, diagrams, and resources that are needed to
ensure the correct performance of administration and automation processes.
This topic will help you identify the content, structure, and format of a run book. This topic also
covers how to implement a run book and discusses techniques used to store and maintain system
information.
Discussion Questions
Q What should you include in a run book and why?

A You can include the following information in a run book:

Information Type Reason


Job dependency diagram To record the correct procedure to execute jobs

• Backup details To record recovery strategy and ensure server


availability
• Service level agreement

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 32

• Emergency procedures
• Organizational disaster recovery
plan

• Change-control procedures To record the procedures to promote changes and


deploy applications
• Changes to production servers

• Service pack and security update history To record physical server characteristics,
configuration, and installation of server software
• Server configuration setting
• Server hardware—general server
information
• Processors
• Machines
• Storage
• Arrays
• Storage Area Network (SAN)

• Contact list—personnel implied To record details needed for server recovery


• Managers, database administrators
(DBAs), and developers
• Suppliers
• Utility companies
• Hardware vendors

• Operational audits and logging To record system performance baselines and


auditing
• Performance logging and profiling
• Monitoring
• Troubleshooting
• Security tasks

Documenting monitoring and automation To record system performance analysis and


procedures automation

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 33

Q How do you document information currently?


A Answers will vary. Information can be documented by using the following:
• Monitoring tools that capture server setting information
• Applications that capture and format information according to organizational standards
• Microsoft Visual SourceSafe® as a script repository
• Microsoft Office Excel documents with server activity evolution
• Excel documents with maximum performance values of the servers’ hardware
• Microsoft Visio® documents with environment diagrams of extended entity relationship
(EER), jobs dependency, disaster recovery plan, and contact information
• Microsoft Office Word documents with contact information such as vendors and employees.
Q Which formats are best suited for a run book?
A Answers will vary. A run book need not be of only one format. For example, it is
acceptable and often desirable that a run book is a Word document that includes
references to database tables, spreadsheets, and other files. In most cases, the
information included in a run book will be too large to incorporate in a single document.
You need to use a Word document as a run book if it provides referencing information.
Consider the following questions when determining a format for a run book:
• Does the document meet the needs?
• Is it hard to maintain?
• Is it easy to understand the information by using that format?
• Can you present the information in a better way?
Q What problems do you anticipate when using a run book?
A Answers will vary. When using a run book, the most complex task is to keep it up-to-
date because of the different sources of information that it can contain and the different
run book formats that are available. Some of the run book formats are Visio diagrams,
Excel sheets, Word documents, and data tables.
Q How would you solve the anticipated problems?
A Answers will vary. You should focus on the fact that a run book contains reliable
environment information that you can use to perform daily operations. You should find
an appropriate mechanism to solve the anticipated problems. For example, to avoid the
problem of incorrect information because of a wrong version of a document, you can
store the information in a common version-controlled repository.
Q How does a run book help you document information?
A Answers will vary. A run book is a live document that you can refer to when gathering
administration information such as server configuration, server hardware
characteristics, and security information such as logins and trusted relationships. By
maintaining a run book, you have a single point to gather and locate system
information.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 34

Guidelines for Maintaining a Run Book

Principle: Apply guidelines for maintaining a run book.


Maintaining a Run Book
You should apply the following guidelines for maintaining a run book:

• Update a run book whenever you need to. You can manage the existing environment
configuration by updating a run book.
• Define a strategy or schedule to keep the run book up-to-date. You must define and document
how to update a run book so that people working with it can modify it systematically. You
should select the appropriate strategy based on the frequency of the environment changes and
its complexity. You should adapt a run book structure to facilitate the process of updating a
run book. To facilitate the process of updating a run book, you should:
• Automate run book maintenance. Use tools that automate run book maintenance.
Examples of such tools are the SQL H2 Tool, Microsoft Operations Management (MOM),
and third-party monitoring tools. You can use T-SQL, Windows Management
Instrumentation (WMI), SQL Management Objects (SMO), CLR integration, dynamic
management views, or Profiler to build custom run book components to capture data.
• Use familiar tools. The tools that you use should be familiar to you. Otherwise, you will
need to spend time to become familiar with every tool that meets the requirements of a run
book.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 35

• Use appropriate run book format. Based on the type of collected information, you should
use the appropriate format. For example, you can use:
• Visio diagrams for a network infrastructure.
• Tables for performance data collected in auditing processes.
• Access or Excel for a contact information list.
• Keep a master document. A run book consists of multiple technologies. Therefore, it is
important that you use a master document to gather information in one place. The master
document can be a Word document, an intranet Microsoft Office FrontPage® site, or a
printed document.
Important
The organization must ensure that there is sufficient time for staff to maintain the run book. A run
book will not help if staff members do not have the time and management support to maintain it
properly. An incomplete run book is almost more dangerous than none at all because it can engender a
false sense of security.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 36

The SQL Health and History Tool

Concept: Explain the concept of the SQL H2 tool.


Why Use the SQL H2 Tool?
The SQL H2 Tool is a very useful tool set that helps you gather SQL Server instance information
automatically that you can add to a run book. SQL H2 is a high-powered monitoring tool with built-in
reporting. This tool helps you collect server-level information, instance-level information, and
performance counters information. Because of the component-based infrastructure of SQL H2, it is
possible to collect data from different servers and instances and store it in a repository database.

Important
There are two versions of the SQL H2 tool: one for SQL Server 2000 and one for SQL Server 2005.
When you download the tool from the Microsoft Web site, be sure to get all the files for the version
that you want to use. You will then need to review the Readme files and follow the installation
instructions precisely. Because the tools are not fully supported, they do not have as complete
installation routines as normal software.

What Is the SQL H2 Tool?


The SQL H2 Tool is a utility developed by the SQL Server product group that assists in the collection
of information on feature usage, configuration settings, SQL Server service uptime, and performance
counters. In addition to data collection, the tool facilitates data storage and reports production. It is an
excellent addition to a DBA’s professional toolkit.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 37

What information does SQL H2 collect?


SQL H2 collects the following key information:
• Server-level information. This includes information related to computer systems, such as:
• Total physical memory.
• Processor information, such as clock speed, CPU status, and number of processors.
• Disk drives and number of cylinders and heads.
• Network card information, such as MAC Address, speed, and TCP drivers; running
services.
• Installed products, such as date installed and product name.
• Instance-level information. This includes information such as:
• Instance information, such as version, build, and edition.
• Database information, such as space used, file groups, and files used.
• Details of services installed, such as name, state, and security credentials.
• Summary information of database objects, such as tables, views, triggers, indexes, and
assemblies.
• Performance counters information. System monitor counters can be selected for auditing
by using a configuration file. SQL H2 uses this configuration file to gather performance
counters data and show their evolution. A single SQL H2 installation can store performance
counter values from different servers.
How coes SQL H2 work?
The SQL H2 Tool uses a system task to collect server-level and instance-level information. Every
time SQL H2 runs, it collects this information in a SQL Server database. You can configure SQL H2
to collect information for different servers.
For the performance counters information, each server installs a Windows service locally. This service
stores the values of performance counters locally in text files. For each server, you can configure the
frequency of the capture and the performance counters to audit. SQL H2 incorporates the values from
each server in the local SQL H2 database.
Why should you maintain SQL H2?
SQL H2 can help you audit instance settings in a network. You can add the results to a run book and
customize the reports with the Reporting Services designer. You can report on trends and determine
what kind of maintenance is required for servers by maintaining SQL H2 data over time. SQL H2 data
can help you analyze the effect of configuration and application changes and proactively fix issues,
instead of waiting for emergencies.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 38

Lab: Managing and Automating Databases and Servers

Time estimated: 60 minutes


Introduction
In this lab, you will perform tasks that exemplify the application of guidelines, such as managing
maintenance plans, monitoring server activity, and updating an environment run book. In Exercise 1,
you will create maintenance plans to manage the database and record this information in a run book.
In Exercise 2, you will create database change-control procedures and update the run book with
information about these control procedures. In Exercise 3, you will learn how to configure and use the
SQL H2 Tool.
Scenario
You are a newly hired DBA at Adventure Works. During your initial analysis of the database server,
you notice that no automated administration strategy is available. The current database administration
procedures include “check with Bob.” Bob, the lead database developer, devotes a part of his time to
DBA duties.
You have already started to create and document the database and server maintenance strategies. As
part of the ongoing maintenance, you need to create a database maintenance plan and establish
change-control procedures. You also need to automate some of your monitoring tasks for the server.
You have decided to use the SQL H2 tool to automate monitoring. Finally, you need to update the
documentation.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 39

Preparation
Ensure that the virtual machine 2789A-MIA-SQL-01 is running and that you are logged on as
Student.
If a virtual machine has not been started, perform the following steps:
1. Close any other running virtual machines.
2. Start the virtual machine.
3. In the Log On to dialog box, complete the logon procedure by using the user name Student
and the password Pa$$w0rd.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 40

Exercise 1: Creating Maintenance Plans

Introduction
In this exercise, you will update the run book with information about database maintenance activities.
You will document backup activities, index maintenance operations, and database integrity. You will
also create a jobs dependency diagram. Finally you will create maintenance plans to automate the
database maintenance tasks.
Create a maintenance plan
Task Supporting information
Prepare the database. 1. Use Windows Explorer to view the
contents of D:\Labfiles\Starter.
2. Double-click PrepareDB.cmd to
execute the database preparation script.
3. Close Windows Explorer.
Identify and document the current backup 1. Examine the information relating to
activities. backup activities in the “Notes From
Bob” document located at
D:\Labfiles\Starter\Notes From Bob.doc.
2. Examine existing SQL Server Agent jobs
to identify backup tasks that are currently
automated.
3. Create SQL Server Agent jobs with
appropriate schedules for any backup
tasks that are not currently automated.
4. Document the backup tasks in the
Backup section of the run book located
at D:\Labfiles\Starter\ Run Book.doc,
detailing the tasks that must be
performed, the jobs that have been
created to perform them, and the
schedules for the jobs.

Identify and document the current index 1. Examine the information relating to
maintenance activities. index maintenance in “Notes From Bob”
document.
2. Examine existing SQL Server Agent jobs
to identify index maintenance tasks that
are currently automated.
3. Create SQL Server Agent jobs with
appropriate schedules for any index
maintenance tasks that are not currently
automated.
4. Document the index maintenance tasks
in the Index Maintenance section of the

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 41

run book, detailing the tasks that must be


performed, the jobs that have been
created to perform them, and the
schedules for the jobs.
Identify and document the database integrity 1. Examine the information relating to
monitoring strategy. database integrity monitoring in “Notes
From Bob” document.
2. Examine the information relating to
database integrity monitoring in the
“Business Requirements” document
located at D:\Labfiles\Starter\Business
Requirements.doc.
3. Examine existing SQL Server Agent jobs
to identify database integrity monitoring
tasks that are currently automated.
4. Create SQL Server Agent jobs with
appropriate schedules for any database
integrity monitoring tasks that are not
currently automated.
5. Document the database integrity
monitoring tasks in the Database
Integrity Monitoring section of the run
book. , detailing the tasks that must be
performed, the jobs that have been
created to perform them, and the
schedules for the jobs
Create a job dependency diagram. 1. Examine the jobs defined in the “Notes
from Bob” document
2. Use the drawing tools in Microsoft
Office Word to create a job dependency
diagram in the run book.
Create a daily maintenance plan. 1. Identify tasks that must be performed
once per day.
2. Disable the current schedules for these
jobs in reparation for consolidating them
into a single maintenance plan.
3. Use the Maintenance Plan designer in
SQL Server Management Studio to
consolidate these tasks into a daily
maintenance plan.
Create an hourly maintenance plan. 1. Identify tasks that must be performed
once per hour.
2. Disable the current schedules for these
jobs in reparation for consolidating them
into a single maintenance plan.
3. Use the Maintenance Plan designer in
SQL Server Management Studio to
consolidate these tasks into an hourly

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 42

maintenance plan.
Update the run book. 1. Remove the scheduling information for
the jobs that are now included in the
daily and hourly maintenance plans.
2. Add a section entitled Maintenance
Plan to the run book.
3. Document the daily and hourly
maintenance plans in the Maintenance
Plans section, detailing which jobs are
included and when the plans are
scheduled to run.
Answer Key
Preparing the database
You must perform the following steps to prepare the database.
1. Use Windows Explorer to view the contents of D:\Labfiles\Starter.
2. Double-click PrepareDB.cmd to execute the database preparation script.
3. Close Windows Explorer.

Identifying and documenting the current backup activities


You must perform the following steps to identify and document the current backup activities.
1. Open the Notes From Bob.doc located at D:\Labfiles\Starter and identify the required backup
activities.
2. Start SQL Server Management Studio, connecting to the MIAMI Database Engine by using
Windows authentication.
3. In Object Explorer, expand SQL Server Agent and Jobs to view the currently defined jobs.
4. Identify any jobs that automate backup tasks (there should be one; AdventureWorks - Full
DB Backup.)
5. Right-click the Jobs folder and create a new job named AdventureWorks - Transaction
Log Backup. The job should have the following steps and schedules:
• A step named Backup Log that executes the following Transact-SQL statement in the
master database:
BACKUP LOG [AdventureWorks] TO
DISK = N'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Backup\AdventureWorks.bak'
WITH NOFORMAT, NOINIT,
NAME = N'AdventureWorks-Transaction Log Backup',
SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
• A schedule named Hourly Backup Schedule that runs the job daily, every 1 hour from
12:00 AM to 11:59PM.
6. Enter the backup information into Run Book.doc, which is located in D:\Labfiles\Starter,
detailing the tasks that must be performed, the jobs that have been created to perform them,
and the schedules for the jobs.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 43

Identifying and documenting the current index maintenance activities.


You must perform the following steps to identify and document the current index maintenance
activities.
1. Examine the Notes From Bob.doc located at D:\Labfiles\Starter and identify the index
maintenance requirements.
2. In SQL Server Management Studio, identify any jobs that automate index maintenance tasks
(there should be three; Rebuild SalesOrderHeader Indexes, Rebuild
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID Index, and Rebuild
AK_SalesOrderDetail_Rowguid Index.)
3. Right-click the Jobs folder and create a new job named Rebuild
IX_SalesOrderDetail_ProductID. The job should have the following steps and schedules:
• A step named Rebuild Index that executes the following Transact-SQL statement in the
AdventureWorks database:
USE [AdventureWorks]
GO
ALTER INDEX [IX_SalesOrderDetail_ProductID] ON
[Sales].[SalesOrderDetail] REBUILD WITH ( PAD_INDEX = OFF,
STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON, SORT_IN_TEMPDB = OFF, ONLINE = OFF )
GO
• A schedule named Rebuild IX_SalesOrderDetail_ProductID Daily that runs the job
daily at 11:40 PM.
4. Enter the index maintenance information into Run Book.doc, detailing the tasks that must be
performed, the jobs that have been created to perform them, and the schedules for the jobs.

Identifying and documenting the database integrity monitoring strategy


You must perform the following steps to identify and document the database integrity monitoring
strategy.
1. Open the Notes From Bob.doc and Business Requirements.doc located at D:\Labfiles\Starter
and identify the database integrity monitoring requirements.
2. In SQL Server Management Studio, identify any jobs that automate database integrity
monitoring tasks (there should be none)
3. Right-click the Jobs folder and create a new job named Check AdventureWorks Integrity.
The job should have the following steps and schedules:
• A step named Rebuild Index that executes the following Transact-SQL statement in the
master database:
DBCC CHECKDB ('AdventureWorks')
GO
• A schedule named Check AdventureWorks Integrity Weekly that runs the every
Sunday at 6:00 AM.
4. Enter the database integrity monitoring information into Run Book.doc, detailing the tasks
that must be performed, the jobs that have been created to perform them, and the schedules
for the jobs.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 44

Creating a job dependency diagram


You must perform the following steps to create a job dependency diagram.
1. Open the Notes From Bob.doc located at D:\Labfiles\Starter and identify all the scheduled
jobs. More jobs may exist than listed in the Notes from Bob document.
2. Use the drawing tools in Microsoft Office Word to create a job dependency diagram in Run
Book.doc.

Creating a daily maintenance plan


You must perform the following steps to create a daily maintenance plan.
1. Examine Run Book.doc, Notes From Bob.doc, Business Requirements.doc, and the existing
SQL Server Agent jobs to identify all jobs that are performed once per day. The daily jobs
are:
• Update ProductSalesToday
• Rebuild AK_SalesOrderDetail_Rowguid Index
• Rebuild IX_SalesOrderDetail_ProductID
• AdventureWorks - Full DB Backup
2. In Object Explorer, view the properties of each of these jobs, and edit the current schedules to
disable them.
3. In Object Explorer, expand Management, right-click Maintenance Plans and click New
Maintenance Plan. Name the maintenance plan Daily Maintenance Plan.
4. In the Description box, type Daily maintenance tasks.
5. Click Connections to verify that the plan includes a connection to MIAMI that uses
Windows authentication.
6. If the toolbox is not visible, on the View menu, click Toolbox. Then from the toolbox, drag
the Execute SQL Server Agent Job Tasks object to design surface.
7. Edit the created task and configure it to execute the Update ProductSalesToday job.
8. Repeat steps 6 and 7 for the following jobs:
• Rebuild AK_SalesOrderDetail_Rowguid Index
• Rebuild IX_SalesOrderDetail_ProductID
• AdventureWorks - Full DB Backup
9. Drag the precedence arrows from each job to the next in the order they are listed above.
10. Click the Schedule ellipses button (…) and schedule the maintenance plan to run every night
at 11:30.
11. Save and close the maintenance plan.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 45

Creating an hourly maintenance plan


You must perform the following steps to create an hourly maintenance plan
1. Examine Run Book.doc, Notes From Bob.doc, Business Requirements.doc, and the existing
SQL Server Agent jobs to identify all jobs that are performed once per hour. The only hourly
job is AdventureWorks - Transaction Log Backup.
2. In Object Explorer, view the properties of each of this job, and edit the current schedule to
disable it.
3. In Object Explorer, expand Management, right-click Maintenance Plans and click New
Maintenance Plan. Name the maintenance plan Hourly Maintenance Plan.
4. In the Description box, type Hourly maintenance tasks.
5. Click Connections to verify that the plan includes a connection to MIAMI that uses
Windows authentication.
6. If the toolbox is not visible, on the View menu, click Toolbox. Then from the toolbox, drag
the Execute SQL Server Agent Job Tasks object to design surface.
7. Edit the created task and configure it to execute the AdventureWorks - Transaction Log
Backup job.
8. Click the Schedule ellipses button (…) and schedule the maintenance plan to run every hour.
9. Save and close the maintenance plan.

Update the run book


You must perform the following steps to update the run book.
1. Remove the scheduling information for the jobs that are now included in the daily and hourly
maintenance plans.
2. Add a section entitled Maintenance Plan to the run book.
3. Document the daily and hourly maintenance plans in the Maintenance Plans section,
detailing which jobs are included and when the plans are scheduled to run.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 46

Exercise 2: Creating Database Change Control Procedures


Introduction
In this exercise, you will create database change control procedures and update the run book
accordingly.
Identify and document a change control procedures policy

Task Supporting information


Identify a change control procedures policy. 1. Identify personnel roles in the database
change process according to the roles
described in the following documents
(which are located in
D:\Labfiles\Starter):
• Business Owner Role.doc
• DDBA Role.doc
• Developer Role.doc
Document the change control procedures 2. Add the change control procedures
policy to the Change Control Procedure
section in the run book document.
Answer key
Identifying a change control procedures policy
You must perform the following steps to identify a change control procedures policy.
1. Identify the environments and the participant roles in each phase:
• Development -Application developer
• Quality assurance - Application developer, DBA, Business owner
• Production - Application developer, DBA, Business owner

Document the change control procedures


You must perform the following steps to document the change control procedures.
1. Document the process in Run Book.doc, which is located in D:\ Labfiles\Starter.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 47

Exercise 3: Configuring and Using the SQL H2 Tool


Introduction
In this exercise, you will configure and use the SQL Health and History tool.
Configure the SQL H2 tool to collect monitoring data from existing database server

Task Supporting information


Configure the SQL H2 tool. 1. Install the SQL H2 Configuration Program by
running H2Setup.msi in the
D:Labfiles\Starter\SQLH2 folder. Use the
following installation options:
• Select the option to start the configuration
tool after installation.
• Install the SQLH2 Repository database
page on MIAMI by using the default database
name and connection options.
• Do not send data to Microsoft from the
Repository.
2. In the configuration tool, ensure MIAMI is
listed as a target and configure the collector to
run every day at 10:00 PM using the
MIAMI\SQLServer account with the
password Pa$$w0rd.
Use the SQL H2 tool to collect performance 1. Run the H2PerfSetup.msi setup application
data. located in the D:\Labfiles\Starter\SQLH2
folder. Use the wizard to install the
performance collector in the default location
and configure it to use the LocalSystem
account.
2. The current version of the SQLH2
performance collector tool installs incorrect
performance counters. Replace the
H2PerfConfigFile.xml file in the
C:\SQLH2\PerfCollector folder with the same
file located at D:\Labfiles\Starter\SQLH2
folder.
3. Use the Services administrative tool to start
the Microsoft SQLH2 Performance
Collector Windows service.
Use the SQL H2 tool to collect monitoring 1. Stop the Microsoft SQLH2 Performance
data. Collector service.
2. Delete all the files in the
C:\SQLH2\PerfCollector\Data folder.
3. Copy the file pfc120805011504.txt located at
D:\Labfiles\Starter to the
C:\SQLH2\PerfCollector\Data folder.
4. Start the SQLH2 Configuration utility on the

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 48

Start menu.
5. On the Config file menu, click Edit and add
MIAMI as a PerfProvider.
6. Close SQL H2 Configuration utility.
7. Start the C:\SQLH2\SQLH2.exe application to
insert the collected data into the database.
View SQL H2 reports. 1. Use SQL Server Configuration Manager to
start the SQL Server Reporting Services
(MSSQLSERVER) service.
2. Run SetupDB.cmd in the
D:\Labfiles\Starter\SQLH2\SQLH2 Reports
folder.
3. Start Internet Explorer and browse to
http://localhost/reports.
4. Click New Data Source and create a new data
source named SQLH2Repository that uses
the connection string
SERVER=MIAMI;DATABASE=SQLH2Re
pository with Windows authentication.
5. Click Upload File and upload the
Performance Counters.rdl report from the
D:\Labfiles\Starter\SQLH2\SQLH2 Reports
folder.
6. When the file is uploaded, click Performance
Counters to view the report. Note that you can
select a specific counter and then click View
Report to generate a chart showing values for
the selected counter.
7. Close Internet Explorer.
Answer key
Configuring the SQL H2 tool
You must perform the following steps to configure the SQL H2 tool.
1. Install the SQL H2 Configuration Program by running H2Setup.msi in the
D:Labfiles\Starter\SQLH2 folder. Select the option to start the configuration tool after
installation.
2. On the Welcome to SQLH2 Installation & Configuration Wizard page, click Next.
3. On the Please choose a server to install SQLH2 Repository Database page, enter MIAMI
as the server, accept the default database and connection options, and click Next.
4. On the Please decide whether you want to allow sharing data from the Repository with
Microsoft page, leave the Allow sending data to Microsoft from the Repository option
unselected, and click Next.
5. When installation is finished, click Next.
6. On the Please enter the list of computers you want to collect from page, ensure MIAMI is
included in the Targets list, and click Next.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 49

7. On the Schedule a task for SQLH2 Collector page, configure the collector to run every day
at 10:00 PM using the MIAMI\SQLServer account with the password Pa$$w0rd. Then
click Next.
8. On the The Wizard has completed all the necessary steps page, click Finish, and on the
Installation Complete page, click Close.

Using the SQL H2 tool to collect performance data


You must perform the following steps to use the SQL H2 tool to collect performance data.
1. Run the H2PerfSetup.msi setup application located in the D:\Labfiles\Starter\SQLH2 folder.
Use the wizard to install the performance collector in the default location and configure it to
use the LocalSystem account.
2. The current version of the SQLH2 performance collector tool installs incorrect performance
counters. Replace the H2PerfConfigFile.xml file in the C:\SQLH2\PerfCollector folder with
the same file located at D:\Labfiles\Starter\SQLH2 folder.
3. Use the Services administrative tool to start the Microsoft SQLH2 Performance Collector
Windows service.

Using the SQL H2 tool to collect monitoring data


You must perform the following steps to use the SQL H2 tool to collect monitoring data.
1. Stop the Microsoft SQLH2 Performance Collector service.
2. Delete all the files in the C:\SQLH2\PerfCollector\Data folder.
3. Copy the file pfc120805011504.txt located at D:\Labfiles\Starter to the
C:\SQLH2\PerfCollector\Data folder.
4. To start the SQL H2 Configuration Utility, click Start, point to All Programs, and then click
SQLH2 Configuration Utility.
5. On the Config file menu, click Edit.
6. In the PerfProviders item, add the MIAMI server. This text represents the location of the
data source from where to collect data. Save the changes to the configuration file.
7. Close SQL H2 Configuration Utility.
8. Start the C:\SQLH2\SQLH2.exe application that will insert the data into the database. Note
that after data is inserted into the database, the files in the C:\SQLH2\PerfCollector\Data
folder will be deleted.

Viewing SQL H2 reports


You must perform the following steps to view SQL H2 reports.
1. Use SQL Server Configuration Manager to start the SQL Server Reporting Services
(MSSQLSERVER) service.
2. Run SetupDB.cmd in the D:\Labfiles\Starter\SQLH2\SQLH2 Reports folder.
3. Start Internet Explorer and browse to http://localhost/reports.
4. Click New Data Source and create a new data source named SQLH2Repository that uses
the connection string SERVER=MIAMI;DATABASE=SQLH2Repository, and then select
Windows integrated security.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 1: Managing and Automating Databases and Servers 50

5. Click Upload File and upload the Performance Counters.rdl report from the
D:\Labfiles\Starter\SQLH2\SQLH2 Reports folder.
6. When the file is uploaded, click Performance Counters to view the report. Note that you can
select a specific counter and then click View Report to generate a chart showing values for
the selected counter.
7. Close Internet Explorer.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting
Services
Time estimated: 165 minutes
Table of contents
Module 2: Managing SQL Server Supporting Services.......................................................................... 1
Lesson 1: Managing SSIS Packages.................................................................................................. 4
Manage SSIS Packages. ............................................................................................................ 4
What Is an SSIS Package? ............................................................................................................. 6
Concept: Explain the concept of SSIS packages. ...................................................................... 6
Demonstration: Guidelines for Deploying SSIS Packages ............................................................ 9
Principle: Apply guidelines for deploying SSIS packages. ....................................................... 9
Guidelines for Monitoring SSIS Packages................................................................................... 13
Principle: Apply guidelines for monitoring SSIS packages. ................................................... 13
Lesson 2: Managing Replication ...................................................................................................... 15
Manage Replication................................................................................................................. 15
Discussion: Guidelines for Administering Replication................................................................ 17
Principle: Apply guidelines for administering replication....................................................... 17
Considerations for Choosing Replication Monitoring Tools ....................................................... 19
Principle: Evaluate scenarios for monitoring and verifying replication, and choosing
monitoring tools. ..................................................................................................................... 19
Multimedia: Replication Monitor in SQL Server 2005 ............................................................... 21
Concept: Explain the usage of Replication Monitor in SQL Server 2005............................... 21
Lesson 3: Managing Reporting Services .......................................................................................... 22
Considerations for Managing the Report Server Configuration .................................................. 23
Principle: Evaluate considerations for managing the report server configuration................... 23
Guidelines for Managing Reporting Services Databases............................................................. 25
Principle: Apply guidelines for managing Reporting Services databases. .............................. 25
Guidelines for Managing Report Servers..................................................................................... 27
Principle: Apply guidelines for managing reporting services at Web server. ......................... 27
Lab: Managing SQL Server Supporting Services ............................................................................ 29
Exercise 2: Initializing a Transactional Subscription from a Backup ......................................... 35
Exercise 3: Configuring Reporting Services............................................................................... 41

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 2

Module objective
In this module you will learn how to:

Manage SQL Server supporting services

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 3

Introduction
Microsoft® SQL Server™ 2005 has many components that serve a wide range of purposes, each of
which has its place in the provision of database services and related supporting services. In this
module you will focus on several of the key supporting services, namely Integration Services,
Replication, and Reporting Services.
Microsoft SQL Server Integration Services (SSIS) is the key component of SQL Server 2005 that
supports Extract, Transfer, and Load (ETL) operations and related work flows through FTP,
messaging, transformation services, script execution, and other processes, usually through the use of
SSIS packages. Integration services has its own management and administration requirements that
database administrators (DBAs) must be aware of separate from the rest of the product.
Replication is not new to SQL Server 2005 but the replication features include a number of new
capabilities and tools. To manage replication well, the DBA must be familiar with these product
features. In this module, you will learn about these features and how to use them to run and automate
replication.
Reporting Services provides SQL Server 2005 with a flexible, Web-enabled reporting capability.
Reports can be based on various data sources and produced in a range of formats. Like all core
services, Reporting Services requires particular administration and can be usefully automated.

For more information


See the following major topics in Books Online: “SQL Server Integration Services (SSIS),” “SQL
Server Reporting Services,” and “SQL Server Replication.” Each topic has a series of “InfoCenters”
for rapid access to key considerations and procedures that are associated with each of these central
supporting services.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 4

Lesson 1: Managing SSIS Packages

Lesson objective
After completing this lesson, you will be able to:

Manage SSIS Packages.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 5

Introduction
SSIS is new to SQL Server 2005. Although related conceptually to the older Data Transformation
Services (DTS) tools in SQL Server 2000, the new tool set has more capabilities along with new
graphical tools. DBAs who have created DTS packages must be aware of specific migration issues
from old packages to SSIS packages.
Most of the work done in SSIS is done through packages, which are collections of one or more steps
used to accomplish data import, export, transformations, or a combination thereof. Most SSIS
packages also involve the use of notifications and other steps for purposes of data verification,
scheduling, and package step confirmation of success or failure. In this lesson, you will learn about
SSIS packages and guidelines for how to deploy and manage SSIS packages.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 6

What Is an SSIS Package?

Concept: Explain the concept of SSIS packages.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 7

What is an SSIS package?


SSIS packages are an organized collection of tasks and workflow elements that you assemble using
either the graphical design tools that SSIS provides or build programmatically. You save a package to
SQL Server 2005, the SSIS Package Store, or the file system.
The emphasis in this definition is on organized. Packages are structured to execute package tasks in a
particular manner by using a specified workflow. Dependencies between the package steps ensure that
later steps do or do not execute depending on the outcome of earlier steps. Steps can be scheduled,
managed with flow control operations, and reused.
Packages can also be secured, stored, configured, deployed, and executed in a variety of ways through
SSIS functions and through more general SQL Server automation options.
There are many uses for SSIS packages in daily database work. Most typically, they are used for data
import and export, population of data warehouses and data marts with new data, dissemination of data
to other systems, integration of data from other systems into SQL Server, and manipulation of data
moving between systems. In SQL Server 2005, there is also extended support through SSIS packages
for the handling of XML data.
SSIS package contents
Major components of packages include one or more of the following:
• Control flow elements
• Data flow elements
• Data tasks
• Connection managers
• Event handlers
• Configurations
• SSIS variables
• Logging
• Checkpoints and restarts
• Security settings
• Transaction attributes
For more information
For details about the objects and components see “Integration Services Objects and Concepts.” In
SQL Server Books Online.

Securing SSIS packages


SSIS packages might include important business logic, business rules, or other sensitive material that
represent corporate intellectual property (IP). Examples can include data transformations or other data
handling that involve patents, finances, business strategies, scientific data, or national security–related
processes. Precisely because of these requirements, SQL Server 2005 has a special provision for
“sensitive data” in addition to its normal security measures.
SSIS packages can be secured through the following:
• Use of encryption and passwords

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 8

• Setting package protection levels


• Controlling access and execution through SSIS database roles
• SQL Server security through package storage selection
• Restricted Integration Services folder access
• File system security for files referenced by SSIS packages
• Digital signatures on packages
• Limiting access to packages in SQL Server Management Studio

For more information


See the topic “Security Considerations for Integration Services” in Books Online.

Differences between DTS and SSIS packages


DTS and a number of the features associated with it have been deprecated in SQL Server 2005. For
purposes of version transition, this SQL Server 2005 provides for backward compatibility with DTS
packages.
When Integration Services is installed, DTS features (DTS runtime and package enumeration) are also
installed. This provides support for side-by-side deployment and execution. The Package Migration
Wizard is provided to facilitate the migration of DTS packages into an SSIS package format.
However, there are significant differences between the DTS and SSIS technologies and tools. There is
no DTS package editor, although it might be provided in an updated edition after the release of SQL
Server 2005 by means of a Web download add-on.
SSIS packages are Microsoft .NET Framework compliant and support .NET compliant languages,
whereas DTS are COM based and not .NET Framework compliant.

For more information


See the topic “Integration Services programming” in SQL Server Books Online.
Furthermore, there is no Meta Data Services repository or support for Repository packages because
this feature has been deprecated.
Finally, the tools and tasks for DBAs have changed significantly. The administration (see previous
section) tools have new capabilities, they have different interfaces, and there are more tools than
before. DBAs must now administer SSIS roles, package security, and package protection levels.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 9

Demonstration: Guidelines for Deploying SSIS Packages

Principle: Apply guidelines for deploying SSIS packages.


Introduction
SSIS package deployment requires that DBAs consider the range of uses of packages in their
organization. They then need to design, create, and deploy them with proper attention to maintaining
proper security at all times.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 10

Guidelines
To use packages properly, the DBA must do the following:
• Identify deployable packages.
• Import and export packages as required.
• Configure packages for deployment.
• Do package deployment using either a deployment utility or through automation using
dtutil.exe.

Preparation steps before the demonstration


Create the tmpSalesByCreditCard table in AdventureWorksDW.
1. Run the PrepareDB.cmd command file in D:\Democode.
Verify that the MIAMI SQL Server instance is the database repository for the SSIS service.
2. Click Start, click Run, type C:\Program Files\Microsoft SQL Server\90\DTS\Binn, and
then click OK.
2. Open the MsDtsSrvr.ini.xml file by using Notepad.
3. Verify that file contains the following code:

<?xml version="1.0" encoding="utf-8"?>


<DtsServiceConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<StopExecutingPackagesOnShutdown>true</StopExecutingPackagesOnShu
tdown>
<TopLevelFolders>
<Folder xsi:type="SqlServerFolder">
<Name>MSDB</Name>
<ServerName>.</ServerName>
</Folder>
<Folder xsi:type="FileSystemFolder">
<Name>File System</Name>
<StorePath>..\Packages</StorePath>
</Folder>
</TopLevelFolders>
</DtsServiceConfiguration>
Pay attention to the first occurrence of the <ServerName> tag. Its value must be “.”.
4. Save the file and exit Notepad.
5. In SQL Server Configuration Manager, right-click the SQL Server Integration Services
service and then click Restart.
6. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click
SQL Server Management Studio.
7. In the Connect to Server dialog box, click Integration Services in the Server type list and
MIAMI in the Server Name list, and then click Connect.
8. In the Object Explorer window, expand Stored Packages and then expand the MSDB folder.
The Maintenance Plans folder is listed. This demonstrates that SSIS can successfully connect
to the MSDB database in the specified server in Step 3.
9. Keep SQL Server Management Studio open. You will use it in the next procedure.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 11

To save an SSIS package to SQL Server


1. In the D:\Democode folder, right-click the SalesByCreditCard.dtsx file, and then click Edit.
The package will open in SQL Server Business Intelligence Development Studio.
10. On the File menu, click Save Copy of SalesByCreditCard.dtsx As.
2. In the Save Copy of Package dialog box, in the Package location list, click SQL Server. In
the Server list, click MIAMI. In the Package path box, type /Demo.
3. Click the button next to the Protection level box.
4. In the Package Protection level dialog box, in the Package Protection level list, click Rely
on server storage and roles for access control, and then click OK.
5. In the Save Copy of Package dialog box, click OK.
6. Close SQL Server Business Intelligence Development Studio.
7. In SQL Server Management Studio, refresh the MSDB folder in Object Explorer and verify
that the Demo package has been copied to this server.
8. Keep SQL Server Management Studio open. You will use it again later in this demonstration.

To modify packages properties and use configurations


1. In the D:\Democode, folder, double-click Demo 2789 M2L1.sln to open it in SQL Server
Business Intelligence Development Studio.
2. In Solution Explorer, double-click SalesByCreditCard.dtsx.
3. On the SSIS menu, click Package Configurations.
4. In the Package Configurations Organizer dialog box, select the Enable package
configuration check box.
5. Click the Add button.
6. In the Package Configuration Wizard, click Next.
7. In the Configuration type list, click XML configuration file.
8. Select Specify configuration settings directly and then type D:\Democode\Demo 2789
M2L1\config.dtsconfig.
9. Click Next.
10. From the objects tree in the connection managers folder, first expand Adventure works
DW, then expand the properties folder, and finally select the ServerName check box. This
process allows administrators to modify the server that the data source connects to when
deploying the package.
11. Click Next.
12. In the Configuration name text box, accept the default value, and then click Finish.
13. In Package Configurations Organizer, click Close.
14. Press CTRL+SHIFT+S to save all the projects.

To create a deployment utility


1. In the SQL Server Business Intelligence Development Studio, on the Project menu, click
Demo 2789 M2L1 Properties.
2. Click Deployment Utility.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 12

3. In the right pane, select True for the CreateDeploymentUtility option. Notice the value of
the DeploymentOutputPath property. Click OK.
4. On the Build menu, click Build Demo 2789 M2L1.
5. Close SQL Server Business Intelligence Developer Studio.
6. Using Microsoft Windows® Explorer, view the D:\Democode\Demo 2789 M2L1\bin folder,
and then open the Deployment folder.
7. Notice the following three files:
• SalesByCreditCard.dtsx—This is the package.
• config.dtsconfig —This is the configuration file specified for changing the value of
ServerName of one of the connection managers.
• Demo 2789 M2L1.SSISDeploymentManifest—This is the installation descriptor.

To deploy a package
8. Double-click the Demo 2789 M2L1.SSISDeploymentManifest file to start the Package
Installation Wizard and click Next.
9. On the Deploy SSIS packages screen, click SQL Server deployment and then click Next.
10. On the Specify Target SQL Server screen, in the Server Name box, type MIAMI and then
click Next.
11. On the Select Installation Folder screen, click Next.
12. On the Confirm Installation Screen, click Next.
13. On the Configure Packages screen, notice the name of the configuration file. Expand the
Property node, and note the current value of the \Package.Connections[Adventure
Works],Properties[ServerName] property (which should be MIAMI.) Then click Next.
14. On the Finish Package Installation Wizard screen, click Finish.

To verify the export of the package to the server


1. In SQL Server Management Studio, refresh the MSDB folder in Object Explorer and verify
that the SalesByCreditCard package has been deployed to this server.
11. Right-click SalesByCreditCard and then click Run Package.
12. In the Execute Package Utility window, select Connection Managers. The Adventure
Works and Adventure Works DW connection managers appear. Notice that the Connection
String for the Adventure Works DW configuration manager has the value of the configuration
specified at deployment time.
13. Click Execute to run the package. After it completes, click Close in the Package Execution
Progress dialog box and click Close in the Execute Package Utility window.
14. Close SQL Server Management Studio.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 13

Guidelines for Monitoring SSIS Packages

Principle: Apply guidelines for monitoring SSIS packages.


Introduction
SSIS packages can do a range of tasks from the very simple to the very complex. The more complex
the package, the greater the likelihood that there will be performance effects to consider. It is also
important to routinely monitor packages to ensure that they are executing properly, that they are
returning expected results, and that they have not failed for any reason.
Packages can be monitored through a number of tools. The following guidelines provide a starting
point for deciding which tools to use for which purposes.
You can run these tools manually or automate them to monitor SSIS packages.
Guidelines for Monitoring SSIS Packages and Automating Monitoring
• Use the SSIS service
Monitoring packages, which use the tools available in SSIS and SQL Server Management Studio,
provide quick and accessible information related to the activities of a server at any time. SSIS
provides centralized storage information, regardless of the particular type of storage that is
implemented.
• Use SSIS package logs

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 14

SSIS introduces the capability of detailed and customizable logging of package execution. In an
SSIS package, you can configure your choice of location to store the logs. For instance, you can
store logs in a SQL Server table, an XML file, or the Windows Event log. You can define logging
at a package level or a task level. You can also choose the events and columns that you want to
log for a specified level.
• Use Application Event Viewer and alerts
When logging events to Windows Event log, you can generate alerts related to specific SSIS
events. For instance, you can create an alert to indicate that a particular task inside a package has
failed. This alert can be based on the OnError event, either at the package level or at the task
level.
• Create alerts for performance monitor counters
An alert generated as a result of a performance counter not meeting a specified threshold helps
you realize the important execution conditions in packages. An example of an execution condition
can be the successful completion of a package.
• Implement notifications
SSIS has a control task that permits sending e-mail messages. You can include this kind of
notification in a package to ensure that you are updated when a specific sequence of tasks has
been executed.
• Use database activity monitoring tools
In most cases, SSIS reads and writes data from multiple sources. You must use traditional
database tools to verify the connection status of a package. For example, you can use tools to
verify that a connection is not blocked or to determine the number of resources a package is
consuming inside a database.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 15

Lesson 2: Managing Replication

Lesson objective
After completing this lesson, you will be able to:

Manage Replication.
Introduction
SQL Server 2005 has a range of replication technologies that provide a powerful and flexible
mechanism to distribute data to multiple servers and keep everything synchronized. The
synchronization process has the effect of binding the two servers together so that issues on one server
can affect the other server. In all forms, replication can be used to copy and distribute data between
database objects, between databases, and between servers and mobile devices. To ensure that
replication happens properly; is done in a timely manner; and is managed with regard to data
processes, backup, restore, and performance, there are a number of things that DBAs must understand
and be familiar with.
In addition to the three types of replication (transactional, merge, snapshot) there are important
differences between server-to-server replication and server-to-client replication.

For more information


See the topics “Replicating Data in a Server to Server Environment” and “Replicating Data Between a
Server and Clients” in Books Online.

For more information

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 16

See Books Online topics “SQL Server Replication” and “Using Merge Replication.” The latter topic
includes extensive material on SQL Server Mobile replication.

Note
Replication is covered in detail in Course 2788, Designing High Availability Database Solutions
Using Microsoft SQL Server 2005.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 17

Discussion: Guidelines for Administering Replication

Principle: Apply guidelines for administering replication.

Discussion questions

Q. What considerations do you need to make when backing up a publisher participating in


transactional replication?
A. A replicated environment contains many dependencies to ensure that all changes are sent from the
publisher to each subscriber. The distribution database contains a replication watermark that is used as
the starting point for the Log Reader Agent. If the replication watermark is out of synch with the
transaction log, transactional replication will shut down with an error. Transactions are held in the
distribution database until written to all subscribers. If the subscription database were to be restored to
a previous point in time, it would be out of synch with the rest of the environment and unable to be
reconciled without being reinitialized. Because of the very strict state relationship between the
publisher, distributor, and subscriber, you must ensure that each database is backed up in a coherent
state with respect to the replication environment. You can accomplish this task by using the synch
with backup option.
Q. How do backup considerations change with merge replication?
A. The tracking tables that determine changes to be sent between publisher and subscriber are
contained in the same database as the data being published. Furthermore, the publisher and subscriber

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 18

maintain a full set of state data. Because the merge engine is designed to calculate changes that need
to be exchanged between sites, there are no special considerations for backups and restores with
merge replication.
Q. In what order should service packs be applied in a replicated environment?
A. Service packs and hot fixes should always be applied to the distributor first. After the distributor is
updated, changes should be applied to the publisher. The last step in the upgrade process is to apply
the service packs and/or hotfixes to all subscribers.
Q. How do you manage schema changes in a replicated environment?
A. Previous versions of Microsoft® SQL Server™ imposed very strict limitations on changes to the
schema. SQL Server 2005 does not impose any restrictions and it does not require special procedures.
All schema changes are sent from the publisher to all subscribers during the first synchronization
cycle following the change.
Q. How do you determine how long it will take to catch up, once replication has fallen behind in
distributing transactions to the subscriber?
A. In previous versions of SQL Server, this question could not be answered. The infrastructure did not
exist to determine the two components required to answer this question: number of changes pending
distribution and how long it takes a transaction to move from publisher to subscriber. SQL Server
2005 introduces addition instrumentation into the engine, which provides the ability to calculate end-
to-end transit time for a transaction. With this additional piece of information provided by tracer
tokens, an administrator can now determine how much time it will take to finish synchronizing the
environment.

These suggested topics are not exhaustive but provide a starting point for the class.
ƒ After which replication related changes should you capture a new backup of each replication
database? Your answer should include the changes and the related replication database to
backup.
ƒ How do you ensure that all subscribers are synchronized after a restore of the publication
database in a merge replication? How is this synchronization process different if the
replication is using the HTTPS protocol?
ƒ When should you use a backup to initialize transactional replication?
ƒ What schema changes must be propagated to subscribers manually?
ƒ Why should you regularly generate replication topology scripts?

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 19

Considerations for Choosing Replication Monitoring Tools

Principle: Evaluate scenarios for monitoring and verifying replication, and choosing monitoring tools.
Considerations for choosing monitoring tools
In selecting monitoring tools, the DBA should consider the following:
• Monitoring health of environment. A monitoring tool should be able to display the status of
any replication component and the task it is performing. Any monitoring solution, especially
for replication, should display aggregated information across an entire environment.
Note
It is a common mistake to classify a tool that can connect to each server and display information for
each server on an individual basis as providing an aggregated view. Replication has components
running on multiple servers simultaneously, which requires the use of tools that can establish multiple
connections to multiple servers and aggregate all the monitoring data into a single console without
requiring a DBA to connect manually to multiple servers.
• Troubleshooting errors. In the event of an error, a monitoring tool should display any error
messages in a single consolidated view and eliminate the need for a DBA to access tables,
event logs, or error logs separately to obtain the error information.
• Determining latency. A critical element in any replication environment is latency. DBAs are
always working to minimize latency. Any monitoring tool that does not meet the needs to
measure latency is only marginally effective in any production environment.
• Comparing tables. SQL Server provides routines to determine whether data on the publisher
is synchronizing with data on the subscriber. Determining whether databases are

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 20

synchronized is only part of the process. A monitoring tool should also be able to indicate to a
DBA which rows are not synchronized and generate compensating transactions so that the
DBA can repair the environment.
• Resolving errors. Many monitoring tools have the capability to resolve certain types of errors
automatically, without user intervention. This capability is useful when the system encounters
the same types of errors repeatedly; it might be possible to program logic into the monitoring
system to deal with the problem instead of having to wait for manual intervention.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 21

Multimedia: Replication Monitor in SQL Server 2005

Concept: Explain the usage of Replication Monitor in SQL Server 2005.


Usage of Replication Monitor
This multimedia covers the basic features of the new Replication monitor, including the following:
• Layout of the tool
• Publications monitoring
• Watching subscription lists
• Ways to do common jobs
• Use of tracer tokens

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 22

Lesson 3: Managing Reporting Services

Lesson objective
After completing this lesson, you will be able to:
Introduction
Reporting Services is a powerful but complex product. This complexity comes from the number of
elements involved in his architecture: databases, Web services, windows services, Web sites, and,
occasionally, custom assemblies.
DBAs must manage Reporting Services components, from configuration following installation, to
applying security corporate policies, to scaling up reporting solutions. In this lesson, you will learn
about considerations and guidelines for adjusting Reporting Services to solution requirements.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 23

Considerations for Managing the Report Server Configuration

Principle: Evaluate considerations for managing the report server configuration.


Assess ways configuration can be managed and determine the most appropriate tool to use
DBAs should determine the specific configuration requirements for their particular installations and
deployments. No two sites are the same in their requirements. SQL Server 2005 documentation
provides extensive guidelines and discussion of these issues in addition to detailed checklists that
should be used to comprehensively assess requirements.
After the requirements are determined, the DBA must assess the relative strengths and weaknesses of
each configuration management tool or approach:
• Reporting Services Configuration Tool
• Reporting Services command-line utilities
• Manual configuration
Graphical tools provide easy-to-use interfaces for configuration management and include Reporting
Services Configuration Manager, SQL Server Management Studio, and SQL Server Configuration
Management.
Command-line utilities are useful for scripting, command-line execution, batch processing, and SQL
Server Agent jobs. These include rs, rsconfig, and rskeymgmt.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 24

Configuration files (which are stored in an XML format) can also be edited manually for some
purposes; in other cases, some settings can be changed only manually.
Through the use of these tools, the DBA can manage virtual directories, Reporting Services databases,
encryption, service accounts, and many other settings.

Caution
In the case of manual editing of configuration files, be aware that incorrect configuration can cause
Reporting Services to use a default value, fail to start at all, or log an error to the Windows application
log. In most cases it is advisable to work through the graphical user interface (GUI) or command-line
tools.

For more information


See the topics “Report Server Administration Tools” and “Reporting Services Configuration Files” in
Books Online for detailed discussions of tool features and the configuration files that they affect.
Follow the specific configuration file links to see the items managed by each file and the types of
values that must be supplied.

Plan Reporting Services Configurations


Reporting Services configurations can cover a range of requirements with different types of
deployment. Consider the differences between default configurations of stand-alone installations and
scaled-out solutions. There are potentially differences in granting users permission to access Reporting
Services, backing up encryption keys, or enabling functionalities such as My Reports or downloading
the ActiveX® client print control. There are also differences to consider in handling server load, load
balancing in the case of scaled-out deployments, and monitoring requirements in each case. As with
all administration functions, deployment and configuration management should be properly
documented in policies, procedures, and in the run book.
DBAs in charge of configuration settings might also need to set up Secure Sockets Layer (SSL)
security, manage certificates, move databases from one server to another, or update accounts used by
services. In addition, password maintenance can also be required for Reporting Services service
accounts.
Choose an automation method
Reporting Services operations can be automated in two major areas: report processing and delivery,
and other administration operations:
• Automating report processing and delivery is managed through the Report Manager Web
application.
• For automating other administration operations you can use the rs.exe utility. This utility
executes scripts written in Microsoft Visual Basic®. These scripts use the Reporting Services
application programming interface to perform selected operations

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 25

Guidelines for Managing Reporting Services Databases

Principle: Apply guidelines for managing Reporting Services databases.


Security
Reporting Services databases are accessed by internally configured users. Reporting Services users do
not access these databases directly, so you do not need to grant specific access to them. Following the
usual security recommendations, the use of specifically created internal-service users is recommended
for all Reporting Services–related operations.
Reporting Services stores sensitive data such as user names and passwords in its databases. It encrypts
sensitive data using a symmetric key. Key-related information must be backed up and secured using
the provided configuration tools or the command-line utilities.
Backup
To back up and restore Reporting Services databases, you would use your accustomed SQL Server
backup tool because these databases are just regular databases. You can discard backing up the
ReportServerTempDB database because it contains information that has a short expiration time.
However, in case of disaster, you must create at least a database with identical name for Reporting
Services to run normally.
Because Reporting Services has a multicomponent architecture, backing up databases is not enough to
have a complete solution backup. You must back up configuration files, encryption keys, and custom
extensions (if any).

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 26

IIS
Reporting Services depends on Internet Information Services (IIS) virtual directories. These
directories must be properly configured and secured. DBAs might need to work with other IT
professionals to deal with IIS issues.
Logging
Reporting Services provides for extensive logging of its operations. Logs must be reviewed on a
regular basis to determine whether there are any problems with the service.
Performance
Use of Reporting Services is usually a core business activity and is usually heavily used. To determine
patterns of use and any related performance issues, DBAs need to do regular performance monitoring
of all aspects of the service.
Temporary data
You can configure Reporting Services to store temporary snapshots in the file system instead of using
ReportServerTempDB. These snapshots can be compressed to take up less storage space. You can
enable this functionality through configuration files. You should change the default storage path
because it defaults to a subfolder of the Reporting Services installation path.
Moving Reporting Services Databases
If you decide to move Reporting Services databases to a different database server, you can move the
current database using regular tools. However, after moving the database you must update Reporting
Services configuration files accordingly. To do so, use Reporting Services Configuration Manager or
the rsconfig command-line utility
Storage Space
Storage space required for the Report Server database varies depending on how your solution is
configured. The Report Server database can grow to a significant size.
Storage space required for the temporary database depends on reports: how big, how many, and for
how long they will be maintained in the system. DBAs must monitor real usage to adjust the space
requirements. This monitoring must be done during peak workload hours because temporary
snapshots occupy the maximum space.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 27

Guidelines for Managing Report Servers

Principle: Apply guidelines for managing reporting services at Web server.


Analyze reports workload
Users demand reports that have a very different report processing workload, refreshing frequency, and
targeted audience size. Understanding how reports will be processed and consumed is the first step to
plan a good reporting strategy. Pay attention to reports with bigger workloads, are frequently
requested, or are targeted to big audiences. You should establish a life cycle strategy for those reports
found to be more critical.
Establish a caching and report history strategy
After report processing and consumption is analyzed, use Reporting Services features to adjust the
processing and timeliness of reports. To adjust it, you might use simple features such as caching to
more sophisticated features such as combining snapshots with data-driven subscriptions. Gaining a
good understanding of these features is critical.
Evaluate data source connections
Many Reporting Services features benefit from unattended execution capability. Such features must
use specific credentials to access data sources and perform report processing and delivery. Options for
credentials vary when accessing reports interactively on demand. You should analyze which users will
use preprocessed reports or on-demand reports and establish a credential strategy that does not
increase security risks at data sources.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 28

Manage security
Reporting Services has its own set of roles, permissions, and authorized users. You should revise
those roles to decide whether adding new roles is necessary.
When there are many users, and volatility or turnover ratio is significant, you can benefit from using
data-driven subscriptions instead of grating permissions to user and groups specifically. Alternatively,
you should create some scripts to automate user management.
Manage subscriptions
Users are granted to subscribe to updated reports and to receive results at selected destinations. This
kind of subscription is managed by the subscription owner. Obsolete subscriptions, no longer required
but still active, might cause unnecessary processing. Therefore, you should establish a strategy for
keeping track of subscriptions and checking whether they stay current.
Review execution logs
Reporting Services maintains logs, which can be adjusted in logging detail level or completely
deactivated through configuration files. The Report Execution Log maintains information about report
execution history on a server. This log can be deactivated through Report Manager, although it is
enabled by default. To exploit log information, you must use the provided Integration Services
package to put log data into a database table

Determine a scheduling strategy


Scheduling automatic processing of reports is a very useful feature. Scheduling is available from
shared schedules or from report-specific schedules. Only users and roles with the appropriate
credentials are allowed to create shared schedules or to schedule individual reports. Therefore, you
should plan which users will be granted permission to create shared schedules or to schedule
individual reports. In case you decide to create shared schedules, you might consider offering different
schedules for hourly, weekly, and monthly reports, for example.
User-created subscriptions are managed by users themselves, and there is no interface available to list
all existing user-managed subscriptions. Therefore, in case many users require scheduling
permissions, you must establish a procedure to keep track of their scheduling requirements and the
impact on the overall system. This procedure can be administrative, such as asking for a schedule to
be created.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 29

Lab: Managing SQL Server Supporting Services

Estimated time: 70 minutes


Introduction
In this lab you will configure and deploy an SSIS package, initialize transactional replication from a
backup, and move the Reporting Services database from one server to another.
Scenario
You are a newly hired DBA at Adventure Works. The company makes extensive use of SQL Server
Integration Services, replication, and Reporting Services.
Preparation
Ensure that the virtual machine 2789A-MIA-SQL-01 is running and that you are logged on as
Student.
If a virtual machine has not been started, perform the following steps:
1. Close any other running virtual machines.
15. Start the virtual machine.
16. In the Log On to dialog box, complete the logon procedure by using the user name Student
and the password Pa$$w0rd.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 30

Exercise 1: Deploying an SSIS Package


Introduction
In this exercise you will configure and deploy an SSIS package.
Configuring and deploying an SSIS package
Task Supporting Information
Prepare the 1. Run the PrepareDB.cmd command file in
AdventureWorksDW database. D:\Labcode\Starter.
Verify that the MIAMI SQL 1. View the MsDtsSrvr.ini.xml configuration file in
Server instance is the database C:\Program Files\Microsoft SQL Server\90\DTS\Binn.
repository for the SSIS service. 2. Verify that the database repository for the SSIS service is
the MSDB database on the local default server (.).
Save the SalesByCreditCard 1. Open the SalesByCreditCard.dtsx package, which is
SSIS package to SQL Server. provided in the D:\Labfiles\Starter folder in SQL Server
Business Intelligence Developer Studio.
2. Save a copy if the package in the MIAMI SQL Server.
The copy should be named CCSales and should rely on
server storage and roles for access control.
Create a package configuration 1. Use SQL Server Business Intelligence Developer Studio
for the SalesByCreditCard to open the AWPackages.sln solution in
package in the AWPackages D:\Labfiles\Starter.
solution. 2. Add an XML configuration file package configuration to
the SalesByCrediCard package. The package
configuration should enable administrators to change the
server that the Adventure Works connection manager
uses.
Create a deployment utility for 1. Configure the AWPackages project properties to create a
the AWPackages solution. deployment utility.
2. Build the AWPackages project.
3. Verify that the deployment utility has been generated.
Deploy the SalesByCreditCard 1. Use the deployment utility you generated in the previous
package. task to deploy the SalesByCreditCard package to the
MIAMI SQL Server instance.
2. Use the default value for the server name property in the
configuration file.
3. Verify that the package has been deployed.
4. Run the package.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 31

Procedure answer key


Preparing the AdventureWorksDW database
You must perform the following steps to prepare the AdventureWorksDW database.
1. Run the PrepareDB.cmd command file in D:\Labcode\Starter.

Verifying that the MIAMI SQL Server instance is the database repository for the SSIS service
You must perform the following steps to verify that the MIAMI SQL Server instance is the
database repository for the SSIS service.
1. Click Start, click Run, type C:\Program Files\Microsoft SQL Server\90\DTS\Binn, and
then click OK.
2. Open the MsDtsSrvr.ini.xml file by using Notepad.
3. Verify that the file contains the following code:

<?xml version="1.0" encoding="utf-8"?>


<DtsServiceConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<StopExecutingPackagesOnShutdown>true</StopExecutingPackagesOnShu
tdown>
<TopLevelFolders>
<Folder xsi:type="SqlServerFolder">
<Name>MSDB</Name>
<ServerName>.</ServerName>
</Folder>
<Folder xsi:type="FileSystemFolder">
<Name>File System</Name>
<StorePath>..\Packages</StorePath>
</Folder>
</TopLevelFolders>
</DtsServiceConfiguration>
Pay attention to the first occurrence of the <ServerName> tag. Its value must be “.”.
4. Save the file and exit Notepad.
5. In SQL Server Configuration Manager, right-click the SQL Server Integration Services
service and then click Restart.
6. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click
SQL Server Management Studio.
7. In the Connect to Server dialog box, click Integration Services in the Server type list and
MIAMI in the Server Name list, and then click Connect.
8. In the Object Explorer, expand Stored Packages and then expand the MSDB folder. The
Maintenance Plans folder is listed. This procedure demonstrates that SSIS can successfully
connect to the MSDB database in the specified server in Step 3.
9. Keep SQL Server Management Studio open. You will use it in the next procedure.

Saving the SalesByCreditCard SSIS package to SQL Server


You must perform the following steps to save the SalesByCreditCard SSIS package to Microsoft®
SQL Server™.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 32

1. Click Start, click Run, type D:\Labcode\Starter, and then click OK.
2. Right-click the SalesByCreditCard.dtsx file, and then click Edit. The package opens in SQL
Server Business Intelligence Development Studio.
3. On the File menu, click Save Copy of SalesByCreditCard.dtsx As.
4. In the Save Copy of Package dialog box, in the Package location list, click SQL Server. In
the Server list, click MIAMI. In the Package path box, type /CCSales.
5. Click the button next to the Protection level box.
6. In the Package Protection level dialog box, in the Package Protection level list, click Rely
on server storage and roles for access control and then click OK.
7. In the Save Copy of Package dialog box, click OK.
8. Close SQL Server Business Intelligence Development Studio.
9. In SQL Server Management Studio, refresh the MSDB folder in Object Explorer and verify
that the Demo package has been copied to this server.
10. Keep SQL Server Management Studio open. You will use it again later in this exercise.

Creating a package configuration for the SalesByCreditCard package in the AWPackages solution
You must perform the following steps to create a package configuration for the SalesByCreditCard
package in the AWPackages solution.
1. In the D:\Labfiles\Starter, folder, double-click AWPackages.sln to open it in SQL Server
Business Intelligence Development Studio.
2. In Solution Explorer, double-click SalesByCreditCard.dtsx.
3. On the SSIS menu, click Package Configurations.
4. In the Package Configurations Organizer dialog box, select the Enable package
configuration check box.
5. Click the Add button.
6. In the Package Configuration Wizard, click Next.
7. In the Configuration type list, click XML configuration file.
8. Select Specify configuration settings directly and then type
D:\Labfiles\Starter\AWPackage\config.dtsconfig.
9. Click Next.
10. From the objects tree in the connection managers folder, expand Adventure works DW,
expand the properties folder, and finally then the ServerName check box. This will allow
administrators to modify the server that the data source connects to when deploying the
package.
11. Click Next.
12. In the Configuration name box, accept the default value and then click Finish.
13. In Package Configurations Organizer, click Close.
14. Press CTRL+SHIFT+S to save all the projects.

Creating a deployment utility for the AWPackages solution


You must perform the following steps to create a deployment utility for the AWPackages solution.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 33

1. In the SQL Server Business Intelligence Development Studio, on the Project menu, click
AWPackages.
2. Click Deployment Utility.
3. In the right pane, select True for the CreateDeploymentUtility option. Notice the value of
the DeploymentOutputPath property. Click OK.
4. On the Build menu, click Build AWPackages.
5. Close SQL Server Business Intelligence Developer Studio.
6. Using Windows Explorer, view the D:\Labfiles\AWPackages\bin folder, and then open the
Deployment folder.
7. Notice the following three files:
• SalesByCreditCard.dtsx—This is the package.
• config.dtsconfig —This is the configuration file specified for changing the value of
ServerName of one of the connection managers.
• AWPackages.SSISDeploymentManifest—This is the installation descriptor.

Deploying the SalesByCreditCard package


You must perform the following steps to deploy the SalesByCreditCard package.
1. Double-click the AWPAckages.SSISDeploymentManifest file to start the Package
Installation Wizard and then click Next.
2. On the Deploy SSIS packages screen, select the SQL Server deployment option and then
click Next.
2. On the Specify Target SQL Server screen, in the Server Name box, type MIAMI and then
click Next.
3. On the Select Installation Folder screen, click Next.
4. On the Confirm Installation Screen, click Next.
5. On the Configure Packages screen, notice the name of the configuration file. Expand the
Property node, and note the current value of the \Package.Connections[Adventure
Works],Properties[ServerName] property (which should be MIAMI). Click Next.
6. On the Finish Package Installation Wizard screen, click Finish.
3. In SQL Server Management Studio, refresh the MSDB folder in Object Explorer and verify
that the SalesByCreditCard package has been deployed to this server.
4. Right-click SalesByCreditCard and then click Run Package.
5. In the Execute Package Utility window, select Connection Managers. The Adventure
Works and Adventure Works DW connection managers appear. Notice that the Connection
String for the Adventure Works DW configuration manager has the value of the configuration
specified at deployment time.
6. Click Execute to run the package; After it completes, click Close in the Package Execution
Progress dialog box and click Close in the Execute Package Utility window.
7. Close SQL Server Management Studio.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 34

Questions
Q When do you think it is necessary to deploy packages to a server?
A When moving from development to testing environments
A When moving from testing to production environments
A When restoring a server from a backup

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 35

Exercise 2: Initializing a Transactional Subscription from a Backup


Introduction
Adventure Works Cycles must develop a reporting solution to manage various aspects of company
operations. To minimize the impact of reporting operations in the environment, a dedicated reporting
database is being created, which will be synchronized with production using transactional replication.
Initializing a Subscription
Task Supporting Information
Create a SQL Server Scripts project named 1. Start SQL Server Management Studio.
AWReplication. 2. Create a new SQL Server Scripts project
named AWReplication in the
D:\Labfiles\Starter folder.
Create a publication on MIAMI named 1. Use the New Publication Wizard to create a
AWTables that contains all tables in new transactional publication named
AdventureWorks. AWTables. Use the following information to
help you:
• MIAMI should be configured as both
the publisher and the distributor.
• The publication should contain all tables
in the AdventureWorks database.
• Do not create an initial snapshot.
• The snapshot agent should use the
MIAMI\Student account with the password
Pa$$w0rd.
• Generate a script for the publication and
add it to the project.
Configure the AWTables publication for 1. View the properties of the AWTables
initialization from backup. publication.
2. In the Subscription Options category, set
the Allow initialization from backup files
property to True.
Back up the AdventureWorks database on 1. Use Object Explorer to back up the
MIAMI. AdventureWorks database on MIAMI,
generating a script file for the action.
2. Add the script file you generated to the
project.

Restore the AdventureWorks database on 1. Use Object Explorer to restore the


MIAMI\SQLINSTANCE2. AdventureWorks database to
MIAMI\SQLINSTANCE2. You must move
the database files as part of the restore
process. Generate a script file for the restore
action.
2. Add the script file you generated to the
project

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 36

Initialize a subscription on 1. Add a new query to the project, connecting to


MIAMI\SQLINSTANCE2 from the backup MIAMI.
of AdventureWorks. 2. Execute the sp_addsubscription stored
procedure in the AdventureWorks database
with the following options:
• @publication = 'AWTables'
• @subscriber =
'MIAMI\SQLINSTANCE2'
• @destination_db = 'AdventureWorks'
• @subscription_type = 'push'
• @sync_type = 'initialize with
backup'
• @backupdevicetype = 'location of
the backup file'

Establish a baseline latency measurement by 1. Use Replication Monitor to view the


using a tracer token. AWTables publication.
2. Add a tracer token and view the latency
measurement for the AWTables publication.

Procedure Answer Key


Creating a SQL Server Scripts project named AWReplication
You must perform the following steps to create a SQL Server Scripts project named AWReplication.
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click
SQL Server Management Studio.
2. In the Connect to Server dialog box, specify the values in the following table and then click
Connect.
Property Value
Server type Database Engine
Server name MIAMI
Authentication Windows Authentication

3. On the File menu, point to New and then click Project.


4. In the New Project dialog box, specify the values in the following table and then click OK.
Property Value
Name AWReplication
Location D:\Labsfiles\Starter

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 37

Create directory for Cleared


solution

Creating a publication on MIAMI named AWTables that contains all tables in AdventureWorks
You must perform the following steps to create a publication on MIAMI named AWTables that
contains all tables in AdventureWorks.
1. If Object Explorer is not visible, click Object Explorer on the View menu.
2. In Object Explorer, expand Replication, right-click Local Publications, and then click New
Publication.
5. On the New Publication Wizard page, click Next.
6. On the Distributor page, click Next to use MIAMI as its own distributor.
7. On the Snapshot Folder page, click Next to use the default snapshot folder location.
8. On the Publication Database page, click AdventureWorks to choose it as the publication
database and then click Next.
9. On the Publication Type page, click Transactional publication and then click Next.
10. On the Articles page, select Tables, and then click Next.
11. Click Next on the Filter Table Rows page.
12. On the Snapshot Agent page, leave all check boxes unselected and click Next.
13. On the Agent Security page, click Security Settings.
14. Enter MIAMI\Student as the Process account. Enter Pa$$w0rd in the Password and
Confirm Password boxes. Leave By impersonating the process account selected and then
click OK.
15. Click Next on the Agent Security page.
16. On the Wizard Actions page, select the Create the publication and Generate a script file
with steps to create the publication check boxes and then click Next.
17. On the Script File Properties page, change the File name to
D:\Labfiles\Starter\AWReplication\PublicationScript.sql and then click Next.
18. On the Complete the Wizard page, enter AWTables as the Publication name and then click
Finish.
19. On the Creating Publication page, wait until all actions have been completed, check that
there are no errors, and then click Close.
20. On the Project menu, click Add Existing Item.
21. Add D:\Labfiles\Starter\AWReplication\PublicationScript.sql. When prompted, connect to
MIAMI by using Windows authentication.
22. On the File menu click Save All.

Configuring the AWTables publication for initialization from backup


You must perform the following steps to configure the AWTables publication for initialization from
backup.
1. In Object Explorer, expand the Local Publications folder. If the AWTables publication is
not listed, right-click the folder and click Refresh.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 38

2. Right-click [AdventureWorks]:AWTables, and click Properties.


3. In the Select a Page pane, click Subscription Options.
4. Set the Allow initialization from backup files property to True, and then click OK.

Backing up the AdventureWorks database on MIAMI


You must perform the following steps to back up the AdventureWorks database on MIAMI
1. In Object Explorer, expand the Databases folder.
2. Right-click AdventureWorks, point to Tasks, and then click Back Up.
3. Click Full as the Backup type.
4. Note the default backup destination in the Destination section.
5. Click the arrow for the Script button and then click Script Action to File. Save the file as
D:\Labfiles\Starter\AWReplication\Backup.sql.
6. Click OK to back up the database. When the backup is complete, click OK to close the
message box.
7. On the Project menu, click Add Existing Item.
8. Add D:\Labfiles\Starter\AWReplication\Backup.sql. When prompted, connect to MIAMI by
using Windows authentication.
9. On the File menu, click Save All.

Restore the AdventureWorks database on MIAMI\SQLINSTANCE2.


You must perform the following steps to restore the AdventureWorks database on
MIAMI\SQLINSTANCE2.
1. In Object Explorer, click the Connect button on the toolbar and then click Database Engine.
2. In the Connect to Server dialog box, specify the values in the following table and then click
Connect.
Property Value
Server type Database Engine
Server name MIAMI\SQLINSTANCE2
Authentication Windows Authentication

3. In Object Explorer, right-click the Databases folder for MIAMI\SQLINSTANCE2 and then
click Restore Database.
4. In the To database box, type AdventureWorks.
5. Select From device and then click the ellipsis button (...).
6. Click Add, select C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Backup\AdventureWorks.bak, and then click OK.
7. Click OK in the Specify Backup dialog box.
8. Select the AdventureWorks – Full Database Backup check box in the list of backup sets.
9. Click Options in the Select a Page pane.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 39

10. Change the Restore As value for AdventureWorks_Data to C:\Program Files\Microsoft


SQL Server\MSSQL.4\MSSQL\Data\AdventureWorks_Data.mdf.
11. Change the Restore As value for AdventureWorks_Log to C:\Program Files\Microsoft
SQL Server\MSSQL.4\MSSQL\Data\AdventureWorks_Log.ldf.
12. In the Restore Database dialog box, click the arrow for the Script button and then click
Script Action to File. Save the file as D:\Labfiles\Starter\AWReplication\Restore.sql.
13. Click OK to restore the database. When the restoration is complete, click OK to close the
message box.
14. On the Project menu, click Add Existing Item.
15. Add D:\Labfiles\Starter\AWReplication\Restore.sql. When prompted, connect to
MIAMI\SQLINSTANCE2 by using Windows authentication.
16. On the File menu, click Save All.

Initializing a subscription on MIAMI\SQLINSTANCE2 from the backup of AdventureWorks


You must perform the following steps to initialize a subscription on MIAMI\SQLINSTANCE2 from
the backup of AdventureWorks.
1. On the Project menu, click New Query. When prompted, connect to MIAMI by using
Windows authentication.
2. In Solution Explorer, rename the new query file to SubscriptionScript.sql.
3. Type the following Transact-SQL code in the new query window:
USE AdventureWorks
GO
EXEC sp_addsubscription
@publication='AWTables',
@subscriber = 'MIAMI\SQLINSTANCE2',
@destination_db = 'AdventureWorks',
@subscription_type='push',
@sync_type = 'initialize with backup',
@backupdevicetype = 'disk',
@backupdevicename = 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Backup\AdventureWorks.bak'
4. Click the Execute button on the toolbar, and then click Save All on the File menu.
5. In Object Explorer, expand the Replication and Local Subscriptions folder for the
MIAMI\SQLINSTANCE2 server and verify that the subscription has been created.

Establishing a baseline latency measurement by using a tracer token


You must perform the following steps to establish a baseline latency measurement by using a tracer
token.
1. In Object Explorer, right-click the Replication folder under the MIAMI server and click
Launch Replication Monitor.
2. In Replication Monitor, expand MIAMI and click the [AdventureWorks]:AWTables
publication.
3. On the Tracer Tokens tab, click Insert Tracer. Note the time that the tracer was inserted
and the latency measurements that it recorded.
4. Close Replication Monitor and SQL Server Management Studio.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 40

Discussion
Q Why do you want to establish a performance baseline?
A The most fundamental question that is asked in a production environment is: “How long
will it take me to be synchronized.” The amount of time to synchronize is dependent
upon knowing the amount of data that needs to be sent along with the amount of time it
takes for a transaction to reach the subscriber. Replication Monitor will display the
number of commands that are pending transfer. A tracer token is used to measure the
time required for a transaction to move from the publisher to the subscriber. By
creating a tracer token after the subscription is created, you will establish the amount of
time it takes for a transaction to move from the publisher to the subscriber. Replication
Monitor can then use this information along with the number of transactions waiting to
be sent to answer the question of how long it will take to be synchronized.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 41

Exercise 3: Configuring Reporting Services


Introduction
In this exercise, you will move the Reporting Services internal databases to the new SQL Server
instance.
Move the report server database to the new database instance.
Task Supporting information
Detach the Reporting Services databases 1. Use SQL Server Configuration Manager to
from MIAMI. stop the SQL Server Reporting Services
and SQL Server Agent(MSSQLSERVER)
services.
2. Start SQL Server Management Studio and
connect to MIAMI by using Windows
authentication.
3. Detach the ReportServer and
ReportServerDB databases.
4. Use Windows Explorer to copy the
ReportServer and ReportServerTempDB
database files from C:\Program
Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data to
C:\Program Files\Microsoft SQL
Server\MSSQL.4\MSSQL\DataRestart the
SQL Server Agent (MSSQSERVER)
service.
Attach the Reporting Services database on 1. In Object Explorer, connect to
MIAMI\SQLINSTANCE2. MIAMI\SQLINSTANCE2.
2. Attach the ReportServer and
ReportServerTempDB databases.
Configure Reporting Services to use the 1. View the properties of the AWTables
databases on MIAMI\SQLINSTANCE2. publication.
2. In the Subscription Options category, set
the Allow initialization from backup files
property to True.
Back up the AdventureWorks database on 1. Use Object Explorer to back up the
MIAMI. AdventureWorks database on MIAMI,
generating a script file for the action.
2. Add the script file you generated to the
project.
Restore the AdventureWorks database on 1. Use Object Explorer to restore the
MIAMI\SQLINSTANCE2. AdventureWorks database to
MIAMI\SQLINSTANCE2. You must move
the database files as part of the restore
process. Generate a script file for the restore
action.
2. Add the script file you generated to the

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 42

project.
Initialize a subscription on 1. Add a new query to the project, connecting to
MIAMI\SQLINSTANCE2 from the backup MIAMI.
of AdventureWorks. 2. Execute the sp_addsubscription stored
procedure in the AdventureWorks database
with the following options:
• @publication = 'AWTables'
• @subscriber =
'MIAMI\SQLINSTANCE2'
• @destination_db = 'AdventureWorks'
• @subscription_type = 'push'
• @sync_type = 'initialize with
backup'
• @backupdevicetype = 'location of
the backup file'
Establish a baseline latency measurement by 1. Use Replication Monitor to view the
using a tracer token. AWTables publication.
2. Add a tracer token and view the latency
measurement for the AWTables publication.
Procedure Answer Key
Detaching the Reporting Services databases from MIAMI
You must perform the following steps to detach the Reporting Services databases from MIAMI.
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, point to
Configuration Tools, and click SQL Server Configuration Manager.
2. In the list of SQL Server 2005 services, right-click SQL Server Reporting Services and
click Stop.
3. Right-click the SQL Server Agent (MSSQLSERVER) service and click Stop.
4. Minimize SQL Server Configuration Manager.
5. Start SQL Server Management Studio, connecting to the MIAMI Database Engine by using
Windows authentication when prompted.
6. In Object Explorer, expand Databases.
7. Right-click the ReportServer database, point to Tasks, and click Detach. Then click OK to
detach the database.
8. Repeat the previous step for the ReportServerTempDB database.
9. Use Windows Explorer to move the ReportServer.mdf, ReportServer_Log.ldf,
ReportServerTempDB.mdf, and ReportServerTempDB_Log.ldf database files from
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data to C:\Program
Files\Microsoft SQL Server\MSSQL.4\MSSQL\Data.
10. In SQL Server Configuration Manager, restart the SQL Server Agent (MSSQLSERVER)
service. Then close SQL Server Configuration Manager.

MCT USE ONLY. STUDENT USE PROHIBITED


Module 2: Managing SQL Server Supporting Services 43

Attaching the Reporting Services database on MIAMI\SQLINSTANCE2


You must perform the following steps to attach the Reporting Services database on
MIAMI\SQLINSTANCE2.
1. In Object Explorer, click Connect and connect to the MIAMI\SQLINSTANCE2 Database
Engine by using Windows authentication.
2. Right-click the Databases folder under MIAMI\SQLINSTANCE2 and click Attach.
3. In the Attach Databases dialog box, click the Add button and click the ReportServer.mdf
file; then click Add again and click the ReportServerTempDB.mdf file. Click OK.

Configuring Reporting Services to use the databases on MIAMI\SQLINSTANCE2


You must perform the following steps to configure Reporting Services to use the databases on
MIAMI\SQLINSTANCE2.
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, point to
Configuration Tools, and click Reporting Services Configuration. When prompted, connect to
the MSSQLSERVER instance on MIAMI.
2. Click Database Setup, and then type MIAMI\SQLINSTANCE2 in the Server Name box and
click Connect. Then select ReportServer in the Database Name box.
3. Click Apply and then click OK to connect to MIAMI\SQLINSTANCE2.
4. When the changes have been applied, click Server Status and click Start. Verify that the
Reporting Services service starts, and then click Exit.
Discussion
Q What should you do to document Reporting Services in a run book?
A Answers will vary. The following are some examples of information that you can
document in a run book:
• Periodic maintenance tasks: Review of execution logs and performance counters
• Architectural aspects for quick reference: Role of each report server if there are multiple
servers
• Security aspects: Credentials used by shared data sources
• Reporting Services specific information such as the following:
• Storage path of the encryption key backup
• Source of subscriber information for data-driven subscriptions
• Service Level Agreement issues such as:
• Critical reports
• Maximum processing time allowed
• Schedule for refreshing reports
• Expected recipients
• Delivery channels
• System status history such as: Evolution of the number of users, reports, and storage
space requirements

MCT USE ONLY. STUDENT USE PROHIBITED

You might also like