American National Standards Institute (ANSI), 127
American Standard Code for Information Interchange (ASCII), 127
Attach database method, 215–216
Auditing
compliances, 283
database audit specification object, 280–282
hardware-based auditing devices, 273
objects
abstract object, 274
database audit specification, 273
scopes and server audit, 273
server audit specification, 273
server -instance-scoped audit specification, 274
server audit object
audit creation, 274
audit destination, 276
extended events, 275
repudiation attack, 276
system center operations manager, 276
windows audit collection services, 276
server audit specification object
third-party auditing solutions, 273
track events, 272
user-defined audit event, 283–284
Backups
automating process
general page window, 170
object explorer window, 178–179
steps page window, 171
visible, step page, 175
database properties window, 164–165
differential backups
files/device, 163
encrypting backup files, 179–180
file backups, restore strategies, 205–206
full backup
backup mirroring, 161
destination, 159
files window, 160
options page, 161
overview, 158
RESTORE command, 162
SQL Server management studio, 158–162
logs
checkpoint, 166
database, 169
database restore strategies, 201–205
fully recovery mode, 167
management studio, 168
transactions, 166
T-SQL, 169
physical backup device, 158
plan design
implementation, 182
OLTP system, 183
requirements, 182
SLA, 183
types, 183
server properties window, 181
TDE, 179
testing backups, 207
Bulk Copy Program (BCP), 227–229
Business Intelligence Development Studio (BIDS), 70, 96
Central management server (CMS)
multiple server, 53
New Query option, 296
production folder, 296
Cloud computing, DBA. See also SQL Azure
3M Visual Attention Service, 370–371
definition, 365
OCCMundial.com, 369
service models
infrastructure as a service (IaaS), 366
platform as a service (PaaS), 366–367
software as a service (SaaS), 366
Command-line tools
DTEXEC.exe, 70
GUI, 70
SQLCMD
overview, 71
Community Technology Preview 3 (CTP3), 96
Data collector
baseline, 307
data view
details report, Queries, 317–318
disk usage summary report, 314–316
Query statistics history report, 316–318
reports, 311
Server activity history, 311–314
system CPU, 312
setting up data
data warehouse, 309
management folder, 308
Data Control Language (DCL), 110
Data Definition Language (DDL), 109
Data Manipulation Language (DML)
DELETE statement, 135
INSERT
identity and sequences, 133–135
parameters, 133
queries, 133
SELECT statement
FULL OUTER JOIN, 131
INNER JOIN, 131
JOIN statement, 131
LEFT OUTER JOIN, 131
ORDER BY clause, 130
RIGHT OUTER JOIN, 131
syntax, 128
WHERE clause, 129
UPDATE statement, 135
Database administrator (DBA)
authorization, 250
disaster recovery, 3
documentation, 4
salary information, 4
schema design and performance improvement, 4
security and compliance, 3
Database backup. See Backups
Database Console Command (DBCC), 229–230
Database encryption key (DEK), 290
Database Engine Tuning Advisor (DTA), 299, 331–333
Database maintenace tasks
database backup and restore, 213
distribution statistics
sys.stats and sys.indexes, 234–235
updating statistics, 237
indexes
clustered index, 231
detecting fragmentation, 231–233
logical scan fragmentation, 233
nonclustered index, 231
page and extent, 232
scan density, 232
maintenance plan
context menu, 242
integrity task, 240
moving data
configure destination, 218–219
detach and attach method, 214–216
import and export wizard, 220–227
mapping data, 226
package configuration, 219–220
SMO method, 217
scheduling maintenance tasks, 244
Database restore strategies. See also Full disaster recovery plan
disaster recovery plan, 185
management studio GUI
device contents window, 190–191
error and explanation, 192
media selection, 191
object explorer window, 186
testing backups, 207
T-SQL
cleaning up, 200
database copy creation, 195–196
display general information, 197–199
FILELISTONLY command, 197
logical and physical file names, 196–197
RESTORE FILELISTONLY command, 199
RESTORE HEADERONLY command, 199
Database security
covering permissions, 264
database users, 259
flexible database roles, 265–266
GRANT statement, 265
RUNAS command, 268
schemas, 259
default schema, 261
four-part naming convention, 261
reassigning schema ownership, 262
right way, 260
security functions
fn_my_permissions() function, 266
HAS_PERMS_BY_NAME function, 267
SQLCMD, 268
user-defined database, 267
Detach database method, 214–215
Differential backups
files/device, 163
Dynamic management functions (DMFs), 306
Dynamic management objects (DMOs), 305–307
Dynamic management view (DMV), 305–307
Encrypting backup files, 179–180
Encryption
asymmetric key, 285
Caesar shift cipher, 284
certificate-based encryption
master key and private key, 288
REVERT statement, 288
ciphertext, 285
compliance requirements, 284
concepts, 285
cryptographic API, 285
password-based encryption
AUTHORIZATION parameter, 286
ContosoBank database, 285
DecryptByKey function, 288
EncryptByKey function, 286–287
SYMMETRIC KEY statement, 286
plain text, 285
primer, 285
private and public key, 285
symmetric keys, 285
transparent data encryption, 290
Evaluation edition
download, 20
Installation Center
Options tab, 28
Scripted install, 27
system configuration checker, 22
instance
Database Engine Configuration page, 33–35
Disk Space Requirements page, 31
error reporting page, 35
Features Selection page, 29–30
Installation Rules page, 35
Instance Configuration page, 30–31
Server Configuration page, 32–33
setup role page, 29
shared components, 30
SQL logins, 34
tempdb database, 35
Fault tolerance
AlwaysOn Availability Group
databases page, 359
listener, 361
replicas, 360
SQL-WEST instance, 359
synchronization, 362
Windows Server failover cluster, 356–357
database mirroring configuration
BACKUP DATABASE statement, 350–351
motivation and benefits, 350
operation modes, 350
features
AlwaysOn Availability Group, 355
AlwaysOn Failover Clustering, 354–355
backup and restore, 341
differential backup, 341
full database backup, 341
geoclusters, 339
log shipping configuration
copy files, 346
Pros and Cons, 348
restore transaction log, 346–347
status report, 347
transaction log shipping, 342–343
UsedCars database, 342
replication
distributor, 348
merge replication, 349
publications, 348
snapshot replication, 349
subscription, 348
transactional replication, 349
service level agreement
definition, 340
nines, 340
uptime, 339
File and filegroup backups, 164–166
fn_my_permissions function, 266
Full backup
backup mirroring, 161
files window, 160
options page, 161
RESTORE command, 162
SQL Server management studio
destination, 160
business information, 208F
downtime, 208
establishment
large commercial insurance company, 209
small online retail business, 209
testing, 210
Graphical user interface (GUI), 70
HAS_PERMS_BY_NAME function, 267
Health Insurance Portability and Accountability Act (HIPAA), 3
Hyper-V, 403
Infrastructure as a service (IaaS), 366
Itanium/(IA64), 14
3M Visual Attention Service (VAS)
architecture, 371
graphical design, 370
Microsoft Assessment and Planning (MAP) toolkit, 17, 389–395
Microsoft Desktop Engine (MSDE), 16
Microsoft management console (MMC), 66
Microsoft Online Services Customer Portal (MOSCP), 374
Microsoft SQL Server Upgrade Advisor (Advisor), 395–396
Microsoft System Center Operations Manager (SCOM), 55
Microsoft TechNet, 402
Microsoft Virtual PC 2007, 403–405
National Institute on Standards and Technology (NIST), 365
Network interface card (NIC), 300
Online transaction processing (OLTP) system, 183
Payment Card Industry Data Security Standards (PCI DSS), 3
Performance Data Collector (PDC)
data collection option, 57
management data warehouse, 57
query statistics report, 59–60
Performance measurment
counters
full scans, 301
instance and objects, 300
NIC, 300
data collector
baseline, 307
data warehouse storage page, 309
management folder, 308
dynamic management view (DMV), 305–307
Monitor tool
perfmon, 302
Platform as a service (PaaS), 366–367
Policy-based management (PBM)
central management server (CMS), 295–296
multiple server, 55
need for, 291
Server configuration, 291
Professional Association for SQL Server (PASS), 402
Service level agreement (SLA), 85, 182, 339
Single-user mode
database, 153
DBCC CHECKDB command, 152
ROLLBACK IMMEDIATE option, 153
SQL Server
command-line argument, 153
SQLCMD, 156
Software as a service (SaaS), 366
SQL Azure
administer databases, 372
backup and restore, 385
data hubs, 373
database management
SLA, 379
DBA, 372
departmental applications, 373
firewall rules, 376
migrating data
bulk copy utility, 380
CodePlex, 380
server connection, 383
SSSIS, 380
Target Server Connection, 383
MOSCP, 374
properties, 377
relational data, 385
relational database service, 372
service level agreement, 378
software vendors, 373
syntax, 372
Tabular Data Stream, 377
web applications, 372
SQL Management Object (SMO) method, 217
SQL Server
32-bit and 64-bit architectures, 14
ALTER TABLE, 114
Books Online, 401
certification, 405
clustered index, 120
conferences, 402
constraints
CHECK, 114
NULL, 114
primary key, 115
Referential integrity, 116
Deployment Wizard, 63
evaluation edition, 19
download, 19
fault tolerance
AlwaysOn Availability Groups, 355–362
AlwaysOn Failover Clustering, 354–355
backup and restore, 341
hands-on labs, 403
installation
editions, 18
environmental assessment, 17–18
hardware/software requirements, 19
installation and configuration, 13
internals (See also single-user mode)
agent service, 151
Analysis Services, 152
Browser service, 151
Client service, 152
corrupt system databases, 149
data warehouse, 152
Distributed Replay Controller service, 152
filegroup, 150
Full-Text Engine Filter Daemon Launcher service, 151
Integration Services, 151
master database, 147
model database, 147
MSDB database, 148
query optimization, 147
query tree, 147
Reporting Services, 152
resource database, 149
resources, 156
Secondary data files, 149
tempdb database, 147
Volume Shadow Copy Service (VSS), 152
lab system and practice, 403
local users groups, 402
nonclustered index, 120
performance measurment
DMOs, 299
dynamic management view (DMV), 305–307
execution plan, 299
resources, 40
resources management
index and data compression, 336
pools, 334
Resource Governor, 334
workload, 335
Server editions
Business Intelligence edition, 15
Enterprise edition, 15
Standard edition, 15
setting up, 13
specialized editions
Developer edition, 15
evaluation edition, 16
Express edition, 16
LocalDB, 16
table creation
Ad hoc scripting options, 112
ANSI_NULL statement, 113
CREATE TABLE statement, 112–113
QUOTED_IDENTIFER, 113
terminology, 16
tuning queries
Database Engine Tuning Advisor, 331–333
T-SQL query, 319
upgrading servers, 37
features, 38
hardware, 37
sp_renamedb stored procedure, 39
strategies, 38
Windows Performance Monitor tool, 39–40
virtual machine (VM)
hard disk location, 404
Hyper-V, 403
ISO image, 405
Microsoft Virtual PC 2007, 403–405
time-bombed environment, 403–405
websites
Microsoft TechNet, 402
SQL Server Central, 401
SQL Server Customer Advisory Team, 402
SQL Server World Wide Users Group, 401
SQL Skills site, 402
SQL Server development
data-tier applications
definition, 85
existing database, 90
LocalDB, 102
managed instances, 93
management data warehouse, 91
SLA, 85
SQL Server instance, 92
utility control point (UCP), 90–92
SQL Server Management Studio (SSMS)
need for, 77
T-SQL debugging, 84
SQL Server Development Tools (SSDT)
connected mode
offline mode
import database dialog, 99
version application, 102
SQL Server instance security
dedicated administrator connection, 257
network protocols, 258
principal, 252
Securables, 256
terminology
authentication, 249
authorization, 250
database roles, 250
database users, 250
Mixed mode, 250
representation, server login, 251
Server authentication, 250
server instance vs. database, 250–51
Windows authentication mode, 250
transport protocols, 257
user-defined server roles, 258
SQL Server Management Studio (SSMS). See also Transact-SQL (T-SQL)
Ad hoc scripting options, 112
droping table, 117
execution plan, 121
monitoring server activity
Activity Monitor (AM), 56
Performance Data Collector(PDC), 57–60
SCOM, 55
multiple servers, 53
policy-based management (PBM), 55
queries, 55
need for, 77
menu options, 50
products, 43
properties tab, 45
Queries
components, 46
document window, 52
results pane, 53
Query designer
Add Table dialog, 78
Query menu, 120
table designer, 111
templates
explorer, 81
T-SQL debugging, 84
SQL Server private cloud, 387
architecture, 387
control and customization, 399
Hyper-V Dynamic Memory, 399
implementation options, 399–400
MAP tool
discovery and readiness, 389–390
inventory and assessment wizard, 390–391
resource pooling, 389
self-service, 399
Sysprep, 398
virtual machines, 398
virtualization, 389
SQL Server Upgrade Assistant (Assistant), 396–397
SQLCMD
defined, 70
overview, 71
Sysprep, 398
Tabular Data Stream (TDS), 377
TechNet, 402
Toolbox. See also Command-line tools, SQL Server Management Studio (SSMS)
Analysis Services (SSAS), 63
CodePlex, 68
Configuration Tools folder
Reporting Services Configuration Manager, 64–65
SQL Server Configuration Manager, 66–68
SQL Server Error and Usage Report, 63–64
SQL Server Installation Center, 63
Documentation and Community folder
hyperlink, 68
Microsoft SQL samples overview, 68
SQL Server Books Online, 68
Import and Export Data Wizard, 70
Integration Services folder
Data Profiler Viewer, 69
ETL tool, 68
Execute Package utility, 69
Project Conversion wizard, 69
Performance Tools folder, 69
Database Engine Tuning Advisor, 69
SQL Trace, 70
services node, 66
SQL Server Data Tools (SSDT), 70
Transact-SQL (T-SQL). See also Data Manipulation Language (DML)
aggregate functions, 144
BEGIN TRANSACTION statement, 136
Built-in functions, 144
character set, 127
COMMIT TRANSACTION statement, 137
DCL, 110
DDL, 109
function invoking, 143
NULL, 128
primer, 109
ROLLBACK statement, 136
Scalar functions, 144
script, 175
security-related functions, 144
SQL Server Books Online Articles, 146
stored procedure
ALTER STORED PROCEDURE statement, 142
CREATE PROCEDURE statement, 139
modifying, 142
system folder, 142
transaction execution, 136
transaction isolation, 136–137
Unicode vs. ANSI, 127
user-defined function, 144
Transparent data encryption (TDE), 179
ContosoBank database, 290
database encryption key, 290
encrypting backup files, 179
Tripp, Kimberly, 402
Tuning queries
execution plans
actual execution plan, 321–322
data flow tooltip, 324
graphical format, 320
Hash Match operator, 322
Nested Loops tooltip, 323
query optimization, 319
SQL Editor toolbar, 320
text execution, 320
extended events
action and session, 326
data storage window, 330
graphical user interfaces, 327
selection, 328
session wizard, 327
T-SQL query, 319
Unicode vs. ANSI, 128
Utility control point (UCP), 90–92
Virtualization, 389
Volume Shadow Copy Service (VSS), 152
Windows Azure
AppFabric, 369
platform, 367
roles, 368
storage, 369
3.142.133.54