50
Solutions hybrides, Disaster Recovery et Backup avec SQL Server 2014 et Azure Eric Moreau, MVP, Moer inc. www.emoreau.com - [email protected] 2015-02-07

Eric Moreau - Samedi SQL - Backup dans Azure et BD hybrides

Embed Size (px)

Citation preview

Solutions hybrides, Disaster Recovery et Backup avec SQL Server 2014 et AzureEric Moreau, MVP, Moer inc.

www.emoreau.com - [email protected]

2015-02-07

Cloud DR

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

Typical Configuration

4

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

Backup to Cloud

Backup to Windows Azure

Windows Azure

storage

WA

Win

do

ws

Azu

re

Blo

bs

• On-site/off-site storage costs

• Device management costsB

ox

• XDrives limited to 1 terabyte

• Max 16 drives

• Manage drives and policy

• Near “bottomless” storage

• Off-site, geo-redundant

• No provisioning

• No device management

• Media safety (decay-free)

• Remote accessibility

Backup to Windows Azure Tools

Demo for Backup to Cloud

Backup to Windows Azure

WA

Win

do

ws

Azu

re

Blo

bs

• Backing up to Azure is new to SQL

2014

• Taking a backup is easy

• Right-click your database

• Select Tasks

• Select Back Up …

Backup to Windows Azure

• The Destination option

now let you pick URL

• Click the Add button

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

Backup to Windows Azure

• Open the Options tab

• You can set the

compression

• my tests = about 7-1

• You can set the

encryption

Backup to Windows Azure

Backup to Windows Azure

Backup to Windows Azure

Backup to Windows Azure

Backup to Windows Azure

Backup to Windows Azure

Backup to Windows Azure

Backup to Windows Azure

Backup to Windows Azure

Deploy Databases to Windows Azure Wizard

Easy on-ramp to cloud

Demo for Deploy Databases to Windows Azure Wizard

Deploy DB to Windows Azure

Win

do

ws

Azu

re

Blo

bs

• 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

• Click Next on the

Welcome dialog

Deploy DB to Windows Azure

• You first need to connect to the

target (Azure)

Deploy DB to Windows Azure

• Specify:

• Database name

• Edition of database

• Size of database

Deploy DB to Windows Azure

• Review the settings

and click Finish

Deploy DB to Windows Azure

• All green!!!

Deploy DB to Windows Azure

• If anything went wrong…

Deploy DB to Windows Azure

• 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

• Right-clicking an

Azure table in

SSMS

• Anything missing?

Deploy DB to Windows Azure

SQL Server Data Files in Windows Azure

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

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

StorageDB3

DB6DB6DB5DB4

DB3DB2DB1Native

support for

SQL Server

database files

stored as

Windows

Azure blobs

Scenarios

Windows Azure

Storage

Node2

Node1

DB1

DB1

DB1

Migrate Database to another

machine

Basic Disaster Recovery

Separation of Compute and

Storage

For Azure VM, expand drive and

size of Xdrive

Better together: IaaS VM per

minute billing

SQL Server Data Files in Windows Azure

SQL Server Data Files in Windows Azure

SQL Data Files in Windows Azure

WA

Win

do

ws

Azu

re

Blo

bs

• 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

SQL Data Files in Windows Azure

WA

Win

do

ws

Azu

re

Blo

bs

• 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

SQL Data Files in Windows Azure

WA

Win

do

ws

Azu

re

Blo

bs

• Click on Security again

• Open Signatures

• Select your policy

• Click Generate Signature

• Click Copy to Clipboard

SQL Data Files in Windows Azure

WA

Win

do

ws

Azu

re

Blo

bs

• 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)

SQL Data Files in Windows Azure

WA

Win

do

ws

Azu

re

Blo

bs

• Create the database

SQL Data Files in Windows Azure

WA

Win

do

ws

Azu

re

Blo

bs

• Create a table – nothing different

• And use it!

Wrap up

Restore to VMGeo Replication