Oracle Dbas Deploying Highly Available SQL Server Systems: Joe Yong
Oracle Dbas Deploying Highly Available SQL Server Systems: Joe Yong
Oracle Dbas Deploying Highly Available SQL Server Systems: Joe Yong
Deploying Highly
Available
SQL Server Systems
Joe Yong
Chief Architect
Scalability Experts Inc.
jyong@scalabilityexperts.com
Non-goals
Deep dive into SQL Server
Chest thumping
Make you a HA expert
Pre-requisites
Experience as an Oracle DBA, Architect or
Developer DBA
Basic experience in designing, deployment and
managing database systems that require
medium to high levels of availability
Agenda
What is High Availability
SQL Server 2005 HA overview
Solutions to common scenarios
Case study
Summary
Agenda
What is High Availability
SQL Server 2005 HA technologies
Hot Standby
Failover Clustering
Database Mirroring
Warm Standby
Database Mirroring High Protection / Performance mode
Replication
Log Shipping
Cold Standby
Backup/restore
Online operations
Failover Cluster
* Inst1
Instances
* Inst1
Inst3 *
Inst2 *
* Inst1
Inst2 *
Geographically Dispersed
Clusters
Same functionality and behavior as standard failover
cluster
Protects against local, total and extended disasters
Requires specially certified cluster hardware from qualified
vendors
Requires guaranteed 500ms maximum round trip latency
between nodes
Site 1
Site 2
Network
SQL Server does not differentiate
between standard and
geo-cluster
N1
N2
N3
Storage Controller S2
Storage Controller S1
D1
D3
N4
Mirror
Mirror
D2
D4
Failover
Clusterin
g
With geoclusters
Limited
With geoclusters
Rapid failover
Failure detection
Automatic
switchover
Specialized
hardware
Secondary workload
on standby
(reporting)
Performance impact
Protect against
storage failure
None
Agenda
What is High Availability
SQL Server 2005 HA technologies
Hot Standby
Failover Clustering
Database Mirroring High Availability mode
Warm Standby
Database Mirroring High Protection / Performance mode
Replication
Log Shipping
Cold Standby
Backup/restore
Online operations
Database Mirroring
Database Mirroring
Overview
Hot Standby
Provides a fault-tolerant database
Building block for complex topologies
Database Failover
Very fast failover
Less than five seconds in most cases
Database Mirroring
How does it work?
Application
Mirror is always
redoing it
remains current
Witness
(optional)
Commit
Principal
Mirror
SQL Server
2
Log
>2
Data
SQL Server
3
Log
>3
Data
Database Mirroring
Witness
Database Mirroring
High Availability mode
Database Mirroring
Failover
Clusterin
g
Database
Mirroring
HA
mode
With geoclusters
Limited
With geoclusters
Rapid failover
Failure detection
Automatic
switchover
Specialized
hardware
Secondary workload
on standby
(reporting)
User DB only
None
Minimal ~
low
Performance impact
Protect against
With DB
snapshot
Agenda
What is High Availability
SQL Server 2005 HA technologies
Hot Standby
Failover Clustering
Database Mirroring High Availability mode
Warm Standby
Database Mirroring High Protection / Performance
mode
Replication
Log Shipping
Cold Standby
Backup/restore
Online operations
Database Mirroring
High Protection mode
Database Mirroring
Failover
Clusterin
g
Database
Mirroring
HA
mode
With geoclusters
Limited
With geoclusters
Rapid failover
Database
Mirroring
H P/P
mode
Failure detection
Automatic
switchover
Specialized
hardware
Secondary workload
on standby
(reporting)
User DB only
User DB only
None
Minimal ~
low
Minimal
Performance impact
Protect against
With DB
snapshot
With DB
snapshot
Agenda
What is High Availability
SQL Server 2005 HA technologies
Hot Standby
Failover Clustering
Database Mirroring High Availability mode
Warm Standby
Database Mirroring High Protection / Performance mode
Replication
Log Shipping
Cold Standby
Backup/restore
Online operations
Transactional Replication
Requires consideration at design time; cannot just
flip the switch
High performance latency measured in seconds
Some (minimal) load on the server
Can be implemented at database or table level
Failover possible; custom designed solution
Two types
Standard transactional replication
Easy to design, setup & manage
Subscriber (standby) can be used for reporting
Peer-To-Peer Transactional
Replication
How does it work?
West
East
Logreader
Agent
Dist
DB
Distribution
Agent
Logreader
Agent
South
Logreader
Agent
Dist
DB
Distribution
Agent
Dist
DB
Distribution
Agent
Failover
Clusterin
g
Database
Mirroring
HA
mode
With geoclusters
Limited
With geoclusters
Rapid failover
Database
Mirroring
H P/P
mode
Transaction
al
Replication
Failure detection
Automatic
switchover
Specialized
hardware
Secondary workload
on standby
(reporting)
User DB only
User DB only
Some
None
Minimal ~
low
Minimal
Low
Performance impact
With DB
snapshot
With DB
snapshot
Can automate
in application
Can automate
in application
Agenda
What is High Availability
SQL Server 2005 HA technologies
Hot Standby
Failover Clustering
Database Mirroring High Availability mode
Warm Standby
Database Mirroring High Protection / Performance mode
Replication
Log Shipping
Cold Standby
Backup/restore
Online operations
Log Shipping
Backup transaction log, copy to secondary
server, restore transaction log backup
Failover is manual
Meta data management may be necessary
Failover
Clusterin
g
Database
Mirroring
HA
mode
Database
Mirroring
H P/P
mode
With geoclusters
Limited
With geoclusters
Rapid failover
Transaction
Log
al
Shipping
Replication
Failure detection
Automatic
switchover
Specialized
hardware
Secondary workload
on standby
(reporting)
User DB only
User DB only
Some
User DB
only
None
Minimal ~
low
Minimal
Low
Low
Performance impact
With DB
snapshot
With DB
snapshot
Can automate
in application
Can automate
in application
Can automate
in application
With
limitations
Agenda
What is High Availability
SQL Server 2005 HA technologies
Hot Standby
Failover Clustering
Database Mirroring High Availability mode
Warm Standby
Database Mirroring High Protection / Performance mode
Replication
Log Shipping
Cold Standby
Backup/restore
Online operations
Failover
Clusterin
g
Database
Mirroring
HA
mode
Database
Mirroring
H P/P
mode
With geoclusters
Limited
With geoclusters
Rapid failover
Failure detection
Automatic
switchover
Specialized
hardware
Secondary workload
on standby
(reporting)
User DB only
User DB only
None
Minimal ~
low
Minimal
Performance impact
With DB
snapshot
With DB
snapshot
Transaction
Log
al
Shipping
Replication
Can automate
in application
Can automate
in application
Backup /
Restore
With
limitations
With
limitations
Some
User DB
only
User DB
only
Low
Low
Low
Agenda
What is High Availability
SQL Server 2005 HA technologies
Hot Standby
Failover Clustering
Database Mirroring High Availability mode
Warm Standby
Database Mirroring High Protection / Performance mode
Replication
Log Shipping
Database Snapshot
Cold Standby
Backup/restore
Online operations
Online Operations
Backup/restore
Full online backup
Online piecemeal restore; undamaged data
remains available
Indexing
Allows create, drop and alter while users
continue to access data
LOB datatype indexes not supported for online
Memory allocations
CPU affinity settings
Database snapshots
Database Snapshot
Not originally designed as a specific HA
solution but works great in some situations
Turning a Database Mirroring mirror into a
reporting server
Isolated historical data for report
generation
Protection in case of administrative,
developer or user error; classic Oops!
scenario
Uses copy-on-write technique to reduce
disk space consumption
Database Snapshot
How does it work?
10
11
12
13
14
15
16
Agenda
What is High Availability
SQL Server 2005 HA technologies
Solutions to common scenarios
Case study
Summary
Rolling Upgrades
In three steps
secondary,
or subscriber
2. Switch roles
1.
3.
2. Recover secondary
Database Mirroring
Failover to the mirror
Log Shipping
Replication
server
Solutions
Database Mirroring to a secondary site
Optimized solution - Allows very fast failover times to
the secondary site
Optionally add log shipping for additional site
protection
Database Mirroring
Configuration
In
three steps
Step 1: Restore
database copy to
mirror site with
no-recovery option
Step 2:
Configure
communication
endpoints
Step 3: Set the
data protection
level and Start
Mirroring
Solutions
Transactional Replication
Peer-to-Peer Replication
Replication
Local server
redundancy
Full server/instance
protection
Database
Scale Out
For Queries
Database Mirroring
Primary disaster site
for databases
Reporting with
Snapshot
Failover
Log Shipping
Additional disaster
sites for databases
Logical recovery
(with delay)
Replication
Database reporting
and read scale out
with redundancy
Clustering
Production
Database
Database Mirroring
Hot
Standby
Log Shipping
Warm
Standby
Log Shipping
With Restore Delay
Logical
Recovery
Standby
Agenda
What is High Availability
SQL Server 2005 HA technologies
Solutions to common scenarios
Summary
Summary
<<WiP>>
Resources
www.microsoft.com/sql/
msdn.microsoft.com/sqlserver/
www.microsoft.com/technet/
www.scalabilityexperts.com
www.sqldev.net
www.sqlservercentral.com/
Failover
Clusterin
g
Database
Mirroring
HA
mode
Database
Mirroring
H P/P
mode
With geoclusters
Limited
With geoclusters
Rapid failover
Failure detection
Automatic
switchover
Specialized
hardware
Secondary workload
on standby
(reporting)
User DB only
User DB only
None
Minimal ~
low
Minimal
Performance impact
With DB
snapshot
With DB
snapshot
Transaction
Log
al
Shipping
Replication
Can automate
in application
Can automate
in application
Backup /
Restore
With
limitations
With
limitations
Some
User DB
only
User DB
only
Low
Low
Low