sql server 2012 ha and dr sql saturday dc
DESCRIPTION
Presentation delivered at SQL Saturday #173 Washington DCTRANSCRIPT
SQL Server 2012 High Availability andDisaster RecoverySQL Saturday #173
December 8, 2012
Washington, DC
Joey D’Antoni
About Me
@jdanton Joedantoni.wordpress.com [email protected]
Resources from Today’s Presentation
http://bit.ly/SQLSatDC_JD
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
Disaster Recovery
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
Risk Management
"How fast do you want to go? How much do you want to spend?“ –attribution unknown
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!
DR Solutions in SQL Server
AlwaysOn Availability GroupsDatabase MirroringLog ShippingMulti-site ReplicationMulti-site Clustering Virtualization Multi-site failover
High Availability
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
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
SQL Server HA and DR Options
AlwaysOn Availability GroupsDatabase MirroringFailover Cluster InstancesLog ShippingReplication
Review
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)
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
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
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
Windows Failover Cluster
Failover Cluster Instances Node A Node B
SQL Instanc
e
Cluster Virtual Name\InstanceName
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
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*
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
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
AlwaysOn Availability Groups
Windows Cluster
Node A
Instance 1
AG(P)
Node B
Instance 2
AG(S)
Washington Chicago
Listener Name (AD VCO)
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
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
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
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
Windows Server 2012
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
Quorum
Windows Cluster
Quorum Node 1 Node 2
Node Majority Mode
Node and Disk Majority
Q
In Node/Disk Majority Mode
Cluster sustain node failure
AlwaysOn Availability Groups
Demo
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!
Questions
Contact Info
@jdanton – Twitter [email protected] – EmailJoedantoni.wordpress.com – Blog Resources from today:
http://bit.ly/SQLSatDC_JD