Sunteți pe pagina 1din 33

Module 6

Database Storage Options


Module Overview

• SQL Server Storage Performance


• SMB Fileshare
• SQL Server Storage in Microsoft Azure
• Stretch Database
Lesson 1: SQL Server Storage Performance

• I/O Performance
• Reviewing Wait Statistics
• Number of Spindles
• RAID Disks
• Storage Spaces
• Configuring Storage Pools and Storage Spaces
• Data and Log Storage
• tempdb Storage
• Demonstration: Moving tempdb Files
• Other Storage Options
I/O Performance

• Critical to SQL Server performance


• Design storage solutions to meet workload
• Use DMVs to assess workload on a running
instance
• sys.dm_io_virtual_file_stats
Reviewing Wait Statistics

• Use DMVs to review wait statistics:


• sys.dm_os_waiting_tasks
• sys.dm_os_wait_stats
• sys.dm_exec_session_wait_stats

• Wait types that relate to the storage system:


• Page IO Latch waits
• WRITELOG waits
• LOGBUFFER waits
• ASYNC_IO_COMPLETION waits
• IO_COMPLETION waits
Number of Spindles

• Hard disk drives have physical limitations:


• Platter spin speed
• Seek time (head movement)
• Serialized access

• Overcoming limitations:
• Use many spindles (physical disks)
RAID Disks

RAID 0 RAID 1
ACEGIK ABCDEF

BDFHJL ABCDEF

RAID 5 RAID 10
A#EG#K ACEGIK

BC#HI# BDFHJL

#DF#JL ACEGIK

BDFHJL
Storage Spaces

Storage spaces
• Allow pooling of disks
• Including internal and external IDE, SATA, SAS, USB
• Provide resiliency
• Flexible
• Can be expanded easily
Configuring Storage Pools and Storage Spaces

1. Create a storage pool


2. Create a storage space
3. Create a volume
Data and Log Storage

Primary data file: .mdf Transaction


Secondary data file: .ndf log file: .ldf

Page: 8 KB

Extent: eight
contiguous 8 KB pages
tempdb Storage

• tempdb:
• Contains temporary data for internal objects, row
versioning, and user objects
• Is truncated or rebuilt with every restart of the instance
• Occupies varying amounts of space
• Should be tested with real-life workloads

• Place tempdb on a fast and separate I/O


subsystem to ensure good performance
• Split tempdb into data files of equal size per
core
Demonstration: Moving tempdb Files

In this demonstration, you will see how to:


• Move tempdb files
Other Storage Options

Other Storage Options


• NAS: Network Attached Storage
• DAS: Direct Attached Storage
• SAN: Storage Area Network
Lesson 2: SMB Fileshare

• What Is SMB Fileshare?


• Benefits of SMB Fileshare
• Implementing SMB Fileshare
• Demonstration: Storing a Database on an SMB
Fileshare
What Is SMB Fileshare?

SMB: Server Message Block


• Used for file and printer sharing
• Considerably improved in recent versions
• Shares addressed using UNC paths, for example:
\\servername\share-name

• Can be configured in Windows Failover Clusters


to provide highly available storage
Benefits of SMB Fileshare

Benefits of SMB Storage for SQL Server


• Cost
• Manageability
Implementing SMB Fileshare

SMB Share Permissions:


• Full Control – SQL Server Service Account
• Full Control – SQL Server Agent Service Account

Use UNC Path in Create Database statement

Share which cannot be used:


• Administrative Shares
• Loopback Shares
• Mapped Network Drives

Filestream on SMB is not supported


Demonstration: Storing a Database on an SMB
Fileshare

In this demonstration, you will see:


• How to store SQL Server Data on an SMB share
Lesson 3: SQL Server Storage in Microsoft Azure

• What are SQL Server Data Files in Azure?


• Benefits of SQL Server Data Files in Microsoft
Azure
• Choosing a Storage Account and Performance Tier
• Implementing SQL Server Data Files in Azure
What are SQL Server Data Files in Azure?

On-Premises
Machine
On-Premises

Microsoft Azure

Microsoft Azure
Virtual Machine SQL Server Data Files
Benefits of SQL Server Data Files in Microsoft
Azure

Benefits of SQL Server data files in Microsoft Azure


• Simpler migration
• Separation of compute and storage nodes
• Simpler database recovery
• Security
• Backup strategy
Choosing a Storage Account and Performance
Tier

• Storage Account Types:


• General-Purpose Storage Accounts
• Blob Storage Accounts

• Storage Account Performance Tiers:


• Standard
• Premium

• For SQL Server data files in Azure, create general-


purpose storage accounts and use the standard
tier
Implementing SQL Server Data Files in Azure

Implementing SQL Server Data Files in Azure


1. Create an Azure storage account
2. Add a container
3. Generate SAS key
4. Create a credential on the SQL Server instance
5. Create a database using the container
credential
Lesson 4: Stretch Database

• What Is Stretch Database?


• Stretch Database Architecture
• Stretch Database Security
• Stretch Database Advice in Microsoft Data
Migration Assistant
• Implement a Stretch Database
What Is Stretch Database?

What is Stretch Database?


• Historical data – cloud storage
• Current data – on-premises

Benefits
• Quicker backups
• Reduced on-premises storage requirements
• Seamless to users
Stretch Database Architecture

On-Premises Azure
SQL Server
Instance

Linked Server
Connection
Stretch Database Security

Enable Stretch Database at the instance level


Requires
• SysAdmin or ServerAdmin

Enable a database for Stretch Database requires


• Control Database
• Administrator Permissions for Remote Endpoint

Data security
• Unaffected by Stretch Database
Stretch Database Advice in Microsoft Data
Migration Assistant

Stretch Database Advisor


• Part of Microsoft Data Migration Assistant
• Analyzes Databases for Stretch Database compatibility
• Highlights issues and blockers
Implement a Stretch Database

Entirely in Management Studio


• No need to preconfigure Azure storage or servers

Two Ways to Implement


• Wizard
• Transact-SQL
Lab: Implementing Stretch Database

• Exercise 1: Run Stretch Database Advisor in Data


Migration Assistant
• Exercise 2: Implement Stretch Database

Logon Information
Virtual machine: 20765C-MIA-SQL
User name: ADVENTUREWORKS\Student
Password: Pa55w.rd

Estimated Time: 45 minutes


Lab Scenario

As the database administrator for Adventure


Works, you have been asked to reduce the on-
premises storage requirements for the production
database without losing access to the data.
Lab Review

After completing this lab, you will now be able to:


• Run the Stretch Database Advisor
• Implement Stretch Database
Module Review and Takeaways

• Review Question(s)

S-ar putea să vă placă și