Microsoft SQL Server
Microsoft SQL Server
Administration for SAP
Administration for SAP
SQL Server Architecture
SQL Server Architecture
Overview Overview
SQL Server ArchitectureSQL Server Architecture
SQL Server with SAPSQL Server with SAP
Performance Monitoring and TuningPerformance Monitoring and Tuning
Administration and TroubleshootingAdministration and Troubleshooting
Database Backup and RestoreDatabase Backup and Restore
Database Server Database Server
Relational Database Management System SQL Server
Transact-SQL Transact-SQL Transact-SQL Transact-SQL Application
Application
Client
Results Results Results Results
SQL Server Service
SQL Server Service
Client / Server Client / Server
Application Application
Database Interface Database Interface
Network Library Network Library
SQL Server SQL Server
Open Data Services Open Data
Services
Network Library Network Library
Tabular Data Stream (TDS) Tabular Data Stream (TDS)
Client Server
SQL Server Client Network SQL Server Client Network
Utility
Utility
SQL Server Network Utility
SQL Server Network Utility
SQL Server Client Tools SQL Server Client Tools
SQL Enterprise ManagerSQL Enterprise Manager
SQL Query AnalyzerSQL Query Analyzer
Service ManagerService Manager
Server & Client Network UtilityServer & Client Network Utility
Performance MonitorPerformance Monitor
SQL ProfilerSQL Profiler
Index Tuning WizardIndex Tuning Wizard
Configuring SQL Enterprise Configuring SQL Enterprise
Manager
Manager
Threads and Fibers Threads and Fibers
SQL Server process maintains pool SQL Server process maintains pool of threads to process client requests of threads to process client requests
SQL Server can also be configured SQL Server can also be configured to use lightweight pooling(fibers)
to use lightweight pooling(fibers)
max worker threadsmax worker threads
Databases Databases
System Databases
User Databases
master master
model
model tempdbtempdb msdbmsdb
pubspubs northwindnorthwind VIEVIE
distribution distribution
Database Files Database Files
Extent (8
contiguous 8-KB
Page (8 Tables,
Indexes
Data
Database Database
Data (file)
.mdf or .ndf
Data (file)
.mdf or .ndf Log (file)
.ldf
Log (file)
.ldf
Data Files Data Files
FilegroupsFilegroups
Data & log files autogrowData & log files autogrow
Proportional fillProportional fill
Pages and ExtentsPages and Extents
GAMGAM
SGAMSGAM
PFSPFS
Storage Engine Storage Engine
Data Cache & Proc cacheData Cache & Proc cache
Cache hit ratio / free buffersCache hit ratio / free buffers
Transaction logTransaction log
Lazy WriterLazy Writer
Lock ManagerLock Manager
Log WriterLog Writer
Checkpoint / log truncationCheckpoint / log truncation
Hardware Configuration Hardware Configuration
Balance and push the bottleneck to Balance and push the bottleneck to expensive component
expensive component
CPU and L2 cacheCPU and L2 cache
MemoryMemory
Hard and Soft PagingHard and Soft Paging
System Area NetworksSystem Area Networks
Support of SAN Network InterfacesSupport of SAN Network Interfaces
cLan from GigaNetcLan from GigaNet
I/O components - Disks I/O components - Disks
How fast is a disk? How fast is a disk?
Depends on the type of I/O workloadDepends on the type of I/O workload
SQL Server reads 8K random SQL Server reads 8K random (page reads)
(page reads)
Singleton (or few) select/update/insertSingleton (or few) select/update/insert
Lazy writerLazy writer
Checkpoint processingCheckpoint processing
SQL Server reads 64K SQL Server reads 64K
sequential (extent reads)
sequential (extent reads)
I/O components - Disks I/O components - Disks
Max throughput ~10 MB/secMax throughput ~10 MB/sec
Max sequential transfers/sec ~150Max sequential transfers/sec ~150
Max random transfers/sec ~100Max random transfers/sec ~100
OLTP constrained by transfers/sec OLTP constrained by transfers/sec
DSS constrained by MB/secDSS constrained by MB/sec
Realistic transfer rates:Realistic transfer rates:I/O secI/O sec 8K8K 64K64K
Sequential I/O
Sequential I/O 150150 1.2 MB/sec1.2 MB/sec 9.4 MB/sec9.4 MB/sec Random I/O
Random I/O 100100 0.8 MB /sec0.8 MB /sec 6.3 MB/sec6.3 MB/sec
Hardware Configuration Hardware Configuration
DiskDisk
Raid 0, 10, 5Raid 0, 10, 5
Pagefile, tempdb, log and data files Pagefile, tempdb, log and data files location
location
h/w bandwidth limitationsh/w bandwidth limitations
Disk queue lengthDisk queue length
Write caching controllersWrite caching controllers
Latch wait timeLatch wait time
Fixed RID Fixed RID
Row Identifiers Row Identifiers
Base table organizations Base table organizations
Fixed Row Identifier (RID)Fixed Row Identifier (RID)
Rows identified by RID Rows identified by RID
(8 bytes consisting of File#, (8 bytes consisting of File#,
Page#, Slot#) Page#, Slot#)
RIDs do not change unless RIDs do not change unless a row is deleted and
a row is deleted and reinserted elsewhere reinserted elsewhere
RIDs can be reused once RIDs can be reused once the transaction that deletes the transaction that deletes
a row commits a row commits
RIDs used as lock resourceRIDs used as lock resource
Clustered index Clustered index
Clustered indexClustered index
Rows identified by Rows identified by unique clustering key unique clustering key
Clustering key used Clustering key used as lock resource
as lock resource
Row Identifiers Row Identifiers
Base table organizations
Base table organizations
Secondary index Secondary index
KeyKey ““Locator”Locator”
Points to either Points to either
Secondary Indexes Secondary Indexes
Secondary indicesSecondary indices
Index terms consist Index terms consist of key, “locator”
of key, “locator”
pairs pairs
Locators are stable Locators are stable with respect to base with respect to base
table organization table organization
(unlike 6.X) (unlike 6.X)
Locator may be Locator may be either RID (Fixed either RID (Fixed
RID) or clustering RID) or clustering
key (clustered index) key (clustered index)
Adams Adams
66 66 LewisLewis 11 SmithSmith 1111
Clustering index data Clustering index data
11 LewisLewis DanDan ...... AdamsAdams KimKim ...... 1111 SmithSmith KenKen 66
Adams Adams
Index Changes Index Changes
Secondary index lookup on key “Adams”
Secondary index lookup on key “Adams”
Index on Views Index on Views
Create View with SCHEMABINDINGCreate View with SCHEMABINDING
Create Unique Clustered Index on Create Unique Clustered Index on ViewView
All Nonclustered Indexes are All Nonclustered Indexes are dropped if Clustered Index is dropped if Clustered Index is
dropped dropped
Indexed Views are maintained Indexed Views are maintained automatically
automatically
Referring to SQL Server Referring to SQL Server
Objects Objects
Fully Qualified NamesFully Qualified Names
Partially Specified NamesPartially Specified Names
Server defaults to local serverServer defaults to local server
Database defaults to current databaseDatabase defaults to current database
Owner defaults to the user name in the Owner defaults to the user name in the database
database
pubs.dbo.authors
System Tables System Tables
Store Information (Metadata) About Store Information (Metadata) About the System and Database Objects the System and Database Objects
Database Catalog Stores Metadata Database Catalog Stores Metadata About a Specific Database
About a Specific Database
System Catalog Stores Metadata System Catalog Stores Metadata About the Entire System and All About the Entire System and All
Other Databases Other Databases
Metadata Retrieval Metadata Retrieval
System Stored ProceduresSystem Stored Procedures
sp_help authorssp_help authors
System FunctionsSystem Functions
select getdate()select getdate()
Information Schema ViewsInformation Schema Views
select * FROM select * FROM
Common System Procedures Common System Procedures
and System Tables and System Tables
System stored proceduresSystem stored procedures
sp_help, sp_helpindexsp_help, sp_helpindex
sp_helpdb, sp_helpfile/filegroupsp_helpdb, sp_helpfile/filegroup
sp_who, sp_locksp_who, sp_lock
sp_depends, sp_recompilesp_depends, sp_recompile
sp_readerrorlogsp_readerrorlog
System tablesSystem tables
sysobjects, sysindexes, sysprocessessysobjects, sysindexes, sysprocesses
Login Authentication, Login Authentication, Database User Accounts Database User Accounts
Windows NT
Verifies Password Windows NT
Verifies Password
SQL Server
SQL Server SQL Server
SQLSQL Windows NT
Windows NT
SQL Server Assigns Logins to User Accounts and Roles
SQL Server Assigns Logins to User Accounts and Roles
Database User Account Database
User Account
Windows NT Group User Windows NT Group User
SQL Server
Server Properties
Server Properties
Server Properties
Server Properties
Database Properties
Database Properties
Installing SQL Server Installing SQL Server
Installation PathInstallation Path
Character Set and Sort OrderCharacter Set and Sort Order
CollationsCollations
Network SupportNetwork Support
SQL Server Service AccountSQL Server Service Account
Licensing ModeLicensing Mode
Instance NameInstance Name
SQL Server 2000 onlySQL Server 2000 only
Lab work Lab work
Install SQL ServerInstall SQL Server
Start and Stop SQL Server ServiceStart and Stop SQL Server Service
Register your server with SQL Register your server with SQL Enterprise Manager
Enterprise Manager
Search a Topic in Books OnlineSearch a Topic in Books Online
Online help for Create TableOnline help for Create Table
Create a Table with Clustered IndexCreate a Table with Clustered Index
Check at the Server and Database Check at the Server and Database
Summary Summary
Write a summary for this moduleWrite a summary for this module