sql server 2012 ha and dr sql saturday dc

34
SQL Server 2012 High Availability and Disaster Recovery SQL Saturday #173 December 8, 2012 Washington, DC Joey D’Antoni

Upload: jdanton

Post on 14-Jun-2015

506 views

Category:

Documents


0 download

DESCRIPTION

Presentation delivered at SQL Saturday #173 Washington DC

TRANSCRIPT

Page 1: Sql server 2012 ha and dr sql saturday dc

SQL Server 2012 High Availability andDisaster RecoverySQL Saturday #173

December 8, 2012

Washington, DC

Joey D’Antoni

Page 2: Sql server 2012 ha and dr sql saturday dc

About Me

@jdanton Joedantoni.wordpress.com [email protected]

Resources from Today’s Presentation

http://bit.ly/SQLSatDC_JD

Page 3: Sql server 2012 ha and dr sql saturday dc

Today’s Presentation

Disaster Recovery—It’s All About Risk Management

Understanding High AvailabilityOk, I get that, now how do I protect my databases?

Understanding Availability Groups

Page 4: Sql server 2012 ha and dr sql saturday dc

Disaster Recovery

Page 5: Sql server 2012 ha and dr sql saturday dc

Disaster Recovery Terms

Recovery Time Objective – How long can your systems be down before your business is impacted?

Recovery Point Objective—How much data can your business lose before being impacted?

These will vary highly by your industry, and your business model, but they apply to every application

Page 6: Sql server 2012 ha and dr sql saturday dc

Risk Management

"How fast do you want to go? How much do you want to spend?“ –attribution unknown

Page 7: Sql server 2012 ha and dr sql saturday dc

Risk Management

In a nutshell, preparing a DR policy is just like buying insurance

Based on your firms tolerance for risk, business model, and geography

Extremely high levels of availability and protection are available, at a very expensive cost

Very reasonable levels of protection and availability can be had at a low cost

If you use a cloud provider—you still need to think about this!

Page 8: Sql server 2012 ha and dr sql saturday dc

DR Solutions in SQL Server

AlwaysOn Availability GroupsDatabase MirroringLog ShippingMulti-site ReplicationMulti-site Clustering Virtualization Multi-site failover

Page 9: Sql server 2012 ha and dr sql saturday dc

High Availability

Page 10: Sql server 2012 ha and dr sql saturday dc

High Availability

High availability is a system design approach and associated service implementation that ensures a prearranged level of operational performance will be met during a contractual measurement period. --wikipedia

• System Design allows for minimal downtime in the event of hardware and operating system failures

Page 11: Sql server 2012 ha and dr sql saturday dc

High Availability in SQL Server

SQL Server Failover Cluster InstancesVMWare vMotion/Hyper-V Live Migration

Both of these technologies have a single point of failure in shared storage

Page 12: Sql server 2012 ha and dr sql saturday dc

SQL Server HA and DR Options

AlwaysOn Availability GroupsDatabase MirroringFailover Cluster InstancesLog ShippingReplication

Review

Page 13: Sql server 2012 ha and dr sql saturday dc

Optional

Log Shipping

PrimaryServer

DB (P)

Secondary

ServerDB (S)

Secondary

ServerDB (S)

Log Backup

• Transaction Log Backups take place on primary

• External Process ships logs to secondary server(s)

• Data can be read on secondary (except during t-log apply)

Page 14: Sql server 2012 ha and dr sql saturday dc

Log ShippingPros/Cons

Pros• Standard Edition• Supports Multiple Targets• Can Read Secondary Copies

Cons• Dependent on Backup on

Primary• Manual Failover Process• Reasonably High Complexity

Page 15: Sql server 2012 ha and dr sql saturday dc

Replication

Image Credit—MS Books Online

• This is a really high level view of replication

• There are numerous topologies and options involved in replication

• This is the nuts and bolts of it

Page 16: Sql server 2012 ha and dr sql saturday dc

ReplicationPros/Cons

Pros• Can Replicate to Multiple

Servers• Replicate subset of data• Standard Edition

(transactional)

Cons• Manual Failover• Unknown RPO• Can be fragile• Re-sync process can be

ugly• Also requires connection

change for failover

Page 17: Sql server 2012 ha and dr sql saturday dc

Windows Failover Cluster

Failover Cluster Instances Node A Node B

SQL Instanc

e

Cluster Virtual Name\InstanceName

Page 18: Sql server 2012 ha and dr sql saturday dc

Failover Cluster InstancesRequirements

Shared Storage (SAN or SMB Share*)

Windows Cluster (Windows Server 2012 Standard Edition)

SQL Server Standard Edition (Two Node Limit)

Cluster NetworkQuorum Disk

Page 19: Sql server 2012 ha and dr sql saturday dc

SQL Server Failover Cluster InstancesPros/Cons

Pros• Connections are transparent• Failover is automatic• Allows for whole instance

protection• Multiple servers can be

involved

Cons• Setup is complex• Hardware can sit idle in some

configs• Single storage doesn’t allow

for data protection*

*More on this later

Page 20: Sql server 2012 ha and dr sql saturday dc

Database Mirroring

Primary Server

SecondaryServer

WitnessServer

Mirror

DB

Mirror

DB

• Database transactions are compressed and shipped to secondary server (2008+)

• The optional witness server facilitates automatic failover

• Transfer may be sync or async*

*Enterprise Edition Only

Page 21: Sql server 2012 ha and dr sql saturday dc

Database Mirroring Pros/Cons

Cons• Is per database—multiple

DB failovers need scripting

• Async only available in EE

• Marked as deprecated in SQL 2012

• Secondaries are inaccessible (except for snapshots)

Pros• Automatic Failover

(w/witness)• Configuration is fast and

easy• Failover happens quickly• Corrupted pages get

fixed on secondary

Page 22: Sql server 2012 ha and dr sql saturday dc

AlwaysOn Availability Groups

Windows Cluster

Node A

Instance 1

AG(P)

Node B

Instance 2

AG(S)

Washington Chicago

Listener Name (AD VCO)

Page 23: Sql server 2012 ha and dr sql saturday dc

AlwaysOnAvailability Groups

Requires SQL Server Enterprise EditionWindows ClusterAll servers in same Windows DomainDatabases Failover as a groupNo Shared Storage NeededAsync and Sync ModesAutomatic and Manual FailoverSupports up to 4 replica copiesReplicas can be readBackups on secondary copies

Page 24: Sql server 2012 ha and dr sql saturday dc

AlwaysOn Availability Groups Pros/Cons

Pros• Readable secondaries

allow for load distribution• No shared storage can

reduce hardware costs• Multiple databases failing

together is great for complex apps

• Connection string handled gracefully by listener

• Administration all through SSMS

• Config is easy

Cons

• Large topologies lead to $$$ license costs

• Enterprise Edition only• New feature, so some

growing pains• Changes in application

code needed

Page 25: Sql server 2012 ha and dr sql saturday dc

SQL 2012 What’s New(Clustering)

Can cluster using SMB shares—becomes more viable option with SMB 3.0 in Windows Server 2012

Failover Process is changed—isAlive and LooksAlive go away. Replaced with sp_server_diagnostics

Multi-subnet clustering is now available—this is designed for stretch clustering using SAN replication

Page 26: Sql server 2012 ha and dr sql saturday dc

SQL Server 2012 DR New Features

Availability Groups Mirroring is marked as deprecated

Not sure the long term impact of this for standard edition and DR

No real changes to replication or log shipping

Page 27: Sql server 2012 ha and dr sql saturday dc

Windows Server 2012

Page 28: Sql server 2012 ha and dr sql saturday dc

Windows Server 2012

Cluster Aware Updating

Great concept—allows for clusters to be automatically rebooted

Works perfectly with SQL Server Failover Cluster Instances

Doesn’t work with AlwaysOn Availability Groups, at the moment

Page 29: Sql server 2012 ha and dr sql saturday dc

Quorum

Page 30: Sql server 2012 ha and dr sql saturday dc

Windows Cluster

Quorum Node 1 Node 2

Node Majority Mode

Node and Disk Majority

Q

In Node/Disk Majority Mode

Cluster sustain node failure

Page 31: Sql server 2012 ha and dr sql saturday dc

AlwaysOn Availability Groups

Demo

Page 32: Sql server 2012 ha and dr sql saturday dc

Summary

Understand your business need before designing a HA and DR strategy

DR is just like buying insurance—you don’t need it until you do.

Lots of good options for HA and DR in SQL Server for many price points

Always have a plan!

Page 33: Sql server 2012 ha and dr sql saturday dc

Questions

Page 34: Sql server 2012 ha and dr sql saturday dc

Contact Info

@jdanton – Twitter [email protected] – EmailJoedantoni.wordpress.com – Blog Resources from today:

http://bit.ly/SQLSatDC_JD