What’s New in SQL Server System and Database Administration
System Administrator Responsibilities
System Databases
System Tables
System Views
System Stored Procedures
Summary
8 Installing SQL Server 2008
What’s New in Installing SQL Server 2008
Installation Requirements
Installation Walkthrough
Installing SQL Server Using a Configuration File
Installing Service Packs and Cumulative Updates
Slipstream Installations
Summary
9 Upgrading to SQL Server 2008
What’s New in Upgrading SQL Server
Using the SQL Server Upgrade Advisor (UA)
Destination: SQL Server 2008 or SQL Server 2008 R2
Upgrading Using a Configuration File
Slipstreaming Upgrades
Upgrading Other SQL Server Components
Summary
10 Client Installation and Configuration
What’s New in Client Installation and Configuration
Client/Server Networking Considerations
Client Installation
Client Configuration
Client Data Access Technologies
Summary
11 Security and User Administration
What’s New in Security and User Administration
An Overview of SQL Server Security
Authentication Methods
Managing Principals
Managing Securables
Managing Permissions
Managing SQL Server Logins
Managing SQL Server Users
Managing Database Roles
Managing SQL Server Permissions
The Execution Context
Summary
12 Data Encryption
What’s New in Data Encryption
An Overview of Data Security
An Overview of Data Encryption
SQL Server Key Management
Column-Level Encryption
Transparent Data Encryption
Column-Level Encryption Versus Transparent Data Encryption
Summary
13 Security and Compliance
Exposure and Risk
Across the Life Cycle
The Security Big Picture
Identity Access Management Components
Compliance and SQL Server
SQL Server Auditing
Setting Up Auditing via T-SQL
SQL Injection Is Easy to Do
Summary
14 Database Backup and Restore
What’s New in Database Backup and Restore
Developing a Backup and Restore Plan
Types of Backups
Recovery Models
Backup Devices
Backing Up a Database
Backing Up the Transaction Log
Backup Scenarios
Restoring Databases and Transaction Logs
Restore Scenarios
Additional Backup Considerations
Summary
15 Database Mail
What’s New in Database Mail
Setting Up Database Mail
Sending and Receiving with Database Mail
Using SQL Server Agent Mail
Related Views and Procedures
Summary
16 SQL Server Scheduling and Notification
What’s New in Scheduling and Notification
Configuring the SQL Server Agent
Viewing the SQL Server Agent Error Log
SQL Server Agent Security
Managing Operators
Managing Jobs
Managing Alerts
Scripting Jobs and Alerts
Multiserver Job Management
Event Forwarding
Summary
17 Administering SQL Server 2008 with PowerShell
What’s New with PowerShell
Overview of PowerShell
PowerShell Scripting Basics
PowerShell in SQL Server 2008
Step-By-Step Examples
Summary
18 SQL Server High Availability
What’s New in High Availability
What Is High Availability?
The Fundamentals of HA
Building Solutions with One or More HA Options
Other HA Techniques That Yield Great Results
High Availability from the Windows Server Family Side
Summary
19 Replication
What’s New in Data Replication
What Is Replication?
The Publisher, Distributor, and Subscriber Magazine Metaphor
Replication Scenarios
Subscriptions
Replication Agents
Planning for SQL Server Data Replication
SQL Server Replication Types
Basing the Replication Design on User Requirements
Setting Up Replication
Scripting Replication
Monitoring Replication
Summary
20 Database Mirroring
What’s New in Database Mirroring
What Is Database Mirroring?
Roles of the Database Mirroring Configuration
Setting Up and Configuring Database Mirroring
Testing Failover from the Principal to the Mirror
Client Setup and Configuration for Database Mirroring
Migrate to Database Mirroring 2008 as Fast as You Can
Using Replication and Database Mirroring Together
Using Database Snapshots from a Mirror for Reporting
Summary
21 SQL Server Clustering
What’s New in SQL Server Clustering
How Microsoft SQL Server Clustering Works
Installing SQL Server Clustering
Summary
22 Administering Policy-Based Management
Introduction to Policy-Based Management
Policy-Based Management Concepts
Implementing Policy-Based Management
Sample Templates and Real-World Examples
Policy-Based Management Best Practices
Summary
Part IV: Database Administration
23 Creating and Managing Databases
What’s New in Creating and Managing Databases
Data Storage in SQL Server
Database Files
Creating Databases
Setting Database Options
Managing Databases
Summary
24 Creating and Managing Tables
What’s New in SQL Server 2008
Creating Tables
Defining Columns
Defining Table Location
Defining Table Constraints
Modifying Tables
Dropping Tables
Using Partitioned Tables
Creating Temporary Tables
Summary
25 Creating and Managing Indexes
What’s New in Creating and Managing Indexes
Types of Indexes
Creating Indexes
Managing Indexes
Dropping Indexes
Online Indexing Operations
Indexes on Views
Summary
26 Implementing Data Integrity
What’s New in Data Integrity
Types of Data Integrity
Enforcing Data Integrity
Using Constraints
Rules
Defaults
Summary
27 Creating and Managing Views in SQL Server
What’s New in Creating and Managing Views
Definition of Views
Using Views
Creating Views
Managing Views
Data Modifications and Views
Partitioned Views
Indexed Views
Summary
28 Creating and Managing Stored Procedures
What’s New in Creating and Managing Stored Procedures
Advantages of Stored Procedures
Creating Stored Procedures
Executing Stored Procedures
Deferred Name Resolution
Viewing Stored Procedures
Modifying Stored Procedures
Using Input Parameters
Using Output Parameters
Returning Procedure Status
Debugging Stored Procedures Using SQL Server Management Studio
Using System Stored Procedures
Startup Procedures
Summary
29 Creating and Managing User-Defined Functions
What’s New in SQL Server 2008
Why Use User-Defined Functions?
Types of User-Defined Functions
Creating and Managing User-Defined Functions
Rewriting Stored Procedures as Functions
Creating and Using CLR Functions
Summary
30 Creating and Managing Triggers
What’s New in Creating and Managing Triggers
Using DML Triggers
Using DDL Triggers
Using CLR Triggers
Using Nested Triggers
Using Recursive Triggers
Summary
31 Transaction Management and the Transaction Log
What’s New in Transaction Management
What Is a Transaction?
How SQL Server Manages Transactions
Defining Transactions
Transactions and Batches
Transactions and Stored Procedures
Transactions and Triggers
Transactions and Locking
Coding Effective Transactions
Transaction Logging and the Recovery Process
Long-Running Transactions
Bound Connections
Distributed Transactions
Summary
32 Database Snapshots
What’s New with Database Snapshots
What Are Database Snapshots?
Limitations and Restrictions of Database Snapshots
Copy-on-Write Technology
When to Use Database Snapshots
Setup and Breakdown of a Database Snapshot
Reverting to a Database Snapshot for Recovery
Setting Up Snapshots Against a Database Mirror
Database Snapshots Maintenance and Security Considerations
Summary
33 Database Maintenance
What’s New in Database Maintenance
The Maintenance Plan Wizard
Managing Maintenance Plans Without the Wizard
Executing a Maintenance Plan
Maintenance Without a Maintenance Plan
Database Maintenance Policies
Summary
Part V: SQL Server Performance and Optimization
34 Data Structures, Indexes, and Performance
What’s New for Data Structures, Indexes, and Performance
Understanding Data Structures
Database Files and Filegroups
Database Pages
Space Allocation Structures
Data Compression
Understanding Table Structures
Understanding Index Structures
Data Modification and Performance
Index Utilization
Index Selection
Evaluating Index Usefulness
Index Statistics
SQL Server Index Maintenance
Index Design Guidelines
Indexed Views
Indexes on Computed Columns
Filtered Indexes and Statistics
Choosing Indexes: Query Versus Update Performance
Identifying Missing Indexes
Identifying Unused Indexes
Summary
35 Understanding Query Optimization
What’s New in Query Optimization
What Is the Query Optimizer?
Query Compilation and Optimization
Query Analysis
Row Estimation and Index Selection
Join Selection
Execution Plan Selection
Query Plan Caching
Other Query Processing Strategies
Parallel Query Processing
Common Query Optimization Problems
Managing the Optimizer
Summary
36 Query Analysis
What’s New in Query Analysis
Query Analysis in SSMS
SSMS Client Statistics
Using the SET SHOWPLAN Options
Using sys.dm_exec_query_plan
Query Statistics
Query Analysis with SQL Server Profiler
Summary
37 Locking and Performance
What’s New in Locking and Performance
The Need for Locking
Transaction Isolation Levels in SQL Server
The Lock Manager
Monitoring Lock Activity in SQL Server
SQL Server Lock Types
SQL Server Lock Granularity
Lock Compatibility
Locking Contention and Deadlocks
Table Hints for Locking
Optimistic Locking
Summary
38 Database Design and Performance
What’s New in Database Design and Performance
Basic Tenets of Designing for Performance
Logical Database Design Issues
Denormalizing a Database
Database Filegroups and Performance
RAID Technology
SQL Server and SAN Technology
Summary
39 Monitoring SQL Server Performance
What’s New in Monitoring SQL Server Performance
Performance Monitoring Tools
A Performance Monitoring Approach
Summary
40 Managing Workloads with the Resource Governor
Overview of Resource Governor
Resource Governor Components
Configuring Resource Governor
Monitoring Resource Usage
Modifying Your Resource Governor Configuration
Summary
41 A Performance and Tuning Methodology
The Full Architectural Landscape
Primary Performance and Tuning Handles
A Performance and Tuning Methodology
Performance and Tuning Design Guidelines
Tools of the Performance and Tuning Trade
Summary
Part VI: SQL Server Application Development
42 What’s New for Transact-SQL in SQL Server 2008
MERGE Statement
Insert over DML
GROUP BY Clause Enhancements
Variable Assignment in DECLARE Statement
Compound Assignment Operators
Row Constructors
New date and time Data Types and Functions
Table-Valued Parameters
Hierarchyid Data Type
Using FILESTREAM Storage
Sparse Columns
Spatial Data Types
Change Data Capture
Change Tracking
Summary
43 Transact-SQL Programming Guidelines, Tips, and Tricks
General T-SQL Coding Recommendations
General T-SQL Performance Recommendations
T-SQL Tips and Tricks
In Case You Missed It: New Transact-SQL Features in SQL Server 2005
The xml Data Type
The max Specifier
TOP Enhancements
The OUTPUT Clause
Common Table Expressions
Ranking Functions
PIVOT and UNPIVOT
The APPLY Operator
TRY...CATCH Logic for Error Handling
The TABLESAMPLE Clause
Summary
44 Advanced Stored Procedure Programming and Optimization
T-SQL Stored Procedure Coding Guidelines
Using Cursors in Stored Procedures
Nested Stored Procedures
Using Temporary Tables in Stored Procedures
Using Remote Stored Procedures
Stored Procedure Performance
Using Dynamic SQL in Stored Procedures
Installing and Using .NET CLR Stored Procedures
Using Extended Stored Procedures
Summary
45 SQL Server and the .NET Framework
What’s New in SQL Server 2008 and the .NET Framework
Getting Comfortable with ADO.NET 3.5 and SQL Server 2008
Developing with LINQ to SQL
Using ADO.NET Data Services
Leveraging the Microsoft Sync Framework
Summary
46 SQLCLR: Developing SQL Server Objects in .NET
What’s New for SQLCLR in SQL Server 2008
Developing Custom Managed Database Objects
Summary
47 Using XML in SQL Server 2008
What’s New in Using XML in SQL Server 2008
Understanding XML
Relational Data As XML: The FOR XML Modes
XML As Relational Data: Using OPENXML
Using the xml Data Type
Indexing and Full-Text Indexing of xml Columns
Summary
48 SQL Server Web Services
What’s New in SQL Server Web Services
Web Services Migration Path
Web Services History and Overview
Building Web Services
Examples: A C# Client Application
Using Catalog Views and System Stored Procedures
Controlling Access Permissions
Summary
49 SQL Server Service Broker
What’s New in Service Broker
Understanding Distributed Messaging
Designing a Sample System
Understanding Service Broker Constructs
Service Broker Routing and Security
Troubleshooting SSB Applications with ssbdiagnose.exe
Related System Catalogs
Summary
50 SQL Server Full-Text Search
What’s New in SQL Server 2008 Full-Text Search
Upgrade Options in SQL Server 2008
How SQL Server FTS Works
Implementing SQL Server 2008 Full-Text Catalogs
Setting Up a Full-Text Index
Full-Text Searches
Full-Text Search Maintenance
Full-Text Search Performance
Full-Text Search Troubleshooting
Summary
Part VII: SQL Server Business Intelligence Features
51 SQL Server 2008 Analysis Services
What’s New in SSAS
Understanding SSAS and OLAP
Understanding the SSAS Environment Wizards
An Analytics Design Methodology
An OLAP Requirements Example: CompSales International
Summary
52 SQL Server Integration Services
What’s New with SSIS
SSIS Basics
SSIS Architecture and Concepts
SSIS Tools and Utilities
A Data Transformation Requirement
Running the SSIS Wizard
The SSIS Designer
The Package Execution Utility
Connection Projects in Visual Studio
Change Data Capture Addition with R2
Using bcp
Logged and Nonlogged Operations
Summary
53 SQL Server 2008 Reporting Services
What’s New in SSRS 2008
Reporting Services Architecture
Installing and Configuring SSRS
Developing Reports
Management and Security
Performance and Monitoring
Summary
Part VIII: Bonus Chapters
54 Managing Linked and Remote Servers
What’s New in Managing Linked and Remote Servers
Managing Remote Servers
Linked Servers
Adding, Dropping, and Configuring Linked Servers
Mapping Local Logins to Logins on Linked Servers
Obtaining General Information About Linked Servers
Executing a Stored Procedure via a Linked Server
Setting Up Linked Servers Using SQL Server Management Studio
Summary
55 Configuring, Tuning, and Optimizing SQL Server Options
What’s New in Configuring, Tuning, and Optimizing SQL Server Options
SQL Server Instance Architecture
Configuration Options
Fixing an Incorrect Option Setting
Setting Configuration Options with SSMS
Obsolete Configuration Options
Configuration Options and Performance
Database Engine Tuning Advisor
Data Collection Sets
Summary
56 SQL Server Disaster Recovery Planning
What’s New in SQL Server Disaster Recovery Planning
How to Approach Disaster Recovery
Microsoft SQL Server Options for Disaster Recovery
The Overall Disaster Recovery Process
Have You Detached a Database Recently?
Third-Party Disaster Recovery Alternatives
Summary
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y-Z
Nội dung
ptg 214 CHAPTER 8 Installing SQL Server 2008 ; Specify if errors can be reported to Microsoft to improve future SQL Server releases. Specify 1 or True to enable and 0 or False to disable this feature. ERRORREPORTING=”True” ; Specify the root installation directory for native shared components. INSTALLSHAREDDIR=”C:\Program Files\Microsoft SQL Server” ; Specify the installation directory. INSTANCEDIR=”C:\SQL2008R2” ; Specify that SQL Server feature usage data can be collected and sent to Microsoft. Specify 1 or True to enable and 0 or False to disable this feature. SQMREPORTING=”True” ; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), Analysis Services (AS), or Reporting Services (RS). INSTANCENAME=”MSSQLSERVER” ; Agent account name AGTSVCACCOUNT=”SQLADMIN” ; Auto-start service after installation. AGTSVCSTARTUPTYPE=”Automatic” ; Startup type for Integration Services. ISSVCSTARTUPTYPE=”Automatic” ; Account for Integration Services: Domain\User or system account. ISSVCACCOUNT=”SQLADMIN” ; Startup type for the SQL Server service. SQLSVCSTARTUPTYPE=”Automatic” ; Level to enable FILESTREAM feature at (0, 1, 2 or 3). FILESTREAMLEVEL=”1” ; Specifies a Windows collation or an SQL collation to use for the Database Engine. SQLCOLLATION=”SQL_Latin1_General_CP1_CI_AS” ; Account for SQL Server service: Domain\User or system account. SQLSVCACCOUNT=”SQLADMIN” Download from www.wowebook.com ptg 215 Installing SQL Server Using a Configuration File 8 ; Windows account(s) to provision as SQL Server system administrators. SQLSYSADMINACCOUNTS=”SQLADMIN” ; The default is Windows Authentication. Use “SQL” for Mixed Mode Authentication. SECURITYMODE=”SQL” ; The Database Engine root data directory. INSTALLSQLDATADIR=”C:\SQL2008R2” ; Default directory for the Database Engine backup files. SQLBACKUPDIR=”C:\SQL2008R2\MSSQL10_50.MSSQLSERVER\MSSQL\Backup” ; Default directory for the Database Engine user databases. SQLUSERDBDIR=”C:\SQL2008R2\MSSQL10_50.MSSQLSERVER\MSSQL\Data” ; Default directory for the Database Engine user database logs. SQLUSERDBLOGDIR=”C:\SQL2008R2\MSSQL10_50.MSSQLSERVER\MSSQL\Data” ; Directory for Database Engine TempDB files. SQLTEMPDBDIR=”C:\SQL2008R2\MSSQL10_50.MSSQLSERVER\MSSQL\Data” ; Provision current user as a Database Engine system administrator for SQL Server 2008 R2 Express. ADDCURRENTUSERASSQLADMIN=”False” ; Specify 0 to disable or 1 to enable the TCP/IP protocol. TCPENABLED=”0” ; Specify 0 to disable or 1 to enable the Named Pipes protocol. NPENABLED=”0” ; Startup type for Browser Service. BROWSERSVCSTARTUPTYPE=”Disabled” ; Add description of input argument FTSVCACCOUNT FTSVCACCOUNT=”NT AUTHORITY\LOCAL SERVICE” Depending on which options you chose during an install, other options may be listed in the Configuration.ini file, some of which are designed solely for clustered installs, Analysis Services, Reporting Services, Integration Services, or Tools. To create a configuration file (sorry, no configuration file template is available on the installation media), run the installation program and follow the wizard all the way through to the Ready to Install page where the location of the Configuration.ini file generated is specified (see Figure 8.21). If you do not want to continue with an actual Download from www.wowebook.com ptg 216 CHAPTER 8 Installing SQL Server 2008 installation at this point, simply click the Cancel button to cancel the setup. At this point, you can copy the Configuration.ini file to another location so you can make edits to it. NOTE The Installer writes out all the appropriate parameters for the options and values speci- fied, with the exception of sensitive information such as passwords. For an unattended install, these values can be provided at the command prompt when you run setup.exe. In addition, the new SQL Server 2008 R2 /IAcceptSQLServerLicenseTerms parameter is also not written out to the configura- tion file and requires either you modify the configuration file or supply a value at the command prompt. The setup.exe command-line program can be found at the root level of the installation media. To use a configuration file to install a standalone SQL Server instance, run the installation through the command-line setup.exe program and supply the ConfigurationFile.ini using the ConfigurationFile parameter, as in the following example: Setup.exe /ConfigurationFile=CustomConfigurationFile.INI If you want to override any of the values in the configuration file or provide values not specified in the configuration file, you can provide additional command-line parameters to setup.exe. For example, to avoid having to enter the service account passwords during the installation, you can enter them on the command line using the password parameters to config.exe: Setup.exe /SQLSVCPASSWORD=”mypassword” /AGTSVCPASSWORD=”mypassword” /ASSVCPASSWORD=”mypassword” /ISSVCPASSWORD=”mypassword” /RSSVCPASSWORD=”mypassword” /ConfigurationFile=CustomConfigurationFile.INI NOTE The password parameters are required to run a fully unattended installation. Also, if the SECURITYMODE setting is set to SQL in the configuration file or via the command- line parameter, you need to provide the /SAPWD parameter to provide a password for the sa account. Most of the other available setup.exe command-line parameters are the same as the para- meter names used in the configuration file as listed previously. For full details of the avail- able setup.exe parameters, refer to SQL Server Books Online. Download from www.wowebook.com ptg 217 Installing SQL Server Using a Configuration File 8 Running an Automated or Manual Install When installing SQL Server from the command prompt, you can also specify what level of the installer interface you want to run, either silent, basic, or full interaction. SQL Server supports full quiet mode by using the /Q parameter or Quiet Simple mode by using the /QS parameter. The /Q switch is intended for running unattended installations. With this switch provided, Setup runs in quiet mode without any user interface. The /QS switch only shows progress via the GUI; it does not accept any input and displays no error messages if encountered. Regardless of the installation method chosen, you are required to confirm acceptance of the software license terms as an individual or on behalf of an entity, unless your use of the software is governed by a separate agreement such as a Microsoft volume licensing agree- ment or a third-party agreement with an ISV or OEM. For full unattended installations (using the /Q or /QS parameters) with SQL Server 2008 R2, you must include the /IACCEPTSQLSERVERLICENSETERMS parameter to avoid the display of the License Terms page. Following is a sample command line for running an unattended installation of SQL Server 2008: C:\Documents and Settings\rrankins\My Documents\Downloads\SQL2008\R2 Nov CTP>setup.exe /configurationfile=customconfigurationfile.ini /Q /IACCEPTSQLSERVERLICENSETERMS /SQLSVCPASSWORD=”riddler” /AGTSVCPASSWORD=”riddler” /SAPWD=”riddler” SQL Server 2008 R2 introduces a new option to the setup.exe that allows you to run a somewhat more attended mode of the installation that gives you a bit more control over the install than the /Q and /QS parameters, while streamlining the install somewhat. You can now specify the /UIMODE parameter instead of the /Q or /QS switches. The /UIMODE parameter specifies whether to present the full set of Installer Wizard pages for review and confirmation while running the setup or to present a minimum number of pages during setup. /UIMODE=Normal, the default option, presents all setup dialog boxes for the selected features, allowing you to review the values or manually enter values not provided in the configuration file (such as service account passwords). You can specify the /UIMODE=AutoAdvance option to skip nonessential dialogs and auto advances through a number of pages, including the Ready to Install page. NOTE Although SQL Server 2008 Configuration.ini files are compatible with the SQL Server 2008 R2 setup.exe program, some of the options generated in a SQL Server 2008 R2 Configuration.ini file are not compatible with the pre-R2 installer, such as the ENU, UIMODE, FARMADMINPORT, and IACCEPTSQLSERVERLICENSETERMS parameters. Download from www.wowebook.com ptg 218 CHAPTER 8 Installing SQL Server 2008 Installing Service Packs and Cumulative Updates If you are installing SQL Server 2008 instead of SQL Server 2008 R2, it is recommended that you install SQL Server 2008 Service Pack 1. SQL Server 2008 SP1 doesn’t provide any signif- icant new features for SQL Server 2008 but does provide a number of fixes to the GA release version of SQL Server 2008 (Microsoft Knowledge Base article 968369 lists all the fixes). Service Pack 1 does provide a few new features primarily to ease the deployment of service packs and cumulative updates. The first of these is Slipstream installations. Slipstreaming is an installation method that integrates the base installation files for SQL Server with its service packs and cumulative updates and enables you to install them in a single step. You can slipstream SQL Server 2008 SP1 and subsequent cumulative updates with the original installation media so that original media and the updates are installed at the same time. The next section in this chapter describes how to set up a Slipstream installation. SQL Server 2008 SP1 also provides the capability to uninstall SQL Server 2008 cumulative updates or service packs via the Programs and Features Control Panel (or the Add/Remove Programs Control Panel in Windows XP or Windows Server 2003). Before installing SP1, you should make sure to back up all user-created databases, as well as the system databases master, model, msdb, and any replicated databases. If you have installed Analysis Services, back up the entire OLAP directory (as discussed earlier in this chapter, in the “Installation Paths” section) and all its subdirectories. You also should make sure to close all open connections to the instance to which you are applying SP1 (including any connections via the management tools; setup should prompt you to close them) and make sure the various SQL Server services are started in the Services Control Panel. Also, be sure master and msdb each have 500KB free (or that they are autogrow enabled). When you’re ready, log on to the machine as an admin and start the downloaded SP1 executable. After extracting the contents to a temporary folder on the C: drive, the SP1 setup launches, displaying the Welcome screen shown in Figure 8.23. As you can see from this window, the SP1 Welcome screen runs the SP1 setup support rules to verify that the SP1 install can be run. Click Next to display the License Agreement screen. Click the check box to select the license agreement and then click Next again to advance to the Select Features screen to display and select the installed features to be updated (see Figure 8.24). The ensuing Feature Selection window lists (again) the features to be updated, organized in tree fashion, by SQL Server instance name. You can uncheck the features or instances you do not want to upgrade to SP1, except for shared features, which are required to be updated. Click Next to move onto the Check Files in Use screen (see Figure 8.25). This screen iden- tifies any open or running files that the SP1 setup program needs access to during the install. If any files are listed, you have the option to shut down the services or applica- tions associated with the files and run the check again to see whether the all items are cleared from the list. Note that it is not critical for the Files in Use list to be empty, but if Download from www.wowebook.com ptg 219 Installing Service Packs and Cumulative Updates 8 FIGURE 8.23 SQL Server 2008 SP1 Welcome screen. FIGURE 8.24 SQL Server 2008 SP1 Feature Selection screen. Download from www.wowebook.com ptg 220 CHAPTER 8 Installing SQL Server 2008 any files are listed, you need to reboot the system after running the SP1 setup to complete the installation. Click Next again to proceed to the Ready to Update screen (see Figure 8.26), which displays a summary of the instances and features that will be updated to SP1. Click Update to start the installation and display the Update Progress screen. When the SP1 installation is complete, click Next to proceed to the Complete screen. The Complete screen displays the location of the SP1 summary log file (see Figure 8.27). The default location of the SP1 summary log file is C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\LOG. Installing SP1 from the Command Line Like the SQL Server 2008 main install, SP1 can also be installed from the command line with no user interaction. This capability is useful if you need to install SP1 to a number of servers and want to avoid having to go through all the SP1 Install Wizard screens each time. To run SP1 from the command line, you must first extract the setup files from the SP1 download file, which is an executable archive file. You can do this by running the SQLServer2008SP1-KB968369-x64-ENU.exe file with the /x option from the command line. This launches the extractor, which prompts you for a location to extract the files to. Alternatively, you can specify a directory on a local drive to have it extract the setup files to automatically: SQLServer2008SP1-KB968369-x64-ENU.exe /x:C:\SP1 FIGURE 8.25 SQL Server 2008 SP1 Check Files in Use screen. Download from www.wowebook.com ptg 221 Installing Service Packs and Cumulative Updates 8 FIGURE 8.26 SQL Server 2008 SP1 Ready to Update screen. FIGURE 8.27 SQL Server 2008 SP1 Installation Complete screen. Download from www.wowebook.com ptg 222 CHAPTER 8 Installing SQL Server 2008 After extracting the SP1 setup files to a folder, you can run the setup.exe program from the command line. The SP1 setup program supports options similar to the SQL Server 2008 installer command-line options (although significantly fewer options are available): . /HELP—Displays these command-line parameters. . /ALLINSTANCES—Specifies that all instances are to be included in the setup operation. . /CLUSTERPASSIVE—Specifies that the setup utility should not automatically start and stop the SQL Server services if running in a non-Microsoft cluster environment. . /INDICATEPROGRESS—Specifies that the detailed Setup log messages should be displayed to the console. . /INSTANCENAME—Specifies the default or named instance to be updated . /QUIET—Runs the install in full unattended mode. Setup does not display any user interface. . /QUIETSIMPLE—Runs the install in Quiet Simple mode. Setup displays the wizard screens but without any user interaction. . /X86—Specifies that Setup should install a 32-bit edition into WOW64 on an x64- based system. For example, to install SP1 with no user interaction for all instances on a server, you would run the following command: setup.exe /quiet /allinstances Slipstream Installations With the release of SQL Server 2008 SP1, Microsoft provides the capability to create Slipstream installations of SQL Server 2008. Slipstreaming is a method of integrating a SQL Server 2008 update with the original installation media so that the original media and update are installed at the same time. This capability can be a huge timesaver over having to manually run a service pack and possible cumulative update installations after running a full SQL Server install, especially if you have to repeat the installation in multi- ple environments. Slipstreaming is supported in the following scenarios: . Installing the original media and a service pack . Installing the original media, a service pack, and a cumulative update to the service pack Download from www.wowebook.com ptg 223 Slipstream Installations 8 NOTE Slipstreaming a cumulative update for SQL Server 2008 with the original media but without a service pack is not supported because slipstreaming wasn’t supported until SQL Server 2008 SP1 was released. Also, a Slipstream installation cannot be per- formed to update a SQL Server 2008 instance to SQL Server 2008 R2. If you are doing a single install of SQL Server 2008 and at the same time want to apply SP1 and possibly a cumulative update as well, you can run the Slipstream installation by performing the following steps: 1. If they are not installed already on the target machine, install the required prerequi- sites for the SQL Server 2008 Installer (.NET Framework 3.5 SP1 and Windows Installer 4.5). You can install them manually from the SQL Server install disk (the installers are located in the Drive_Letter:\platform\redist\Windows Installer folder). Alternatively, after you extract the service pack files, run the sqlsupport.msi file from within the folder where the service pack files have been extracted. For example, if you extracted the Service pack to the C:\sql2k8xp1 folder on an X86 platform, this file would be found in the C:\SQL2K8SP1\x86\setup\1033 folder. NOTE To co n f i r m whether the setup suppor t files are installed, search for the Microsoft SQL Server 2008 Setup Support Files entry in the Programs and Features Control Panel (or the Add or Remove Programs Control Panel in operating systems prior to Windows Vista or Windows Server 2008). NOTE On the IA-64 platform, the .NET Framework 3.5 is not supported. The .NET Framework 2.0 SP2 is required instead. The .NET Framework 2.0 SP2 is located in the Drive_Letter:\ia64\redist\2.0\NetFx20SP2_ia64.exe folder on the source media. 2. If not done already, download the Service Pack (PCU) package that matches your system architecture and, if desired, the cumulative update (CU) package you want to install. 3. For each package you want to include in the Slipstream installation, extract the contents to a folder on the local drive by running a command similar to the follow- ing at the command prompt from within the folder where you downloaded the package(s): Name_of_the_PCU_or_CU_package.exe /x:Root_of_path_to_extract_to\<PCU | CU> Download from www.wowebook.com . database logs. SQLUSERDBLOGDIR=”C: SQL2 00 8R2 MSSQL10_50.MSSQLSERVERMSSQLData” ; Directory for Database Engine TempDB files. SQLTEMPDBDIR=”C: SQL2 00 8R2 MSSQL10_50.MSSQLSERVERMSSQLData” ; Provision. SQL Server 2008 instead of SQL Server 2008 R2, it is recommended that you install SQL Server 2008 Service Pack 1. SQL Server 2008 SP1 doesn’t provide any signif- icant new features for SQL Server. SECURITYMODE= SQL ; The Database Engine root data directory. INSTALLSQLDATADIR=”C: SQL2 00 8R2 ; Default directory for the Database Engine backup files. SQLBACKUPDIR=”C: SQL2 00 8R2 MSSQL10_50.MSSQLSERVERMSSQLBackup” ;