The Real MCTS SQL Server 2008 Exam 70-432 Prep Kit: Database Implementation and Maintenance
Copyright Page
Technical Editor
Lead Authors
Contributing Authors
Contents
Chapter 1: MCTS SQL Server 2008 Exam 432 New Features in SQL Server 2008
Introduction
A Word About the Test
New Feature Overview
Installation
Compressed Backups
Enhanced Configuration and Management of Audits
New Table Value Parameter
FileStream Data Types
Sparse Column Support
Encryption Enhancements
Key Management and Encryption
High Availability
Performance
Performance Data Management
Resource Governor (similar to Query Governor)
Freeze Plan
SQL Server 2008 Declarative Management Framework
Development Improvements
LINQ Support
MERGE Statement
Spatial Data Type
Analysis Services Improvements
ETL/SSIS Enhancements
Reporting Services
No Longer Requires IIS
Better Graphing
Export to Word Support
Deprecated Features
Discontinued Features
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 2: MCTS SQL Server 2008 Exam 432 Installing SQL Server 2008
Introduction
SQL Versions, Requirements, Features, and Differences
Planning Your Installation
Upgrade Tools
Hardware Requirements: CPU, Memory, and Disk
Operating System Requirements
Software Requirements
Establishing Service Accounts
Upgrading vs. Side-by-Side Installation
Clustered Installation Considerations
Unattended Installations
Post-Upgrade Activity
Database Instances, Files, Locations, Filegroups, and Performance
Binary File Locations
Filegroups
Disk Planning Best Practices
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 3: MCTS SQL Server 2008 Exam 432 Configuring SQL Server 2008
Introduction
Instances vs. Default Instance
Instance Limitations
Performance Considerations
SQL Server Configuration Manager
Managing Services
Enabling FileStream
Managing Connections and Protocols
Shared Memory
Named Pipes
VIA
TCP/IP
Changing the TCP Port
Aliases
sp_configure and SQL Server Management Studio
Advanced Options
AWE
Setting the Maximum and Minimum Memory for SQL Server
Max Server Memory (MB)
Min Server Memory (MB)
Maximum Degree of Parallelism
Security Certifications
C2 Auditing
Common Criteria Compliance
New Features
Backup Compression Default
FileStream Access Level
Database Mail
Configuring Database Mail
Full-Text Indexing
Configuring Full-Text Indexing
Managing Full-Text Indexes
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 4: MCTS SQL Server 2008 Exam 432 Managing Security
Introduction
Principals
Roles
The “Principle of Least Privilege”
Users
Schemas
Users versus Logins
Authentication Mode
Permissions
Cross-Database Ownership Chaining
Object Permissions
Log-in Permissions (As Related to Roles)
Auditing
Change Data Capture (CDC)
Using DDL Triggers
The SQL Server Configuration Manager
Security and SQL Agent
Service Accounts and Permissions
Domain Service Accounts versus Local Service Accounts
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 5: MCTS SQL Server 2008 Exam 432 Managing Data Encryption
Introduction
Understanding Transparent Data Encryption
Requirements
Enabling TDE
How Data Is Encrypted
Encryption Keys
Key Management
Database Encryption Keys
Best Practices for Managing Database Keys
Cell- and Column-Level Encryption
EFS Encryption (Through the Operating System)
EFS in a Clustered Environment
Restoring Encrypted Backups to Another Server or Instance
Third-Party Encryption Tools
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 6: MCTS SQL Server 2008 Exam 432 Managing High Availability
Introduction
Defining High Availability
SQL High-Availability Options
Log Shipping
Mirroring
Clustering
Special Hardware Requirements
Special Software Requirements
Geo-Clustering
Replication
Recovery Model
Expandability
Hot Add CPU
Hot Add Memory
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 7: MCTS SQL Server 2008 Exam 432 Maintaining Your Database
Introduction
Understanding Data Collation
SQL Server Collations
Binary Collations
Using Collations
Collation Considerations for Backup and Restore
Maintaining Data Files
Implementing Data Compression
Row versus Page Compression
Estimating Space Savings Using sp_estimate_data_compression_savings
Using Sparse Columns
Maintaining Indexes
DBCC Explained
Using DBCC CHECKTABLE to Verify Table Integrity
Using the DBCC CHECKDB to Verify Database Integrity
Using the DBCC SHRINKFILE Option to Reclaim Database Space
Backing Up and Restoring Data
Understanding Database Recovery Models
Backup Types
Choosing a Database Backup Strategy
Restoring Databases
Performing Online Restore
Restoring Individual Pages
Performing Ongoing Maintenance
Using SQL Server Agent
Using Database Maintenance Plans
Policy-Based Management
Examples of Using Policy-Based Management
Using the Data Collector to Collect Performance Data
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 8: MCTS SQL Server 2008 Exam 432 ETL Techniques
Introduction
Understanding ETL
Bulk Copying Data
Using BCP
Using BCP Data File Types
Using Format Files
Using the BULK INSERT Statement
Recovery Model and Bulk Operations
Optimizing Bulk Load Performance
Distributed Queries
Understanding Fully Qualified Object Names
Enabling Ad Hoc Distributed Queries
Using the OPENROWSET Function
Querying Data with OPENROWSET
Modifying Data with OPENROWSET
Copying Data with OPENROWSET
Using OPENROWSET (BULK,…)
Using the OPENDATASOURCE Function
Using Linked Servers
Using the OPENQUERY Function
Using Distributed Transactions
SQL Server Integration Services
Creating SSIS Packages
Using the Copy Database Wizard
Using the Import and Export Wizard
Using Business Intelligence Development Studio
Using Package Configurations
Managing SSIS
Understanding SSIS Package Storage
Deploying SSIS Packages
Securing SSIS Packages
Using Package Protection Levels
MSDB Database Roles and SSIS Package Roles
Executing SSIS Packages
Logging Package Execution
Alternative ETL Solutions
Coding Solutions
Third-Party Solutions
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 9: MCTS SQL Server 2008 Exam 432 Managing Replication
Introduction
Replication Scenarios
Article
Publication
Subscription
Publisher
Distributor
Subscriber
Replication Types
Snapshot
Components
Transactional
Components
Updatable Subscription
Peer-to-Peer Replication
Merge
Components
Replication Configuration
Configuration of Distributor
Configuration of Publisher
Configuration of Subscriber(s)
Configuration of Peer-to-Peer Replication
Conflict Resolution
Conflict Resolution Mechanism in Peer-to-Peer Replication
DDL Replication
Security Considerations
Snapshot Agent
Connect to Publisher
Replication Performance
Monitoring
Replication Monitor
Tracer Tokens
Alerts
Performance Monitor
Replication Agents
Replication Distribution
Replication Logread
Replication Merge
Replication Snapshot
DMVs
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 10: MCTS SQL Server 2008 Exam 432 Monitoring and Troubleshooting
Introduction
Service Troubleshooting
Concurrency Issues
Agent Issues
Error Logs
Windows Event Log
SQL Server Log
SQL Server Profiler
Performance Monitor
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 11: MCTS SQL Server 2008 Exam 432 SQL Server XML Support
Introduction
Working with XML Data
Understanding XML Indexing
HTTP Endpoints
Http Endpoints Defined
Endpoint Can Interface to a Stored Procedure
How to Create the Endpoint
Web Services
XQuery Explained
XPath
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 12: MCTS SQL Server 2008 Exam 432 Service Broker
Introduction
The Queuing Concept Explained
Service Broker Defined
Message Types
Contracts
Queues
Services
Endpoints
Routes
Sending a Message
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 13: MCTS SQL Server 2008 Exam 432 Performance Tuning
Introduction
Tracing
Trace Templates
Trace Events
Trace Filters
Server-Side Tracing
Combining System Monitor and Profiler Traces
Replaying Traces
Using SQLDiag to Collect Performance Data
Locks, Blocking, and Deadlocks
Locking
Blocking
Deadlocks
Transaction Isolation Levels
Lock Escalation
Lock Compatibility
Detecting and Resolving Locking Problems
Guide to the DYNAMIC Management Views (DMVs)
Partitioning
Horizontal Partitioning
Vertical Partitioning
Filegroups
Selecting a Partition Key and Number of Partitions
Partition Function
Partition Scheme
Moving Data between Partitions
Performance Data Collection
Performance Data Collection Explained
Management Data Warehouse
Configuring MDW
Configuring Data Collection
Data Collection Caching
Management Data Warehouse Reports
Resource Governor
Resource Governor Concepts
Resource Pools
Workload Groups
Classification Function
Validate Configuration
Resource Governor Summary
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Chapter 14: MCTS SQL Server 2008 Exam 432 Implementing Objects
Introduction
Understanding DDL and DML Language Elements
Working with Tables and Views
Creating Tables
Creating User-Defined Data Types
Working with Constraints
Creating Indexes
Working with Full-Text Indexes
Viewing and Modifying Data
Creating Views
Creating Stored Procedures
Creating Functions
Creating Triggers
Summary of Exam Objectives
Exam Objectives Fast Track
Exam Objectives Frequently Asked Questions
Self Test
Self Test Quick Answer Key
Index
Appendix: The Real MCTS SQL Server 2008 Exam 432 Self Test
Appendix
Chapter 1: New Features in SQL Server 2008
Chapter 2: Installing SQL Server 2008
Chapter 3: Configuring SQL Server 2008
Chapter 4: Managing Security
Chapter 5: Managing Data Encryption
Chapter 6: Managing High Availability
Chapter 7: Maintaining Your Database
Chapter 8: ETL Techniques
Chapter 9: Managing Replication
Chapter 10: Monitoring and Troubleshooting
Chapter 11: SQL Server XML Support
Chapter 12: Service Broker
Chapter 13: Performance Tuning
Chapter 14: Implementing Objects
Nội dung
112 Chapter3•ConfiguringSQLServer2008 Summary of Exam Objectives In this chapter you’ve looked in-depth at the difference between default and named instances, seen how to change the default TCP port and the SQL Server service accounts, learned how to add startup parameters to SQL Server, and learned when to use Server Aliases—all with SQL Server Configuration Manager. You’ve also seen how to view and change serverwide options with sp_configure and SQL Server Management Studio, looked at the benefits of Database Mail over SQLMail and how to configure it, and learned how to create and manage full-text indexes in SQL Server. Exam Objectives Fast Track Instances vs. Default Instance A default instance is accessed by using the servername, and a named ˛˛ instance is accessed using servername\instancename. You can have only one default instance per server, and by default it will ˛˛ use TCP port 1433. Each instance is completely independent of any other instance and has its ˛˛ own set of services, databases, and configuration settings. SQL Server Configuration Manager You need to use Configuration Manager to change the SQL Server ˛˛ Service account to ensure that the correct permissions are assigned. To configure FILESTREAM after installation, you need to enable it in ˛˛ Configuration Manager and by using sp_configure filestream_access_level. You can change the TCP port an instance listens on by using ˛˛ Configuration Manager. sp_configure and SQL Server Management Studio You need to enable ˛˛ show advanced options using sp_configure to view all of the sp_configure options. ConfiguringSQLServer2008•Chapter3 113 Only a subset of configuration options can be changed using Management ˛˛ Studio; most can only be changed with sp_configure. AWE is used to enable SQL Server to access more than 2GB of RAM on ˛˛ 32-bit systems. Database Mail Database Mail replaces SQLMail found in versions prior to SQL Server ˛˛ 2005. It uses SMTP rather than MAPI, so you don’t need to install a mail client.˛˛ You can specify multiple SMTP accounts on different servers for ˛˛ redundancy. Full-Text Indexing All new databases are enabled for full-text indexing by default.˛˛ Once you’ve defined an index, filling it is referred to as ˛˛ populating the index. A full-text catalog is a logical grouping of full-text indexes.˛˛ 114 Chapter3•ConfiguringSQLServer2008 Exam Objectives Frequently Asked Questions Q: Do I have to install a default instance? A: No. You can install named instances on a server without having a default instance. Q: If a named instance uses dynamic port allocation how will I know which port to connect to each time? A: The SQL Browser service needs to be running on the SQL Server. It will automatically return the correct port to your connection without you having to specify anything. Q: Why shouldn’t I change a SQL Server service account using the services applet? A: Changing the service account using SQL Server Configuration Manager will assign all the file system permissions and advanced user rights needed for SQL Server to work properly. Using the services applet won’t do this and could cause problems when the service is next started. Q: Should I change SQL Server configuration settings using the Management Studio interface or with sp_configure? A: The end result is the same so it doesn’t really matter. However, sp_confgure has many more options than the interface and is easy to script so it tends to be the popular choice with DBAs. Q: I’ve enabled AWE on my 32-bit SQL Server but still can’t see more than 2 GB of RAM. What should I do? A: First, check that you’re running the Enterprise or Datacenter version of Windows. Then check in c:\boot.ini for the /PAE switch which enables Windows to see the extra RAM. If that all looks fine then check that the service account has the ‘lock pages in memory’ user right. If it doesn’t there will be an error logged to the SQL Server errorlog on startup. ConfiguringSQLServer2008•Chapter3 115 Q: I’m upgrading from SQL Server 2000 where I have SQLMail configured and Microsoft Outlook installed on the server. Why don’t I need Outllook installed for Database Mail in SQL Server 2008? A: Database Mail uses Simple Mail Transport Protocol (SMTP) which doesn’t need a client install like the older SQLMail that uses the Mail API (MAPI) and requires a mail client like Outlook to be installed. 116 Chapter3•ConfiguringSQLServer2008 Self Test 1. You’ve just started as a DBA at a company that has recently installed a dedi- cated server running both a SQL Server 2008 default instance and the database for the company’s ERP system. You want to implement a process to test the database with new SQL Server patches and service packs before they are applied to the live database. There is no budget to buy any new servers, but the existing hardware is under-utilized and you’re confident it will suffice for your short-term needs. Which of these options would meet your needs? A. Restore a copy of the live database as test on to its own disk array. Apply patches and service packs to the new database and test them before applying them to the live database. B. Install a named instance for testing. Create a database snapshot on the named instance pointing to the live database on the default instance. Apply patches and service packs to the named instance and test before applying them to the default instance. C. Install another default instance for testing and restore a copy of the live database. Apply patches and service packs to the second instance and test before applying them to the live instance. D. Install a named instance for testing and restore a copy of the live database. Apply patches and service packs to the named instance and test before applying them to the default instance. 2. Last month your company went through an exercise to standardize service accounts while you were on holiday. You’ve just restarted SQL Server after applying a service pack, and now the instance won’t start. You check the Windows Event Log and see lots of errors about not being able to open the error log. What is the most likely cause? A. The SQL Server Service account was not changed using SQL Server Configuration Manager B. The service pack failed C. Data corruption D. You don’t have the right permissions to the error log 3. You have a default instance and a named instance installed on your server. The developers are complaining that they can’t connect to the named instance from . Chapter3•Configuring SQL Server 2008 Summary of Exam Objectives In this chapter you’ve looked in-depth at the difference between default and named instances, seen how to change the default TCP port and the SQL Server. Chapter3•Configuring SQL Server 2008 Self Test 1. You’ve just started as a DBA at a company that has recently installed a dedi- cated server running both a SQL Server 2008 default instance and the database for the. to see the extra RAM. If that all looks fine then check that the service account has the ‘lock pages in memory’ user right. If it doesn’t there will be an error logged to the SQL Server errorlog