Professional Documents
Culture Documents
Overview
SQL Server Architecture SQL Server with SAP Performance Monitoring and Tuning Administration and Troubleshooting Database Backup and Restore
Database Server
Results
Transact-SQL
Application Client SQL Server Relational Database Management System
Client / Server
Client
Application Database Interface Network Library
Server
SQL Server Open Data Services Network Library
SQL Enterprise Manager SQL Query Analyzer Service Manager Server & Client Network Utility Performance Monitor SQL Profiler Index Tuning Wizard Data Transformation Services
8
SQL Server process maintains pool of threads to process client requests SQL Server can also be configured to use lightweight pooling(fibers) max worker threads
10
Databases
System Databases
master
model
tempdb
msdb
distribution
pubs
northwind
VIE
User Databases
11
Database Files
Database
Data (file)
.mdf or .ndf
Log (file)
.ldf
Tables, Indexes
Data Page (8 KB) Max row size = 8092 bytes
12
Data Files
Filegroups Data & log files autogrow Proportional fill Pages and Extents
In row text
Storage Engine
Transaction log Lazy Writer Lock Manager Log Writer Checkpoint / log truncation Background task
14
Hardware Configuration
Balance and push the bottleneck to expensive component CPU and L2 cache Memory
15
16
Max throughput ~10 MB/sec Max sequential transfers/sec ~150 Max random transfers/sec ~100 OLTP constrained by transfers/sec DSS constrained by MB/sec I/O sec 8K 64K Realistic transfer rates:
150 100 1.2 MB/sec 0.8 MB /sec 9.4 MB/sec 6.3 MB/sec
17
Hardware Configuration
Disk
Raid 0, 10, 5 Pagefile, tempdb, log and data files location h/w bandwidth limitations Disk queue length Write caching controllers Latch wait time
18
Row Identifiers
Base table organizations
Fixed RID
Rows identified by RID (8 bytes consisting of File#, Page#, Slot#) RIDs do not change unless a row is deleted and reinserted elsewhere RIDs can be reused once the transaction that deletes a row commits RIDs used as lock resource
19
Row Identifiers
Base table organizations
Clustered index
Clustered index
Rows identified by unique clustering key Clustering key used as lock resource
20
Secondary Indexes
Secondary index
Secondary indices
Key
Locator
Points to either
Index terms consist of key, locator pairs Locators are stable with respect to base table organization (unlike 6.X) Locator may be either RID (Fixed RID) or clustering key (clustered index) Unique key/locator pair used as lock resource
21
Index Changes
6
Adams
Lewis
Smith
11
Lewis Dan
... 6
Adams Kim
... 11
Smith Ken
Index on Views
Create View with SCHEMABINDING Create Unique Clustered Index on View All Nonclustered Indexes are dropped if Clustered Index is dropped Indexed Views are maintained automatically SET Options EXPAND VIEWS and NOEXPAND
23
pubs.dbo.authors
24
System Tables
Store Information (Metadata) About the System and Database Objects Database Catalog Stores Metadata About a Specific Database System Catalog Stores Metadata About the Entire System and All Other Databases
25
Metadata Retrieval
sp_help authors
System Functions
select getdate()
System tables
System functions
27
29
Server Properties
30
Server Properties
31
Database Properties
32
Installation Path Character Set and Sort Order Collations Network Support SQL Server Service Account Licensing Mode Instance Name
Lab work
Install SQL Server Start and Stop SQL Server Service Register your server with SQL Enterprise Manager Search a Topic in Books Online
Create a Table with Clustered Index Check at the Server and Database Properties
34
Summary
35