7 février 2015
Samedi SQL
Sujet: Session 4 - Backup dans Azure, Bases de données hybrides (Éric Moreau)
Cette session vous montrera comment prendre des backups de vos bases de données "on premises" vers Azure. Il vous montrera aussi comment utiliser des bases de données hybrides.
3. Why Do We Need Cloud DR for SQL Server?
• An event can cause on-premises
SQL Server to become unavailable
‐ Temporarily (e.g. gateway failure)
‐ Permanently (e.g. flooding)
• A disaster recovery site is expensive
‐ Site rent + maintenance
‐ Hardware
‐ Ops
3
5. Characteristic of Cloud DR for SQL Server
• Deploy one or more secondary replicas for on-premises
SQL Server
‐ Replicas continuously synchronize
• At best region: West US, East US, East Asia, Southeast Asia,
North Europe, West Europe
‐ Political considerations
‐ Latency
• Low TCO
‐ VM and storage
5
10. Backup to Windows Azure
WA
WindowsAzure
Blobs
• Backing up to Azure is new to SQL
2014
• Taking a backup is easy
• Right-click your database
• Select Tasks
• Select Back Up …
11. Backup to Windows Azure
• The Destination option
now let you pick URL
• Click the Add button
12. Backup to Windows Azure
• Ensure the file name has a
.bak extension
• Otherwise, you will get
trouble restoring it!
• Set your credential
• Set the correct container
13. Backup to Windows Azure
• Open the Options tab
• You can set the
compression
• my tests = about 7-1
• You can set the
encryption
26. Deploy DB to Windows Azure
WindowsAzure
Blobs
• To deploy a database to Windows
Azure:
• Right-click the database
• Select Tasks
• Select Deploy Database to
Windows Azure SQL Database
• Notice that a similar wizard exists to
deploy to a VM
27. • Click Next on the
Welcome dialog
Deploy DB to Windows Azure
28. • You first need to connect to the
target (Azure)
Deploy DB to Windows Azure
29. • Specify:
• Database name
• Edition of database
• Size of database
Deploy DB to Windows Azure
30. • Review the settings
and click Finish
Deploy DB to Windows Azure
32. • If anything went wrong…
Deploy DB to Windows Azure
33. • Now that you have a database in
Azure
• You can use your local SSMS to
connect to it
• Connect to server
• Ensure your IP address is trusted
in the Azure management console
Deploy DB to Windows Azure
36. SQL Server Data Files in Windows Azure
• Ability to move data & log files in Windows
Azure Storage, while keeping the compute
node of SQL Server on-premise
• Transparent Data Encryption (TDE) is supported
• No application changes required
• Centralized copy of data and log files
• Enjoy unlimited storage capacity in Azure
Storage (built in HA, SLA, geo-DR)
• Secure because TDE encryption key can be stored
on-premise
• Restore database is simply an attach operation
37. Overview
Benefits
• Near-bottomless storage
• Offsite, geo-redundant
• No provisioning
• No device management
• Media safety (decay-free)
• Remote accessibility
Details
• Can persist data, log files, or both
• Works with backup to Windows Azure
• FileStream currently not supported
• Failover clustering not supported
• AlwaysOn availability groups supported
Windows Azure VM
On-premises box
Windows Azure
Storage
DB3
DB6DB6DB5DB4
DB3DB2DB1Native
support for
SQL Server
database files
stored as
Windows
Azure blobs
41. SQL Data Files in Windows Azure
WA
WindowsAzure
Blobs
• Updated August 2014 (V6 Preview 3)
• First thing to do is to generate a secret…
• Download and install Azure Storage Explorer from CodePlex
http://blogs.msdn.com/b/igorpag/archive/2013/10/23/create-a-sql-server-2014-
database-directly-on-azure-blob-storage-with-sqlxi.aspx
42. SQL Data Files in Windows Azure
WA
WindowsAzure
Blobs
• Run the Azure Storage
Explorer
• Connect to your account
• Select the container that
will contains your data files
• Click Security
• Go to Policies
• Enter values as shown
• Click Save Policies
• Click Close
43. SQL Data Files in Windows Azure
WA
WindowsAzure
Blobs
• Click on Security again
• Open Signatures
• Select your policy
• Click Generate Signature
• Click Copy to Clipboard
44. SQL Data Files in Windows Azure
WA
WindowsAzure
Blobs
• Create the credential in SSMS
• Starts with https
• Full path to your storage
• Shared Access Signature is MANDATORY
• Copy your secret (starting with sr to the end)
45. SQL Data Files in Windows Azure
WA
WindowsAzure
Blobs
• Create the database
46. SQL Data Files in Windows Azure
WA
WindowsAzure
Blobs
• Create a table – nothing different
• And use it!