| Acknowledgments
|
xix
|
| Introduction
|
xxi
|
| PART I MICROSOFT SQL SERVER 2000 ADMINISTRATION
FUNDAMENTALS
|
|
| 1 Microsoft SQL Server 2000 Administration
Overview
|
3
|
| SQL Server 2000 and Your
Hardware |
3 |
| SQL Server 2000 and SQL Server
Desktop |
5 |
| SQL Server and Windows 2000 |
7 |
| Services
for SQL Server |
7 |
| Taskbar
Extras for SQL Server |
8 |
| Authentication
Enhancements |
8 |
| Service
Accounts |
9 |
| SQL Server and Active Directory |
9 |
| SQL Server Administration Tools |
10 |
| Graphical
Administration Tools |
10 |
| Administration
Wizards and the Taskpad |
11 |
| Command-Line
Tools |
13 |
| 2 Configuring and Tuning Microsoft SQL Server
|
19
|
| Running and Modifying SQL Server
Setup |
20 |
| Creating
New Instances of SQL Server |
20 |
| Adding
Components |
23 |
| Restoring
the SQL Server Registry |
24 |
| Uninstalling
SQL Server |
25 |
| Configuring SQL Server with
Enterprise Manager |
26 |
| Determining
System and Server Information |
27 |
| Configuring
Startup |
28 |
| Setting
Startup Parameters |
28 |
| Setting the
Startup Service Account |
31 |
| Authentication
and Auditing |
32 |
| Tuning
Memory Usage |
33 |
| Configuring
Processors and Parallel Processing |
37 |
| Configuring
Threading, Priority, and Fibers |
39 |
| Configuring
User and Remote Connections |
41 |
| Server
Settings |
45 |
| Database
Settings |
49 |
| Replication |
52 |
| Adding and
Removing Active Directory Information |
53 |
| Configuring SQL Server with Stored
Procedures |
53 |
| Starting
Query Analyzer |
54 |
| Changing
Settings with sp_configure |
55 |
| Configuration
Parameters |
56 |
| Troubleshooting Configuration
Problems |
60 |
| Recovering
from a Bad Configuration |
60 |
| Changing
Collation and Rebuilding the Master Database |
61 |
| PART II MICROSOFT SQL SERVER 2000 ADMINISTRATION
|
|
| 3 Managing the Enterprise
|
65
|
| Starting, Stopping, and Pausing SQL
Server |
65 |
| Managing
SQL Server Service with Service Manager |
65 |
| Managing
SQL Server Service from the Command Line |
67 |
| Managing
the SQL Server Command-Line Executable |
67 |
| Using SQL Server Enterprise
Manager |
68 |
| Getting
Started with Enterprise Manager |
68 |
| Managing SQL Server Groups |
69 |
| Creating a
Server Group |
69 |
| Deleting a
Server Group |
70 |
| Adding SQL
Servers to a Group |
70 |
| Managing Servers |
70 |
| Registering
a Server with a Wizard |
71 |
| Registering
a Server Manually |
72 |
| Editing
Registration Properties |
74 |
| Moving a
Server to a New Group |
74 |
| Deleting a
Server Registration |
74 |
| Connecting
to a Server |
75 |
| Disconnecting
from a Server |
75 |
| Starting, Stopping, and Configuring
SQL Server Agent |
75 |
| Starting, Stopping, and Configuring
the Microsoft Distributed Transaction Coordinator |
76 |
| Installing and Configuring
Full-Text Search |
76 |
| Using
Full-Text Searches |
77 |
| Starting,
Stopping, and Configuring the Microsoft Search Service |
77 |
| Locating
Files Used for Full-Text Searches |
78 |
| Managing
Catalogs |
78 |
| Managing SQL Mail and SQL Server
Agent Mail |
85 |
| Setting Up
SQL Server as a Mail Client |
85 |
| Testing the
Mail Installation |
86 |
| Configuring
SQL Mail |
86 |
| Configuring
SQL Server Agent Mail |
87 |
| Managing Server Activity |
87 |
| Examining
Process Information |
87 |
| Tracking
Locks by Process ID and Object |
89 |
| Troubleshooting
Deadlocks and Blocking Connections |
91 |
| Tracking
Command Execution in SQL Server |
92 |
| Sending
Messages to Users Based on Connections |
93 |
| Killing
Server Processes |
94 |
| 4 Core Database Administration
|
95
|
| Database Files and Logs |
95 |
| Database Administration Basics |
96 |
| Viewing
Database Information in Enterprise Manager |
96 |
| Viewing
Database Information Using SQL |
98 |
| Checking
System and Sample Databases |
99 |
| Examining
Database Objects |
100 |
| Creating Databases |
101 |
| Creating
Databases in Enterprise Manager |
101 |
| Creating
Databases Using T-SQL |
105 |
| Setting Database Options |
107 |
| Setting
Database Options in Enterprise Manager |
107 |
| Database
Options for Enterprise Manager and Transact-SQL |
108 |
| Viewing,
Changing, and Overriding Database Options |
112 |
| Managing Database and Log Size |
113 |
| Configuring
SQL Server to Automatically Manage File Size |
113 |
| Expanding
Databases and Logs Manually |
113 |
| Compacting
and Shrinking a Database Manually |
114 |
| Manipulating Databases |
117 |
| Temporarily
Restricting Database Access |
117 |
| Renaming a
Database |
118 |
| Dropping
and Deleting a Database |
119 |
| Attaching
and Detaching Databases |
119 |
| Copying
Databases with Attach |
121 |
| Moving
Databases with Detach and Attach |
121 |
| Moving a
Database to Another Server |
122 |
| Altering a Database |
122 |
| Tips and Techniques |
126 |
| Moving and
Resizing tempdb |
126 |
| Creating
Secondary Data and Log Files |
127 |
| Preventing
Transaction Log Errors |
128 |
| Resolving a
Filegroup Is Full Error |
128 |
| Creating a
New Database Template |
128 |
| 5 Microsoft SQL Server 2000 Security
|
129
|
| SQL Server 2000 Security |
129 |
| SQL Server
2000 Authentication Modes |
130 |
| Server
Logins |
131 |
| Permissions |
133 |
| Roles |
135 |
| Managing Server Logins |
138 |
| Viewing and
Editing Existing Logins |
138 |
| Creating
Logins |
139 |
| Granting or
Denying Server Access |
141 |
| Removing
Logins |
142 |
| Changing
Passwords |
143 |
| Configuring Server Roles |
143 |
| Assigning
Roles by Login |
144 |
| Assigning
Roles to Multiple Logins |
145 |
| Controlling Database Access and
Administration |
146 |
| Assigning
Access and Roles by Login |
146 |
| Assigning
Roles for Multiple Logins |
147 |
| Creating
Standard Database Roles |
148 |
| Creating
Application Database Roles |
149 |
| Revoking
Access Rights and Roles by Login |
149 |
| Deleting
User-Defined Roles |
150 |
| Transact-SQL
Commands for Managing Access and Roles |
150 |
| Managing Database Permissions |
151 |
| Assigning
Database Permissions for Statements |
152 |
| Object
Permissions by Login |
155 |
| Object
Permissions for Multiple Logins |
156 |
| PART III MICROSOFT SQL SERVER 2000 DATA
ADMINISTRATION
|
|
| 6 Manipulating Tables, Indexes, and Views
|
161
|
| Table Essentials |
162 |
| Understanding
Data Pages |
162 |
| Understanding
Extents |
163 |
| Working with Tables |
163 |
| Creating
Tables |
163 |
| Modifying
Existing Tables |
168 |
| Viewing
Table Row and Size Information |
171 |
| Displaying
Table Properties and Permissions |
172 |
| Displaying
Current Values in Tables |
172 |
| Copying
Tables |
172 |
| Renaming
and Deleting Tables |
172 |
| Adding and
Removing Columns in a Table |
173 |
| Scripting
Tables |
174 |
| Managing Table Values |
175 |
| Using
Native Data Types |
175 |
| Using
Fixed-Length and Variable-Length Fields |
178 |
| Using
User-Defined Data Types |
178 |
| Allowing
and Disallowing Nulls |
181 |
| Default
Values |
181 |
| Using
Identities and Globally Unique Identifiers |
181 |
| Using Views |
184 |
| Creating
Views |
184 |
| Using
Updateable Views |
187 |
| Managing
Views |
187 |
| Creating and Managing Indexes |
187 |
| Understanding
Indexes |
187 |
| Clustered
and Nonclustered Indexes |
188 |
| Which
Columns Should Be Indexed? |
189 |
| Indexing
Computed Columns and Views |
190 |
| Viewing
Indexes |
191 |
| Creating
Indexes |
191 |
| Managing
Indexes |
194 |
| Using the
Index Tuning Wizard |
195 |
| Column Constraints and Rules |
198 |
| Using
Constraints |
198 |
| Using
Rules |
202 |
| 7 Importing and Exporting Data with DTS and BCP
|
205
|
| Understanding DTS |
205 |
| DTS and
Database Drivers |
206 |
| DTS
Packages |
206 |
| Other DTS
Tools |
208 |
| Creating Packages with the DTS
Import/Export Wizard |
208 |
| Stage 1:
Source and Destination Configuration |
209 |
| Stage 2:
Copy, Query, or Transfer |
217 |
| Stage 3:
Formatting and Transformation |
223 |
| Stage 4:
Save, Schedule, and Replicate |
226 |
| Working with DTS Packages |
229 |
| Examining,
Running, and Scheduling Packages |
229 |
| Managing
Packages Using the DTS Run Utility for Windows |
230 |
| Managing
Packages from the Command Line |
232 |
| Understanding BCP |
233 |
| BCP
Basics |
233 |
| BCP
Syntax |
234 |
| BCP
Permissions and Modes |
236 |
| Importing
Data with BCP |
237 |
| Exporting
Data with BCP |
239 |
| BCP Scripts |
239 |
| BULK INSERT |
240 |
| 8 Linked Servers and Distributed Transactions
|
243
|
| Working with Linked Servers and
Distributed Data |
243 |
| Using
Distributed Queries |
243 |
| Using
Distributed Transactions |
245 |
| Running the
Distributed Transaction Coordinator Service |
246 |
| Managing Linked Servers |
247 |
| Adding
Linked Servers |
247 |
| Configuring
Security for Linked Servers |
251 |
| Deleting
Linked Servers |
253 |
| Working with Remote Servers |
254 |
| Setting Up
Remote Servers in Enterprise Manager |
254 |
| Setting Up
Remote Servers Using Stored Procedures |
256 |
| Executing
Remote Stored Procedures |
259 |
| 9 Configuring Snapshot, Merge, and Transactional
Replication
|
261
|
| An Overview of Replication |
261 |
| Replication
Components |
262 |
|
Replication Agents |
263 |
| Replication
Variants |
264 |
| Planning for Replication |
266 |
| Replication
Models |
266 |
| Preliminary
Replication Tasks |
267 |
| Distributor Administration |
269 |
| Setting Up
a New Distributor |
270 |
| Updating
Distributors |
276 |
| Creating
Distribution Databases |
277 |
| Enabling
Publishers |
277 |
| Enabling
Publication Databases |
278 |
| Enabling
Subscribers |
278 |
| Deleting
Distribution Databases |
279 |
| Disabling
Publishing and Distribution |
279 |
| Creating and Managing
Publications |
280 |
| Creating
Publications |
280 |
| Updating a
Publication |
288 |
| Setting
Article Properties |
289 |
| Controlling
Subscription Access to a Publication |
290 |
| Creating a
Script for a Publication |
290 |
| Deleting a
Publication |
290 |
| Subscribing to a Publication |
291 |
| Subscription
Essentials |
291 |
| Creating
Pull Subscriptions |
292 |
| Updating,
Maintaining, and Deleting Pull Subscriptions |
297 |
| Creating
Push Subscriptions |
298 |
| Updating,
Maintaining, and Deleting Push Subscriptions |
301 |
| Transforming Published Data |
301 |
| Managing Replication Monitors |
303 |
| Configuring
Server-Level Monitoring |
303 |
| Configuring
Enterprise-Level Monitoring |
303 |
| Setting
Agent Profiles |
304 |
| Setting
Agent Properties |
304 |
| PART IV PERFORMANCE, OPTIMIZATION, AND
MAINTENANCE
|
|
| 10 Profiling and Monitoring Microsoft SQL Server
2000
|
307
|
| Monitoring Server Performance and
Activity |
307 |
| Why Monitor
SQL Server? |
307 |
| Getting
Ready to Monitor |
308 |
| Monitoring
Tools and Resources |
308 |
| Working with the Error Logs |
310 |
| Examining
the Application Log |
311 |
| Examining
the SQL Server Error Logs |
313 |
| Examining
the SQL Server Agent Error Logs |
314 |
| Monitoring SQL Server
Performance |
314 |
| Starting
Performance Monitor |
315 |
| Choosing
Counters to Monitor |
315 |
| Creating
and Managing Performance Monitor Logs |
317 |
| Replaying
Performance Logs |
323 |
| Configuring
Alerts for Performance Counters |
323 |
| Solving Performance Problems with
Profiler |
326 |
| Using
Profiler |
326 |
| Creating
New Traces |
327 |
| Working
with Traces |
331 |
| Saving a
Trace |
331 |
| Replaying
Traces |
332 |
| 11 Database Backup and Recovery
|
337
|
| Creating a Backup and Recovery
Plan |
337 |
| Initial
Backup and Recovery Planning |
337 |
| Planning
for Backups of Replicated Databases |
340 |
| Planning
for Backups of Very Large Databases |
341 |
| Selecting Backup Devices and
Media |
341 |
| Using Backup Strategies |
343 |
| Creating a Backup Device |
345 |
| Performing Backups |
347 |
| Creating
Backups in Enterprise Manager |
347 |
| Using
Striped Backups with Multiple Devices |
352 |
| Using
Transact-SQL Backup |
352 |
| Performing
Transaction Log Backups |
356 |
| Restoring a Database |
358 |
| Database
Corruption and Problem Resolution |
358 |
| Restoring a
Database from a Normal Backup |
360 |
| Restoring
Files and Filegroups |
364 |
| Restoring a
Database from a Device |
366 |
| Restoring a
Database to a Different Location |
368 |
| Recovering
Missing Data |
369 |
| Creating
Standby Servers |
369 |
| Using
Transact-SQL Restore |
371 |
| Restoring the Master Database |
376 |
| 12 Database Automation and Maintenance
|
379
|
| Using SQL Server Agent |
379 |
| Accessing
Alerts, Operators, and Jobs |
379 |
| Configuring
the SQL Server Agent Service |
380 |
| Configuring
SQL Server Agent |
381 |
| Viewing SQL
Server Agent Logs |
382 |
| Managing Alerts |
382 |
| Default
Alerts |
383 |
| Creating
Error Message Alerts |
383 |
| Handling
Alert Responses |
385 |
| Deleting,
Enabling, and Disabling Alerts |
386 |
| Managing Operators |
386 |
| Registering
Operators |
386 |
| Deleting
and Disabling Notification for Operators |
388 |
| Configuring
a Fail-Safe Operator |
388 |
| Scheduling Jobs |
389 |
| Creating
Jobs |
389 |
| Assigning
or Changing Job Definitions |
390 |
| Setting
Steps to Execute |
391 |
| Configuring
Job Schedules |
394 |
| Handling
Notification Messages |
397 |
| Managing
Existing Jobs |
398 |
| Managing
Job Categories |
398 |
| Automating Routine Server-to-Server
Administration Tasks |
399 |
| Copying
Logins to Another Server |
400 |
| Copying
Scheduled Jobs to Another Server |
403 |
| Copying
Shared Stored Procedures to Another Server |
405 |
| Copying
User-Defined Error Messages to Another Server |
407 |
| Copying or
Moving User-Defined Databases to Another Server |
409 |
| Multiserver Administration |
413 |
| Event
Forwarding |
414 |
| Multiserver
Job Scheduling |
415 |
| Database Maintenance |
416 |
| Database
Maintenance Checklist |
417 |
| Using
Maintenance Plans |
417 |
| Checking
and Maintaining Database Integrity |
428 |
| Index
|
433
|