SQL Server Architecture
SQL Server Architecture
Data
Transaction
Performance Integrity and
Isolation
Protection
Data
Reporting
Analysis
SQL Server 2008 Architecture
• SQL Server Database Engine
– Storage Engine
– Query Engine
• Databases
– Logical collections of related objects
• Instances
– Separate running services of SQL Server
• Default instance and named instances
SQL Server Services
• Instance-Specific • Instance-unaware
(one service per instance): – Notification
– SQL Server Services
– SQL Server Agent – SQL Server
– Analysis Services Browser
– Reporting Services – SQL Server Active
Directory Helper
– Integration
Services – SQL Writer
SQL Server 2008 Admin. Tools
• SQL Server Management Studio[SSMS]
– Database management GUI
• Object browser; templates, reports, etc.
– Support for writing and executing queries
• Managing Schemas
– CREATE, ALTER, DROP SCHEMA
– SQL Server Management Studio
– Can assign default schemes to database users:
• WITH DEFAULT_SCHEMA ‘SchemaName’
Overview of Database Objects
• Database Roles
– Users can belong to multiple roles
– Guest (does not require a user account)
– dbo (Server sysadmin users)
• Application Roles
– Used to support application code
Built-In Server / Database Roles
Server Roles Database Roles
• SysAdmin • db_accessadmin
• ServerAdmin • db_BackupOperation
• SetupAdmin • db_DataReader
• SecurityAdmin • db_DataWriter
• ProcessAdmin • db_DDLAdmin
• DiskAdmin • db_DenyDataReader
• DBCreator • db_DenyDataWriter
• BulkAdmin • db_Owner
• db_SecurityAdmin
• public
Configuring Permissions
• Scopes of Securables
– Server
– Database
– Schema
– Objects
• Permission Settings:
– GRANT
– REVOKE
– DENY
• Options
– WITH GRANT OPTION
– AS (Sets permissions using another user or role)
Database Maintenance & Data
Protection
• Backup operations
– Full Backups
– Differential Backups
– Transaction Log Backups
• Allows point-in-time recovery
Recovery Processes
• Recovery process:
– Latest full backup (Required)
– Latest differential backup (Optional)
– Unbroken sequence of transaction log backups
(Optional)
• All transaction logs should be restored with
NO RECOVERY option (except for the last
one)
– Prevents database from being accessed while
restore process is taking place
Database Maintenance Plans
• Check database integrity
• Shrink database
Maintenance • Rebuild / reorganize indexes
Tasks • Update statistics
• Full Backup
• Differential Backup
Backup • Transaction Log Backup
Databases
Maintenance Plan Wizard
• Scheduling
– Single schedule for all tasks
– Multiple schedules
• Databases:
– System, All, All User, or specific databases
• Wizard Options:
– Order of operations
• Manages logging and history of operations
Reliability & High Availability Options
• Database Mirroring
• Log-shipping
• SQL Server Fail-Over Clusters
• Replication
• Load-Balancing (at network or OS level)
SQL Server Maintenance
• Regular tasks
– Monitor disk space usage
– Monitor application performance
– Monitor physical and logical disk space
– Maintain indexes and data files
– Review backup and recovery operations
– Review security
– Review SQL Server Logs and/or Windows logs
– Verify the status of all jobs
Questions & Discussion