SlideShare a Scribd company logo
TECHNET LIVE MEETING
High Availability Solutions in SQL Server 2012
Pieter Vanhove
WHO AM I
•   Pieter Vanhove
•   SQL Server Database Consultant at Kohera
•   MCTS, MCITP Database Administrator 2008
•   Love to work with SQL HA/DR solutions
•   E-mail: pieter.vanhove@kohera.be
•   Twitter: http://twitter.com/#!/Pieter_Vanhove
•   Blog: http://blogs.sqlug.be/pieter/
•   MEET: http://www.microsoft.com/belux/meet/#Pieter+Vanhove
AGENDA
• What is High Availability
  •   Planned vs. Unplanned downtime
  •   Degraded Availability
  •   Recovery Objectives
  •   Justifying Opportunity Costs
• SQL Server AlwaysOn
  • AlwaysOn Failover Cluster Instance
  • AlwaysOn Availability Group
• Database Mirroring
• Log Shipping
• Compare the different solutions
PLANNED VS UNPLANNED DOWNTIME
• Planned maintenance.
  • A time window is preannounced and coordinated for planned maintenance
    o   Software patching
    o   Hardware upgrades
    o   Password updates
    o   Offline re-indexing
    o   Data loading
    o   Rehearsal of disaster recovery procedures
• Unplanned outage
  • System-level, infrastructure, or process failures may occur that are unplanned or
    uncontrollable
  • A robust high availability solution
    o Detects these types of failures
    o Automatically recovers from the outage
    o Reestablishes fault tolerance.
DEGRADED AVAILABILITY


• Read-only and deferred operation

• Data latency and application responsiveness

• Partial, transient, or impending failures
RECOVERY OBJECTIVES
• Recovery Time Objective (RTO)
  • This is the duration of the outage. The primary goal is to restore full service to
    the point that new transactions can take place



• Recovery Point Objective (RPO)
  • A measure of acceptable data loss
  • It is the time gap or latency between the last committed data transaction before
    the failure and the most recent data recovered after the failure
JUSTIFYING OPPORTUNITY COSTS
• Avoiding downtime
  • Outage recovery costs are avoided all together if an outage doesn’t occur in the first
    place
  • Investments include
    o The cost of fault-tolerant and redundant hardware or infrastructure
    o Distributing workloads across isolated points of failure
    o Planned downtime for preventive maintenance
• Automating recovery
  • If a system failure occurs, you can greatly mitigate the impact of downtime on the
    customer experience through automatic and transparent recovery
• Resource utilization
  • Secondary or standby infrastructure can sit idle, awaiting an outage
  • It can be leveraged for read-only workloads
  • To improve overall system performance by distributing workloads across all available
    hardware
ALWAYSON FAILOVER CLUSTER
WHAT IS FAILOVER
CLUSTER INSTANCE                                               Client PCs


                                        Public Network




                                  San Mirroring

                                                                       Server B (Passive)
        Server A (Active)      Virtual SQL Server Instance




                                      Virtual Windows Server


                            Storage                              Shared Storage             Storage
WHAT IS A FAILOVER
                                                        Client PCs


                                 Public Network




       Server A Passive
                Active    Virtual SQL Server Instance          Server B Passive

                                                                                     Switch storage
                                                                                      manually
                                                                                     DNS change
                              Virtual Windows Server                                 Attach/Detach
                                                                                      databases
                                                                                     Recreation jobs
                                                          Shared Storage
CLUSTER TYPE: ACTIVE/PASSIVE
                                                       Client PCs


                                Public Network




       Server A Active   Virtual SQL Server Instance          Server B Passive




                             Virtual Windows Server


                                                         Shared Storage
CLUSTER TYPE ACTIVE/ACTIVE
                                                  Client PCs


                           Public Network




       Server A Active                                   Server B Active




                         Virtual Windows Server


                                                    Shared Storage
CLUSTER TYPE: ACTIVE/ACTIVE N + 1
                         Public Network




       Server A Active                            Server B Active




                         Server C   Passive




                                              Shared Storage
BENEFITS OF FAILOVER CLUSTER INSTANCE
• Protection at the instance level through redundancy

• Automatic failover in the event of a failure

• Support for a broad array of storage solutions

• Disaster recovery solution using a multi-subnet FCI

• Zero reconfiguration of applications and clients during failovers
ALWAYSON AVAILABILITY GROUPS
WHAT ARE ALWAYSON AVAILABILITY GROUPS
• HA and DR solution that provides an alternative to database mirroring

• A container for a discrete set of user databases that fail over together

• Multiple possible failover targets

• Secondary replicas support read-only access


    An availability group fails over at the level of an availability replica.
    Failovers are not caused by database issues
TERMS AND DEFINITIONS
• Primary database
  • The read-write copy of an availability database
• Secondary database
  • A read-only copy of an availability database
• Primary replica
  • The availability replica that makes the primary databases available for read-write
    connections
  • Sends transaction log records for each primary database to every secondary replica
• Secondary replica
  • An availability replica that maintains a secondary copy of each availability database
  • Serves as a potential failover targets for the availability group
• Availability group listener
  • A server name to which clients can connect in order to access a database in a
    primary or secondary replica of an AlwaysOn availability group
SYNCHRONOUS COMMIT MODE




    1 Commit            7 Acknowledge
                                    6 Acknowledge
                                                           Constantly
                                                           Redoing on
                                                           Replica

                            2 Transmit to
       2 Write              Replica
      to Local         3 Committed      4 Write to
          Log          in Log        Remote Log
                                                       5

      DB         Log                                 Log          DB
ASYNCHRONOUS COMMIT MODE




     1                  4 Acknowledge
     Commit                         7 Acknowledge
                                                           Constantly
                                                           Redoing on
                                                           Replica

                            2 Transmit to
       2 Write              Replica
      to Local         3 Committed      5 Write to
          Log          in Log        Remote Log
                                                       6

      DB         Log                                 Log          DB
FAILOVER TYPES


    - DBA issues a      - Response to a       - DBA issues a
      manual-failover     failure               forced-failover
      command                                   command
                        - Primary 
    - Primary           Secondary           - Primary 
      Secondary                                 Secondary
                        - Synchronous-
    - Synchronous-        commit mode+        - Asynchronous-
      commit mode         failover mode set     commit mode
                          to “Automatic”
    - Replica must be                         - Replica is not
      synchronized      - Replica must be       synchronized
                          synchronized
READ-ONLY ACCESS ON SECONDARY

• You can configure read-only access to the availability replica.

• Allows you to offload you read-only workloads from your primary
  replica

• Optimizes resources on your primary replica for your mission critial
  workloads
POSSIBLE SETUP
BENEFITS ALWAYSON AVAILABILITY GROUPS
• Supports one primary replica and up to four secondary replicas
• Supports Asynchronous-commit mode and Synchronous-commit
  mode
• Read-Only access to the secondary databases
• Performing backup operations on secondary databases
• Provide fast application failover
• Flexible Failover Policy
• Automatic page repair
• Supports Encryption and Compression
• Provides an integrated set of tools
PREPARATION

• Install WSFC on each machine and create a single WSFC cluster

• Install SQL Server Instances on each machine

• Enable AlwaysOn through SQL Configuration Manager

• (CREATE ENDPOINT on each instance)
DATABASE MIRRORING
DATABASE MIRRORING
TERMS AND DEFINITIONS
• Principal Server
  • Principal server is the server which clients connect to and perform their updates to
    the database
• Mirror Server
  • Mirror server is performing the same changes on the mirrored database
• Witness server
  • The witness server monitors the status of the principal and mirror servers
  • The witness does NOT trigger the failover, just helps provide “quorum”
• Quorum
  • In the event of one of the principal becoming unavailable, the mirror can only
    failover if it can still see the witness, and the witness agrees it cannot see the
    principal
  • If the mirror fails, principal can only continue if it still sees the witness
OPERATING MODES

    High Availability            High Protection              High Performance

   Automatic Detection         No Automatic                No Automatic
   Automatic Failover           Detection                    Detection

   Uses synchronous            Manual Failover             Manual Failover
    form of mirroring           Uses synchronous form       Uses asynchronous
   Requires Witness             of mirroring                 form of mirroring

   Principal performance       Does not require            Does not require
    is affected by network       Witness                      Witness
    speed and distance          Principal performance       Principal performance
                                 is affected by network       is NOT affected by
                                 speed and distance           network speed and
                                                              distance
SETUP REQUIREMENTS
• Both the principal and mirror servers must have SQL 2005 + installed

• Both the principal and mirror servers must have space to hold the
  database

• For automatic failover, the witness server also must have SQL Server
  2005+ installed

• Witness can be any edition, even SQL Server Express

• The principal database must use the Full recovery model

• The mirror database must be “prepared”
FAILURE DETECTION
• SQL Server
  • Ping each other once a second
  • By default if 10 “pings” are missed, then declare a failure
• Outside SQL Server
  •   Operating System
  •   Network errors
  •   IO errors
  •   Process errors
• Failover speed determined by:
  • Failure type
  • REDO queue on the mirror
BENEFITS DATABASE MIRRORING
• Increases availability of a database.
  • High-safety mode with automatic failover, failover quickly brings the standby copy of
    the database online (without data loss)

• Increases data protection.
  • Database mirroring provides complete or almost complete redundancy of the data
  • Mirroring partner running on SQL Server 2008 Enterprise or later versions
    automatically tries to resolve certain types of errors that prevent reading a data
    page. Automatic Page Repair


• Improves the availability of the production database during upgrades.
  • To minimize downtime, you can sequentially upgrade the instances of SQL Server
  • Rolling upgrade
DATABASE MIRRORING DEPRECATED




   This feature will be removed in a future version of Microsoft SQL
   Server. Avoid using this feature in new development work, and
   plan to modify applications that currently use this feature. Use
   AlwaysOn Availability Groups instead.
LOG SHIPPING
LOG SHIPPING
TERMS AND DEFINITIONS
• Primary database
  • The database on the primary server that you want to back up to another server.


• Secondary database
  • The warm standby copy of the primary database.
    o Restoring state
    o Standby state


• Monitor server
  • When the transaction log on the primary database was last backed up.
  • When the secondary servers last copied and restored the backup files.
  • Information about any backup failure alerts.
TERMS AND DEFINITIONS
• Backup job
  • Performs the backup operation
  • Logs history to the local server and the monitor server
  • Deletes old backup files and history information
• Copy job
  • Copies the backup files from the primary server to a configurable destination on the
    secondary server
  • Logs history on the secondary server and the monitor server.
• Restore job
  • Restores the copied backup files to the secondary databases.
  • Logs history on the local server and the monitor server
  • Deletes old files and old history information.
• Alert job
  • Raises alerts for primary and secondary databases when a backup or restore
    operation does not complete successfully within a specified threshold.
LOG SHIPPING CONCEPT




                              Monitor Database
                                   Server




               Log shipping                      Log shipping
Primary Database                                                Secondary Database
     Server                                                           Server
                                Backup Share
                                                                   Restore Job
  Backup Job
FAIL OVER TO A LOG SHIPPING SECONDARY
1.   Copy any uncopied backup files from the backup share to the copy
     destination folder of each secondary server.
2.   Apply any unapplied transaction log backups in sequence to each
     secondary database.
3.   If the primary database is accessible, back up the active transaction
     log and apply the log backup to the secondary databases.
4.   After the secondary servers are synchronized, you can fail over to
     whichever one you prefer by recovering its secondary database and
     redirecting clients to that server instance. Recovering puts the
     database into a consistent state and brings it online.
COMPARE SOLUTIONS
COMPARING FAILOVER
    Failover      Availability      Database
                                                    Log Shipping
   clustering      Groups           Mirroring
• SQL Server    • Database       • Database        • Database
  Instance        Group          • Manual or       • Manual
• Automated     • Manual or        automated       • Based on
• Within          automated      • Few seconds       configuration
  minutes       • Few seconds      to minutes      • Forced
• No              to minutes     • Application       application
  application   • No               redirection       redirection
  redirection     Application      required (can     required
  required        redirection      be
                  required         automated)
COMPARING SECONDARY SERVER
     Failover            Availability        Database
                                                                   Log Shipping
    clustering            Groups             Mirroring
•   Instance         •   Database        •   Database          •   Database
•   Multiple nodes   •   Up to 4         •   Principal and     •   Multiple
•   Server in same       Secondary           Mirror                secondary
    LAN                  Replica’s       •   Span across           nodes
•   Hot standby      •   Span across         WAN               •   Span across
    server               WAN             •   Hot standby           WAN
•   Available for    •   Hot standby     •   Not available     •   Warm standby
    use              •   Available for       for use           •   Available for
•   Shared storage       use             •   Storage need          use
•   Status check     •   Storage need        not be shared     •   Storage need
    using                not be shared   •   No status check       not be shared
    Heartbeat        •   Status check        unless using      •   No status
                         WFC                 witness               checking
COMPARING
    Failover           Availability        Database
                                                             Log Shipping
   clustering           Groups             Mirroring
• All instance      • Configured        • Configured        • Configured
  databases are       database is         database is         database logs
  shared              mirrored or         mirrored            are applied
• Loss limited to     readable          • Loss limited to   • Loss limited to
  last hardened     • Loss limited to     last mirrored       last applied
  record              last mirrored       transaction         transaction
• No data copy        transaction       • Synchronous         log backup
  across            • Synchronous         or                • Transaction
  network             or                  Asynchronous        log
                      Asynchronous        mirroring           Backup, Copy
                      commit mode                             and Restore
COMPARING
   Failover        Availability     Database
                                                    Log Shipping
  clustering        Groups          Mirroring
• Network        • Network        • Network        • Network
  connectivity     latency to       latency to       latency to
  needs to         meet I/U/D       meet I/U/D       meet RTO
  meet             SLA’s            SLA’s          • Transaction
  heartbeat      • Data is        • Data is          Log file
  requirements     transferred      transferred      records
• Data is not      over network     over network     transferred
  transferred                                        over network
  over network
WRAP UP
• What is High Availability
  •   Planned vs. Unplanned downtime
  •   Degraded Availability
  •   Recovery Objectives
  •   Justifying Opportunity Costs
• SQL Server AlwaysOn
  • AlwaysOn Failover Cluster Instance
  • AlwaysOn Availability Group
• Database Mirroring
• Log Shipping
• Compare the different solutions
RESOURCES
• AlwaysOn Team Blog
  • http://blogs.msdn.com/b/sqlalwayson/


• SQL Server 2012 Whitepapers
  • http://msdn.microsoft.com/en-us/library/hh403491


• MSDN – SQL Server High Availability Solutions
  • http://msdn.microsoft.com/en-
    us/library/ms190202.aspx#RecommendedSolutions
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
    conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
                                        MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

PPTX
Drop the Pressure on your Production Server
PPTX
Sql server 2012 ha and dr sql saturday dc
PDF
21.10.09 Microsoft Event, Microsoft Presentation
PPTX
Windows Server Virtualization - Hyper-V 2008 R2
PPTX
Always On - Wydajność i bezpieczeństwo naszych danych - High Availability SQL...
PPTX
Xen and Apache cloudstack
PPTX
Windows server 2012 failover clustering new features
PPTX
Xen Project Update LinuxCon Brazil
Drop the Pressure on your Production Server
Sql server 2012 ha and dr sql saturday dc
21.10.09 Microsoft Event, Microsoft Presentation
Windows Server Virtualization - Hyper-V 2008 R2
Always On - Wydajność i bezpieczeństwo naszych danych - High Availability SQL...
Xen and Apache cloudstack
Windows server 2012 failover clustering new features
Xen Project Update LinuxCon Brazil

What's hot (20)

PPTX
Xen in the Cloud at SCALE 10x
PPTX
Improvements in Failover Clustering in Windows Server 2012
PDF
TechNet Live spor 1 sesjon 6 - more vdi
PPTX
Virtualization in the Cloud @ Build a Cloud Day SFO May 2012
PPTX
Hyper V R2 Deep Dive
PDF
XCP: The Art of Open Virtualization for the Enterprise and the Cloud
PPTX
Xen cloud platform v1.1 (given at Build a Cloud Day in Antwerp)
PDF
Xen Cloud Platform at Build a Cloud Day at SCALE 10x
PPSX
Cvc2009 Moscow Xd3 Fabian Kienle Final
PDF
Cax Osoft12 5r Garanta Continuidade Nos Negocios
PDF
What is new in Citrix xen Client
PPSX
Windows Server 2012 - Dynamische opslag met Storage Pools
PDF
XS Boston 2008 Memory Overcommit
PDF
Virtualization Smackdown
PPTX
Building Business Continuity Solutions With Hyper V
PPTX
Xen cloud platform
PDF
Xen PV Performance Status and Optimization Opportunities
PDF
What’s New in vCloud Director 5.1?
PPTX
Branch repeater technical training presentation 26 oct-12
Xen in the Cloud at SCALE 10x
Improvements in Failover Clustering in Windows Server 2012
TechNet Live spor 1 sesjon 6 - more vdi
Virtualization in the Cloud @ Build a Cloud Day SFO May 2012
Hyper V R2 Deep Dive
XCP: The Art of Open Virtualization for the Enterprise and the Cloud
Xen cloud platform v1.1 (given at Build a Cloud Day in Antwerp)
Xen Cloud Platform at Build a Cloud Day at SCALE 10x
Cvc2009 Moscow Xd3 Fabian Kienle Final
Cax Osoft12 5r Garanta Continuidade Nos Negocios
What is new in Citrix xen Client
Windows Server 2012 - Dynamische opslag met Storage Pools
XS Boston 2008 Memory Overcommit
Virtualization Smackdown
Building Business Continuity Solutions With Hyper V
Xen cloud platform
Xen PV Performance Status and Optimization Opportunities
What’s New in vCloud Director 5.1?
Branch repeater technical training presentation 26 oct-12
Ad

Viewers also liked (20)

PPTX
Windows clustering and quorum basics
PDF
SQL Server Clustering for Dummies
PDF
Introduction to failover clustering with sql server
PPT
SQL Server Cluster Presentation
PDF
SQL Server Clustering and High Availability
PPTX
BPC: Do you have the right design?
PPT
Friday new alliances
PPT
Rethinking tax friday
PPTX
Wed thurs reform
PPTX
2015 day 10
PPTX
City bogota
PDF
SAFECode’s latest “Software Security Guidance for Agile Practitioners” White...
 
PDF
Pastís de xocolata rita i judit
PPTX
Fri lenin and trotsky
PDF
Mit2 092 f09_lec23
PPTX
Planning shooting
PDF
Museo memoria y tolerancia
PDF
13 tipos de_memoria
PDF
4 Ms of Big Data: Make Me More Money – Infographic
 
PPTX
Third lesson
Windows clustering and quorum basics
SQL Server Clustering for Dummies
Introduction to failover clustering with sql server
SQL Server Cluster Presentation
SQL Server Clustering and High Availability
BPC: Do you have the right design?
Friday new alliances
Rethinking tax friday
Wed thurs reform
2015 day 10
City bogota
SAFECode’s latest “Software Security Guidance for Agile Practitioners” White...
 
Pastís de xocolata rita i judit
Fri lenin and trotsky
Mit2 092 f09_lec23
Planning shooting
Museo memoria y tolerancia
13 tipos de_memoria
4 Ms of Big Data: Make Me More Money – Infographic
 
Third lesson
Ad

Similar to High Availability Solutions in SQL 2012 (20)

PPTX
Sql server 2012 ha and dr sql saturday boston
PPTX
Sql Server 2012 HA and DR -- SQL Saturday Richmond
PPTX
Sql server 2012 ha and dr sql saturday tampa
PPTX
SQL 2012 AlwaysOn Availability Groups (AOAGs) for SharePoint Farms - Norcall ...
PPTX
Sql Server High Availability & DR Technologies
PPTX
Sql server 2012 - always on deep dive - bob duffy
PPTX
AlwaysON Basics
PPTX
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...
PPTX
Sql 2012 always on
PPTX
SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 - AUSPC2012
PPTX
SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013
PPTX
Sp2010 high availlability_sql
PPTX
Disaster recovery in sql server
PPTX
Lync Server 2010: High Availability [I3004]
PPSX
Exchange 2010 ha ctd
PPTX
Sql server 2012 ha dr 24_hop_final
PDF
CloudStack Best Practice in PPTV
PDF
Workload Optimization
PPTX
Configuring and Using the New Virtualization Features in Windows Server 2012
PPTX
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha and dr sql saturday boston
Sql Server 2012 HA and DR -- SQL Saturday Richmond
Sql server 2012 ha and dr sql saturday tampa
SQL 2012 AlwaysOn Availability Groups (AOAGs) for SharePoint Farms - Norcall ...
Sql Server High Availability & DR Technologies
Sql server 2012 - always on deep dive - bob duffy
AlwaysON Basics
SQL 2012 AlwaysOn Availability Groups for SharePoint 2013 - SharePoint Connec...
Sql 2012 always on
SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 - AUSPC2012
SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013
Sp2010 high availlability_sql
Disaster recovery in sql server
Lync Server 2010: High Availability [I3004]
Exchange 2010 ha ctd
Sql server 2012 ha dr 24_hop_final
CloudStack Best Practice in PPTV
Workload Optimization
Configuring and Using the New Virtualization Features in Windows Server 2012
Sql server 2012 ha dr 24_hop_final

More from Microsoft TechNet - Belgium and Luxembourg (20)

PDF
Windows 10: all you need to know!
PDF
Configuration Manager 2012 – Compliance Settings 101 - Tim de Keukelaere
PDF
PPTX
So you’ve successfully installed SCOM… Now what.
PPTX
PPTX
Deploying and managing ConfigMgr Clients
PPTX
Self Service BI anno 2013 – Where Do We Come From and Where Are We Going?
PPTX
Hands on with Hyper-V Clustering Maintenance Mode & Cluster Aware Updating
PPTX
SCEP 2012 inside SCCM 2012
PPTX
Jump start your application monitoring with APM
PPTX
What’s new in Lync Server 2013: Persistent Chat
PPTX
What's new for Lync 2013 Clients & Devices
PPTX
Office 365 ProPlus: Click-to-run deployment and management
PPTX
Office 365 Identity Management options
PPTX
SharePoint Installation and Upgrade: Untangling Your Options
PPTX
The application model in real life
PPTX
Microsoft private cloud with Cisco and Netapp - Flexpod solution
PPTX
Managing Windows RT devices in the Enterprise
PPTX
Moving from Device Centric to a User Centric Management
PPTX
Network Management in System Center 2012 SP1 - VMM
Windows 10: all you need to know!
Configuration Manager 2012 – Compliance Settings 101 - Tim de Keukelaere
So you’ve successfully installed SCOM… Now what.
Deploying and managing ConfigMgr Clients
Self Service BI anno 2013 – Where Do We Come From and Where Are We Going?
Hands on with Hyper-V Clustering Maintenance Mode & Cluster Aware Updating
SCEP 2012 inside SCCM 2012
Jump start your application monitoring with APM
What’s new in Lync Server 2013: Persistent Chat
What's new for Lync 2013 Clients & Devices
Office 365 ProPlus: Click-to-run deployment and management
Office 365 Identity Management options
SharePoint Installation and Upgrade: Untangling Your Options
The application model in real life
Microsoft private cloud with Cisco and Netapp - Flexpod solution
Managing Windows RT devices in the Enterprise
Moving from Device Centric to a User Centric Management
Network Management in System Center 2012 SP1 - VMM

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Empathic Computing: Creating Shared Understanding
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
MIND Revenue Release Quarter 2 2025 Press Release
Encapsulation_ Review paper, used for researhc scholars
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Empathic Computing: Creating Shared Understanding
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
Review of recent advances in non-invasive hemoglobin estimation
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

High Availability Solutions in SQL 2012

  • 1. TECHNET LIVE MEETING High Availability Solutions in SQL Server 2012 Pieter Vanhove
  • 2. WHO AM I • Pieter Vanhove • SQL Server Database Consultant at Kohera • MCTS, MCITP Database Administrator 2008 • Love to work with SQL HA/DR solutions • E-mail: pieter.vanhove@kohera.be • Twitter: http://twitter.com/#!/Pieter_Vanhove • Blog: http://blogs.sqlug.be/pieter/ • MEET: http://www.microsoft.com/belux/meet/#Pieter+Vanhove
  • 3. AGENDA • What is High Availability • Planned vs. Unplanned downtime • Degraded Availability • Recovery Objectives • Justifying Opportunity Costs • SQL Server AlwaysOn • AlwaysOn Failover Cluster Instance • AlwaysOn Availability Group • Database Mirroring • Log Shipping • Compare the different solutions
  • 4. PLANNED VS UNPLANNED DOWNTIME • Planned maintenance. • A time window is preannounced and coordinated for planned maintenance o Software patching o Hardware upgrades o Password updates o Offline re-indexing o Data loading o Rehearsal of disaster recovery procedures • Unplanned outage • System-level, infrastructure, or process failures may occur that are unplanned or uncontrollable • A robust high availability solution o Detects these types of failures o Automatically recovers from the outage o Reestablishes fault tolerance.
  • 5. DEGRADED AVAILABILITY • Read-only and deferred operation • Data latency and application responsiveness • Partial, transient, or impending failures
  • 6. RECOVERY OBJECTIVES • Recovery Time Objective (RTO) • This is the duration of the outage. The primary goal is to restore full service to the point that new transactions can take place • Recovery Point Objective (RPO) • A measure of acceptable data loss • It is the time gap or latency between the last committed data transaction before the failure and the most recent data recovered after the failure
  • 7. JUSTIFYING OPPORTUNITY COSTS • Avoiding downtime • Outage recovery costs are avoided all together if an outage doesn’t occur in the first place • Investments include o The cost of fault-tolerant and redundant hardware or infrastructure o Distributing workloads across isolated points of failure o Planned downtime for preventive maintenance • Automating recovery • If a system failure occurs, you can greatly mitigate the impact of downtime on the customer experience through automatic and transparent recovery • Resource utilization • Secondary or standby infrastructure can sit idle, awaiting an outage • It can be leveraged for read-only workloads • To improve overall system performance by distributing workloads across all available hardware
  • 9. WHAT IS FAILOVER CLUSTER INSTANCE Client PCs Public Network San Mirroring Server B (Passive) Server A (Active) Virtual SQL Server Instance Virtual Windows Server Storage Shared Storage Storage
  • 10. WHAT IS A FAILOVER Client PCs Public Network Server A Passive Active Virtual SQL Server Instance Server B Passive  Switch storage manually  DNS change Virtual Windows Server  Attach/Detach databases  Recreation jobs Shared Storage
  • 11. CLUSTER TYPE: ACTIVE/PASSIVE Client PCs Public Network Server A Active Virtual SQL Server Instance Server B Passive Virtual Windows Server Shared Storage
  • 12. CLUSTER TYPE ACTIVE/ACTIVE Client PCs Public Network Server A Active Server B Active Virtual Windows Server Shared Storage
  • 13. CLUSTER TYPE: ACTIVE/ACTIVE N + 1 Public Network Server A Active Server B Active Server C Passive Shared Storage
  • 14. BENEFITS OF FAILOVER CLUSTER INSTANCE • Protection at the instance level through redundancy • Automatic failover in the event of a failure • Support for a broad array of storage solutions • Disaster recovery solution using a multi-subnet FCI • Zero reconfiguration of applications and clients during failovers
  • 16. WHAT ARE ALWAYSON AVAILABILITY GROUPS • HA and DR solution that provides an alternative to database mirroring • A container for a discrete set of user databases that fail over together • Multiple possible failover targets • Secondary replicas support read-only access An availability group fails over at the level of an availability replica. Failovers are not caused by database issues
  • 17. TERMS AND DEFINITIONS • Primary database • The read-write copy of an availability database • Secondary database • A read-only copy of an availability database • Primary replica • The availability replica that makes the primary databases available for read-write connections • Sends transaction log records for each primary database to every secondary replica • Secondary replica • An availability replica that maintains a secondary copy of each availability database • Serves as a potential failover targets for the availability group • Availability group listener • A server name to which clients can connect in order to access a database in a primary or secondary replica of an AlwaysOn availability group
  • 18. SYNCHRONOUS COMMIT MODE 1 Commit 7 Acknowledge 6 Acknowledge Constantly Redoing on Replica 2 Transmit to 2 Write Replica to Local 3 Committed 4 Write to Log in Log Remote Log 5 DB Log Log DB
  • 19. ASYNCHRONOUS COMMIT MODE 1 4 Acknowledge Commit 7 Acknowledge Constantly Redoing on Replica 2 Transmit to 2 Write Replica to Local 3 Committed 5 Write to Log in Log Remote Log 6 DB Log Log DB
  • 20. FAILOVER TYPES - DBA issues a - Response to a - DBA issues a manual-failover failure forced-failover command command - Primary  - Primary  Secondary - Primary  Secondary Secondary - Synchronous- - Synchronous- commit mode+ - Asynchronous- commit mode failover mode set commit mode to “Automatic” - Replica must be - Replica is not synchronized - Replica must be synchronized synchronized
  • 21. READ-ONLY ACCESS ON SECONDARY • You can configure read-only access to the availability replica. • Allows you to offload you read-only workloads from your primary replica • Optimizes resources on your primary replica for your mission critial workloads
  • 23. BENEFITS ALWAYSON AVAILABILITY GROUPS • Supports one primary replica and up to four secondary replicas • Supports Asynchronous-commit mode and Synchronous-commit mode • Read-Only access to the secondary databases • Performing backup operations on secondary databases • Provide fast application failover • Flexible Failover Policy • Automatic page repair • Supports Encryption and Compression • Provides an integrated set of tools
  • 24. PREPARATION • Install WSFC on each machine and create a single WSFC cluster • Install SQL Server Instances on each machine • Enable AlwaysOn through SQL Configuration Manager • (CREATE ENDPOINT on each instance)
  • 27. TERMS AND DEFINITIONS • Principal Server • Principal server is the server which clients connect to and perform their updates to the database • Mirror Server • Mirror server is performing the same changes on the mirrored database • Witness server • The witness server monitors the status of the principal and mirror servers • The witness does NOT trigger the failover, just helps provide “quorum” • Quorum • In the event of one of the principal becoming unavailable, the mirror can only failover if it can still see the witness, and the witness agrees it cannot see the principal • If the mirror fails, principal can only continue if it still sees the witness
  • 28. OPERATING MODES High Availability High Protection High Performance  Automatic Detection  No Automatic  No Automatic  Automatic Failover Detection Detection  Uses synchronous  Manual Failover  Manual Failover form of mirroring  Uses synchronous form  Uses asynchronous  Requires Witness of mirroring form of mirroring  Principal performance  Does not require  Does not require is affected by network Witness Witness speed and distance  Principal performance  Principal performance is affected by network is NOT affected by speed and distance network speed and distance
  • 29. SETUP REQUIREMENTS • Both the principal and mirror servers must have SQL 2005 + installed • Both the principal and mirror servers must have space to hold the database • For automatic failover, the witness server also must have SQL Server 2005+ installed • Witness can be any edition, even SQL Server Express • The principal database must use the Full recovery model • The mirror database must be “prepared”
  • 30. FAILURE DETECTION • SQL Server • Ping each other once a second • By default if 10 “pings” are missed, then declare a failure • Outside SQL Server • Operating System • Network errors • IO errors • Process errors • Failover speed determined by: • Failure type • REDO queue on the mirror
  • 31. BENEFITS DATABASE MIRRORING • Increases availability of a database. • High-safety mode with automatic failover, failover quickly brings the standby copy of the database online (without data loss) • Increases data protection. • Database mirroring provides complete or almost complete redundancy of the data • Mirroring partner running on SQL Server 2008 Enterprise or later versions automatically tries to resolve certain types of errors that prevent reading a data page. Automatic Page Repair • Improves the availability of the production database during upgrades. • To minimize downtime, you can sequentially upgrade the instances of SQL Server • Rolling upgrade
  • 32. DATABASE MIRRORING DEPRECATED This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use AlwaysOn Availability Groups instead.
  • 35. TERMS AND DEFINITIONS • Primary database • The database on the primary server that you want to back up to another server. • Secondary database • The warm standby copy of the primary database. o Restoring state o Standby state • Monitor server • When the transaction log on the primary database was last backed up. • When the secondary servers last copied and restored the backup files. • Information about any backup failure alerts.
  • 36. TERMS AND DEFINITIONS • Backup job • Performs the backup operation • Logs history to the local server and the monitor server • Deletes old backup files and history information • Copy job • Copies the backup files from the primary server to a configurable destination on the secondary server • Logs history on the secondary server and the monitor server. • Restore job • Restores the copied backup files to the secondary databases. • Logs history on the local server and the monitor server • Deletes old files and old history information. • Alert job • Raises alerts for primary and secondary databases when a backup or restore operation does not complete successfully within a specified threshold.
  • 37. LOG SHIPPING CONCEPT Monitor Database Server Log shipping Log shipping Primary Database Secondary Database Server Server Backup Share Restore Job Backup Job
  • 38. FAIL OVER TO A LOG SHIPPING SECONDARY 1. Copy any uncopied backup files from the backup share to the copy destination folder of each secondary server. 2. Apply any unapplied transaction log backups in sequence to each secondary database. 3. If the primary database is accessible, back up the active transaction log and apply the log backup to the secondary databases. 4. After the secondary servers are synchronized, you can fail over to whichever one you prefer by recovering its secondary database and redirecting clients to that server instance. Recovering puts the database into a consistent state and brings it online.
  • 40. COMPARING FAILOVER Failover Availability Database Log Shipping clustering Groups Mirroring • SQL Server • Database • Database • Database Instance Group • Manual or • Manual • Automated • Manual or automated • Based on • Within automated • Few seconds configuration minutes • Few seconds to minutes • Forced • No to minutes • Application application application • No redirection redirection redirection Application required (can required required redirection be required automated)
  • 41. COMPARING SECONDARY SERVER Failover Availability Database Log Shipping clustering Groups Mirroring • Instance • Database • Database • Database • Multiple nodes • Up to 4 • Principal and • Multiple • Server in same Secondary Mirror secondary LAN Replica’s • Span across nodes • Hot standby • Span across WAN • Span across server WAN • Hot standby WAN • Available for • Hot standby • Not available • Warm standby use • Available for for use • Available for • Shared storage use • Storage need use • Status check • Storage need not be shared • Storage need using not be shared • No status check not be shared Heartbeat • Status check unless using • No status WFC witness checking
  • 42. COMPARING Failover Availability Database Log Shipping clustering Groups Mirroring • All instance • Configured • Configured • Configured databases are database is database is database logs shared mirrored or mirrored are applied • Loss limited to readable • Loss limited to • Loss limited to last hardened • Loss limited to last mirrored last applied record last mirrored transaction transaction • No data copy transaction • Synchronous log backup across • Synchronous or • Transaction network or Asynchronous log Asynchronous mirroring Backup, Copy commit mode and Restore
  • 43. COMPARING Failover Availability Database Log Shipping clustering Groups Mirroring • Network • Network • Network • Network connectivity latency to latency to latency to needs to meet I/U/D meet I/U/D meet RTO meet SLA’s SLA’s • Transaction heartbeat • Data is • Data is Log file requirements transferred transferred records • Data is not over network over network transferred transferred over network over network
  • 44. WRAP UP • What is High Availability • Planned vs. Unplanned downtime • Degraded Availability • Recovery Objectives • Justifying Opportunity Costs • SQL Server AlwaysOn • AlwaysOn Failover Cluster Instance • AlwaysOn Availability Group • Database Mirroring • Log Shipping • Compare the different solutions
  • 45. RESOURCES • AlwaysOn Team Blog • http://blogs.msdn.com/b/sqlalwayson/ • SQL Server 2012 Whitepapers • http://msdn.microsoft.com/en-us/library/hh403491 • MSDN – SQL Server High Availability Solutions • http://msdn.microsoft.com/en- us/library/ms190202.aspx#RecommendedSolutions
  • 46. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.