Advanced HA
and DR
ינא ימ
?
•
ןמדירפ ודיע
•
ךירדמו ץעוי
SQL Server
תרבחב
רונילאו
•
םוחת לש יגולונכט ליבומ
SQL
•
[email protected]
רונילאו
•
םייעוצקמ
םיתוריש
ןתמב
לארשיב
הליבומה
הרבחה
םינותנ
יסיסב
םוחתב
•
לש
םידברה
ללכב
החמתמה
ליבומ
םיצעוי
תווצ
םינותנה
יסיסב
•
לש
בהז
תמרב
םיפתוש
Microsoft
ו
-Oracle
•
םינותנה
יסיסב
םוחתב
םיליבומ
םירצומ
יגיצנ
•
לעמ
300
לכב
תוחוקל
םירזגמה
http://www.valinor.co.il
רונילאו
Agenda
•
09:00-10:30 – SQL Server and HA
•
10:30-10:45 – Break
•
10:45-12:30 – Hands on LAB
(Cluster, log shipping and
replication)
•
12:30 – 13:30 – Launch
•
13:30 – 15:00 – What is Always ON + LAB
•
15:00– 15:15 – Break
•
15:15 – 16:15 – Replication in real life
(Maria Zakourdaev)
•
15:15 16:30 - Summary
DRP
Uptime
Number of 9’s Availability Percentage Total Annual Downtime
2 99% 3 days, 15 hours
3 99.9% 8 hours, 45 minutes
4 99.99% 52 minutes, 34 seconds
Disaster recovery plan
DRP
RPO
(Recovery
point
objective)
RTO
(Recovery
time
objective)
Scope of
disaster
Scale out
ROI
Business continuity
Provide DR and HA to
business critical
services ONLY
What needs protection
Where do we recover
LAN HA WAN DR Synchronous AsynchronousSQL Server components
SQL Server DB engine Reporting services Analysis Services Integration Services SQL Server Agent Full text SearchSQL Server component
session state
Stateful
• Database engine
• SQL server agent
• Analysis services
• Full-text search
Stateless
• Reporting services
Solutions SQL 2008
Fail Over Cluster instance
Solution
Level
Instance
Pros
Very low failover time No affect on the application Supported on standard edition WSFC can be used for other HA needs
Cons
Requires shared storage “Complex” AD requiredFCI
How does it work
FCI Elements
Service management Automatic control of SQL services Storage Management Clustered Disk Network ManagementFCI
How does it work
Failover Active
Active Active
Instance A Instance B Instance C
FCI What’s new in SQL2012
Multi site
support
Enhanced
health checks
Failover
policies
tempDB on
local storage
Multisite FCI
Mirroring
Mirroring
Solution
Level
DatabasePros
Synchronous or Asynchronous Automatic failover Share nothing solutionDoes not require AD
Cons
Limited access to mirror
Mirroring
How does it work
Mirroring Elements
Sync type
High safety High safety with auto failover High performanceServers
Primary Mirror Witness
Mirroring
How does it work
Log Shipping
Log Shipping
Solution
Level
Database
Pros
Multiple Copies
Delayed copy of
data
Very simple
implementation
Cons
Limited access
to copies
Client side
failover
Limited Fail
back
Physical DB Structure
Log Log file: .ldf Data file: Data file: .mdf or .ndf Extent: 8 contiguous Extent: 8 contiguous 8KB pages Page: 8KB Page: 8KBSQL Server backups
Full Backup
Transaction
log
Log shipping
How does it work
Log shipping
Elements
Servers
Primary server Secondary server Monitor ServerDatabases
Primary Database Secondary DatabaseJobs
Backup Copy Restore
Log shipping
How does it work
Log shipping
DEMO
Replication
Solution
Level
ObjectPros
High Granularity R/W copy of dataLow latency data sync
Cons
Complex
Client side failover
Requires maintenance
Affects data and structure
Transactional Replication
How does it work
Transactional Replication
Elements
Servers
Publisher Subscriber Distributor
Objects
Publication Article
Agents
Log reader Snapshot Distribution
Transactional Replication
How does it work
Transactional replication DEMO
What happens when…
•
Business requirements are:
–
Automatic failover
–
Of multiple databases together
–
With no single point of failure
–
Redundancy across
SQL Server 2008 R2 or prior
No
single
solution
Mirroring
Log shipping
Cluster
Replication
SQL Server 2012
Always ON
Availability Group
Solution
Level
Solution
Level
Availability GroupPros
Pros
Multi database solution Sync or Async
Listener Multiple secondaries Read Only secondaries
Low latency failover More..
Cons
Cons
Enterprise edition only
Requires AD
Cluster
Log shipping
Replication
A
A
A
A
SQL Server 2012
Always On Availability Groups
What happens when…
•
Business requirements are:
–
Automatic failover
–
Of multiple databases together
–
With no single point of failure
–
Redundancy across
SQL Server 2008 R2 or prior
Database mirroring provides automated failover
of a single database
Redundant copies of the database exist on
principle and mirror server
Failing over multiple databases at the same time
requires custom code
Application failover is accomplished through the
use of FailoverPartner connection string value
SQL Server 2012
Always ON AG
up to four copies of the
databases
Synchronously or
Asynchronously
Multiple-database
failover is handled
automatically by the
Availability Group
Application failover
through the Availability
Group Listener and
Application Virtual
Availability group architecture
WSFC role in AG
Inter-node health detectionFailover coordination
Primary health detection Distributed data store for
settings and state Distributed change notifications between nodes
Mixed synchronous and
asynchronous in one AG
Replaces multiple technology implementations in a single
solution
Support for up to three synchronous replicas, one primary
and two secondaries
Support for multiple Availability Groups with separate failure paths
for different applications
Architecture – availability
group failover
• Clients connect to primary replica through the Availability Group Listener virtual name
• A failover is initiated using WSFC Manager
– SQL-AG1 confirms failover and informs WSFC
– WSFC tells the AG resource DLL to bring SQL-AG1 offline
• Clients are disconnected from SQL-AG1
• WSFC tells the AG Resource DLL to bring SQL-AG2 online
– Availability Group Listener Virtual Name resource moves to SQL-AG2 and brought online by WSFC
– Clients are automatically redirected to SQL-AG2 through the Availability Group Listener virtual name
• WSFC provides notification of the new primary server to all secondary replicas
– Secondaries reconnect to the new primary replicas mirroring endpoint and synchronization resumes
A v a il a b il it y G ro u p Li st e n e r
Always ON Availability Group
DEMO
Always ON AG
Summary
SQL Server 2012 offers
higher availability and
disaster recovery
Up to four secondary replicasCombination of synchronous and asynchronous replicas
Choice of automatic or manual failover modes
SQL Server 2012 offers more
flexibility for configuring
your HA/DR topology
Ability to read from secondaryreplicas
Groups of databases can fail over together, removing need
for complex logic
Broad cross-feature support, including FILESTREAM, RBS, FILETABLE, and Service Broker
Always ON
SQL HA And Virtualization
YES
ITS OK to virtualize SQL ServerCommon
mistakes
No need for SQL HA Over sharing resources Highly complicated deploymentsFCI and
Virtualization
Supported with limitationsReduce planed downtime
Windows
Server core
Online
Operations
Rolling
Upgrade and
Patching
SQL HA and the cloud
PaaS
SQL Azure Amazon RDSIaaS
Amazon EC2 Windows AzureSaaS
Office 365 Sales ForceSQL HA and the cloud
The cloud is not
bullet proof
Planed down
time still occur
Check what site
level protection
is provided
Upgrading HA to SQL 2012
SQL
Server failover
clustering
Failover
Cluster
instance
Log
shipping
Log
shipping
Mirroring
AlwaysON
AG
Summary
Feature/Tech. Cluster Mirror Log shipping Replication Always ON AG
Automatic failover
+
+
-
-
+
Transparent client redirect
+
-
-
-
+
Scope of protection Instance DB DB Object AG
Number of database copies 1 2 Multiple Multiple Multiple
Geo scope LAN* LAN/WAN LAN/WAN LAN/WAN LAN/WAN
Shared storage required
+
-
-
-
-Database level filter
-
+
+
+
+
Object level filter
-
-
-
+
-Active / -Active
Feature/Tech. Cluster Mirror Log shipping Replication Always ON AG
Data loss potential Non Non* Medium Medium Non*
Database changes required
-
-
-
+
Summary
* In Synchronized mode (high-protection)