Professional Documents
Culture Documents
High Availability
Craig Ryan
National Manager Database Services
! How much Availability do you need?
! SQL 2000 High Availability Options
! Log Shipping, Replication, Clustering
! Demo ± SQL 2000 H.A Options
! New HA options in SQL 2005
! Database Mirroring
! Demo ± SQL 2005 Database Mirroring
?
Need to ask yourself:
! How long can we afford to be down?
! How much data can we afford to lose?
Availability = up/(up+down)
opy Job
á
SQL 2000 Log Shipping
Replication
! Failover possible; a custom
solution
! Not limited to entire database; Can
define subset of source database
or tables
! Copy of database is continuously
accessible for read activity
! Latency between source and copy
can be as low as seconds
! Significantly increases the on-
going Database management
! Database schema may need to be
changed
á
SQL 2000 Transactional Replication
Failover Cluster
c
SQL Server
Virtual
Server A Server Server B
Heartbeat
Cluster management
E F G
C,D C,D
SQL Server
c c
Client Cs
SQL Server
Virtual
Server A Server Server B
Heartbeat
Cluster management
E F G
C,D C,D
SQL Server
]
! Clustering is not a mechanism to scale
! Doesn¶t protect your server against site
outage
! Doesn¶t protect your disk subsystem
! Doesn¶t protect against database
corruption
! Doesn¶t protect against logical corruption
! Doesn¶t protect against user error
!
! Clustering is not a method to load-balance
c c
! Instant Standby
! Conceptually a fault-tolerant server
! Database Failover
! Very Fast « less than three seconds
! Zero data loss
! Automatic or manual failover
! Automatic re-sync after failover
! Automatic, transparent client redirect
Database Mirroring
á
! Hardware
! Works with standard computers,
storage, and networks
! No shared storage components,
virtually no distance limitations
! Impact to transaction throughput
! Zero to minimal, depending on
environment / workload
á
?
Mirror is always
Application Witness redoing ± it
remains current
Commit
rincipal Mirror
1 5
2
SQL Server SQL Server
2 >2 4 3 >3
! Witness is an instance of
SQL Server 2005
! Single witness for multiple sessions
! Consumes very little resources
! Not a single point of failure
! partners can form quorum on their own
c
! There is a trade-off between
performance and safety
! Database Mirroring has two safety
levels
! FULL ± commit when logged on Mirror
! Allows automatic failover
! No data loss
! OFF ± commit when logged on principal
! System does its best to keep up
! prevents failover; to make mirror available
! Must µforce¶ service
! Or terminate Database Mirroring session
! No changes to application code
! Client automatically redirected if
session is dropped
! Client library is aware of principal and
Mirror servers
! Upon initial connect to principal, library
caches Mirror name
! When client attempts to reconnect
! If principal is available, connects
! If not, client library automatically redirects
connection to Mirror
á
c
c
1. Ensure SQL 2005 is installed on both the
principle & the mirror Server
2. Setup Security (Endpoints)
3. prepare the mirror database
4. Setup & Start the database mirroring session
5. Optionally add a witness
á
SQL 2005 Database Mirroring
ác á
! SYNCHRONIZING
! SYNCHRONIZED
! SUSpENDED
! pENDING_FAILOVER
! DISCONNECTED
! Automatic Failover requires the following
conditions:
! Database mirroring running in synchronous mode
! The database must be in a synchronised state
! A witness must exist
! During Failover the following actions occur:
! The witness & mirror server agree the primary is dead,
which puts the database into a suspend state
! If possible the database on the primary server changes
to a disconnected state
! The mirror finishes rolling forward and records the LSN
! The mirror database comes online
! When the principle returns, it becomes the mirror
c
Craig Ryan
National Manager Database Services
cryan@sdg.com.au
Andrew Gannon
Business Development Manager
agannon@sdg.com.au
(03) 9427-1477