Upload
datavail
View
17
Download
0
Embed Size (px)
Citation preview
Backup and Restore SQL Server Databases
in Microsoft Azure
Andrew McDermid and Pinal Dave
Please silence cell phones
Silence Cells
Explore Everything PASS Has to Offer
FREE ONLINE WEBINAR EVENTS FREE 1-DAY LOCAL TRAINING EVENTS
LOCAL USER GROUPS
AROUND THE WORLDONLINE SPECIAL INTEREST
USER GROUPS
BUSINESS ANALYTICS TRAINING
VOLUNTEERING OPPORTUNITIES
PASS COMMUNITY NEWSLETTER
BA INSIGHTS NEWSLETTER FREE ONLINE RESOURCES
Session Evaluations
ways to access
Go to passSummit.com Download the GuideBook App
and search: PASS Summit 2016
Follow the QR code link displayed
on session signage throughout the
conference venue and in the
program guide
Submit by 5pmFriday November 6th toWIN prizes
Your feedback is important and valuable. 3
Agenda
Is this where you want to be? In here we are talking about...
• SQL Server in Azure Virtual Machines
• SQL Server Database Backups in Azure Virtual Machines
• Azure Storage Accounts
SQL Server Azure VMs
6
SQL Server Azure VMs
7
Pinal DaveSQL Authority
Pinal Dave is a technology enthusiast and an independent consultant. He has authored 11 SQL Server database books, 21 Pluralsight courses and have written over 3800 articles on the database technology on his blog at a http://blog.sqlauthority.com. Along with 14+ years of hands on experience he holds a Masters of Science degree and a number of database certifications.
/pinaldave @sqlauthority
Andrew McDermidMicrosoft SQL DBA, Datavail
Corporation
Andy is a MCITP certified MS SQL DBA who delivers and manages delivery of DBA services to many diverse clients. He enjoys helping his clients by finding and deploying pragmatic and practical solutions for their database issues.
/andrewmcdermid @oldskipole
SQL Server Azure VMs
10
Log
512GB
Data
512GB
• 2 DISKS
• 1 SQL data
• 1 SQL logs
SQL Server Azure VMs
11
Log
512GB
Data
512GB
Backups
• 3 DISKS
• 1 SQL data
• 1 SQL logs
• 1 Backups
SQL Server Azure VMs
12
Log
512GB
Data
512GB
Backups
• 4 DISKS
• 1 SQL data
• 1 SQL logs
• 1 Backups
• 1 TempDB
TempDB
SQL Server Azure VMs
13
• Server Stats
• 4 CPU
• 14GB RAM
• 28GB D:\
SQL Server Azure VMs
14https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/
Siz
es
for
vir
tual m
ach
ines
in A
zure
SQL Server Azure VMs
15 https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/
SQL Server Azure VMs
https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/
DS3_V2
Standard
• 192 MB/sec
SQL Server Azure VMs
DS3_V2
Standard
• 192 MB/sec
• 8 Data Disk
https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/
SQL Server Azure VMs
18
Log
512GB
Data
512GB
• 2 DISKS
• 1 SQL data
• 1 SQL logs
SQL Server Azure VMs
19
Log
512GB
Data
512GB
Backups
• 3 DISKS
• 1 SQL data
• 1 SQL logs
• 1 Backups
Backup to URLDemo
Backups to URL
21
• Azure Storage
Accounts
• Storage Account
Name
• Access Key
https://storageaccountname>.blob.core.windows.net
Azure
Storage Account
Backups to URL
22
EdwinaContainer
sql_serv
SQLSrvr01-
InstncASQLDEV
• Azure Storage
Accounts
• Storage
Account Name
• Access Key
• Container
Name
https://storageaccountname>.blob.core.windows.net/<container name>
Backups to URL
23
• SQL CREDENTIAL
• Credential Name
• Identity = Storage Account
Name
• Password = Storage
Account Key
TO URL = ‘https://storageaccountname>.blob.core.windows.net/<container name>/<backupfilename>.bak’
WITH CREDENTIAL = ‘<sql credential name>’
SQL Server Azure VMs
24
Log
512GB
Data
512GBBackups
• 2 DISKS
• 1 SQL data
• 1 SQL logs
SQL Server Azure VMs
25
Log
512GB
Data
512GB
• 4 DISKS
• 1 SQL data
• 1 SQL logs
• 6 unused
SQL Server Azure VMs
26
SQL Server Azure VMs
27
• PREMIUM DISK
• SSD
• Pay-for-capacity
• Dedicated I|O
• 500-5000 IOPS
• 100-200 MB/sec
P30
1TB
5000 IOPS
200 MB/sP20
512GB
2300 IOPS
150 MB/sP10
128GB
500 IOPS
100 MB/s
Premium
SQL Server Azure VMs
28
300MB/s
1TB
300MB/s
1TB
Log
46K IOPS
Data
46K IOPS
• 4 DISKS
• 2 SQL data
• 2 SQL logs
• 4 unused
P20
SQL Server Azure VMs
29
P20
P20
P20
P20
P20
50
100
150
200
250
300
350
400
MB
/sec 192
MB/s
DS3_v2
Backups to URL – What You Need
30
• Azure Storage Account• Storage Account Name+ Container Name
• Access Key
• SQL Server• SQL Server 2014 SP1 CU2 (min)
• SQL Credential
• TSQL Backup and Restore TO | FROM URL WITH CREDENTIAL
• Free-up a disk(s) for whatever…
IOPS, MB/s, TempDB;
utility/trace/log files; etc
• Works with maintenance plans,
scripts, SQL Agent jobs, etc.
Pros Cons
• Not local
• Thru-put limits per VM size
• No striped backups
• 1TB backup file limit
Backups to URL – Pros and Cons
Backup to Local Drive
32
DATABASE
STRIPED BACKUP SET
TO DISK
Database.1.bak
Database.2.bak
Database.3.bak
Database.4.bak
Backup to Local DriveDemo
Backup to Local Drive – What You Need
34
• Azure Storage Account• Storage Account Name + Container Name
• Access Key
• SQL Server• Any version
• TSQL Backup and Restore striped set TO | FROM URL
• AzCopy• /Dest: /Source: /Pattern:
• Automation script
• 1TB + DB backups
• Fast(-ish) backups via striping
• Fast copy to azure storage via
AZCopy
Pro Con
• Local disk storage capacity limits
• Local MB\sec limits
• Striped backup and offsite copy
management complexity
Backup to Local Drive – Pros and Cons
• Storage Account & Access Key
• Access Policy
• Shared Access Signature
Azure Storage Access and Security
36
Access and Security
37
Guess What Will Happen Next?
38
If Year was 2006 - BEFORE
If Year was 2016 - NOW
Access and Security - BEFORE
39
Access and Security - BEFORE
40
Access and Security - NOW
41
Access and Security - NOW
42
Shared Access Signature – What You Need
43
• CREATE SHARED ACCESS SIGNATURE WITH POWERSHELL
• Login to Azure Subscription
• Returns ‘CREATE CREDENTIAL‘ TSQL
https://msdn.microsoft.com/en-us/library/dn466430.aspx
Shared Access Signature – What You Get
44
• SQL CREDENTIAL
• Credential Name = URL
• Identity = “Shared Access
Signature”
• Password = SAS
URL
TO URL = ‘https://<storageaccountname>.blob.core.windows.net/<container name>/<backupfilename>1.bak’
URL = ‘https://<storageaccountname>.blob.core.windows.net/<container name>/<backupfilename>.2.bak’
URL = ‘https://<storageaccountname>.blob.core.windows.net/<container name>/<backupfilename>.3.bak’
URL = ‘https://<storageaccountname>.blob.core.windows.net/<container name>/<backupfilename>.4.bak’
Container
Shared Access Signature – What You Get
45
DATABASE
2TB
STRIPED BACKUP TO
URL
Database.1.bak
Database.2.bak
Database.3.bak
Database.4.bak
Striped Backups to URLDemo
Container
Shared Access Signature – What You Get
47
DATABASE
BACKUP TO URLDatabase.bak
1TB Max Backup File Size
Container
Shared Access Signature – What You Get
48
DATABASE
STRIPED BACKUP TO
URL
Database.1.bak
Database.2.bak
Database.3.bak
Database.4.bak
12.8TB Max Backup File Size
Striped Backups to URL- What You Need
49
• Azure Storage Account• Storage Account Name+ Container Name
• Access Key
• Shared Access Signature
• SQL Server• SQL Server 2016
• SQL “SAS” Credential
• TSQL Backup and Restore striped set TO | FROM URL
• Speed
• VLDB (12.8TB - 64 stripes of up to
200GB each)
Pro Con
• SQL 2016 + only
• VLDB (12.8TB - 64 stripes of up to
200GB each)
Striped Backups to URL – Pros and Cons
Session Evaluations
ways to access
Go to passSummit.com Download the GuideBook App
and search: PASS Summit 2016
Follow the QR code link displayed
on session signage throughout the
conference venue and in the
program guide
Submit by 5pmFriday November 6th toWIN prizes
Your feedback is important and valuable. 3
Thank You
Learn more from
Andy and [email protected] or follow @oldskipole
[email protected] or follow @pinaldave