Sql Server High Availability & DR Technologies


Published on

There are many different disaster recovery and high availability options for SQL Server. Making decisions on the most effective DR & HA strategies can be complex, especially when you throw into the mix various SAN and network topologies.

This presentation is focused on the management and operational decisions that are made when planning DR and HA for production SQL Server environments. It is targeted towards Senior DBAs, CIO, IT Manager, database services managers.

Topics include:

Log Shipping
Database Mirroring
Always On High Availability groups

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Sql Server High Availability & DR Technologies

  1. 1. RockSolid SQL Server Management
  2. 2. DisclaimerWe recommend that you seek further professional advice beforedeciding on the suitability of any recommendations in this presentationfor you. While all care is taken to ensure information is accurate, we donot make any guarantees about the suitability of advice and advicegiven may contain technical inaccuracies or topographical errors. Theanswers provided are our own opinions and may differ from adviceprovided by Microsoft and/or other SQL Server professionals. In noevent shall we be liable for any special, incidental, indirect, economic orconsequential damages or for loss of profit, revenue or data howsoevercaused, regardless of whether we could foresee or was advised of thepossibility or likelihood of such loss or damage.
  3. 3. Disaster Recovery & High Availability Technologies (SQLServer 2008, 2008 R2 & 2012 Standard & Enterprise)Contents Log Shipping Replication Clustering Database Mirroring Always On High Availability groups Leveraging SQL Server 2012 core licensing for High Availability / DR implementations
  4. 4. Disaster Recovery & High Availability TechnologiesWhat’s the difference between Disaster Recovery & HighAvailability?DR Log Shipping Async database mirroring Async AlwaysOn Availability GroupsHA Clustering Sync database mirroring Sync AlwaysOn Availability Groups Replication
  5. 5. DR - Log Shipping Performed at database level Logged operations copied from a primary to secondary offsite database Consists of 3 operations • Backup TL at source • Copy of TL from source to destination • Restore TL at destination Prerequisites • Recovery model of FULL/BULK-LOGGED • Create network share for transaction log backups • SQL Server Agent must be running
  6. 6. DR - Log Shipping continued …. Generally, failover is manual process Configuration options determine data loss • Backup/restore schedule Other options • Compress backups? • How long you want to keep backup files? • Secondary db RECOVERING or STANDBY state?
  7. 7. Demo: Log Shipping Configuration Review
  8. 8. Replication Performed at database level Distribute & replicate data automatically Integrating data from multiple sources Data warehousing & reporting Typical topology - Publisher, Distributor & Subscriber One-way or bidirectional depending upon type
  9. 9. Replication continued ..Options Publication type: Snapshot, Transactional & Merge• Advantages of replication • Multiple sites have copies of data • Separate applications for read/write operations • Increased performance• Disadvantages of replication • Can be complicated to manage changes • Multiple SQL licenses
  10. 10. HA - Clustering Performed at an instance level One virtual server name, multiple nodes Shared storageBest Practices• Server dedicated to SQL Server• Identical servers• Use static IP address• Plan how to deal with risks - SAN failure & DR options
  11. 11. HA – Clustering continued …Advantages• Patching SQL Server is easier• Eliminate downtime• Logins, jobs, system db’s all failover• Don’t license passive nodeDisadvantages• Is generally not a DR solution• Single copy of db• Shared storage issue• Expensive – x 2 servers and shared storage
  12. 12. DR & HA - Database Mirroring Performed at a database level Principle, Mirror & optional Witness Cannot mirror master, msdb, tempdb or model Apply stream of database log records to db mirror Used for DR (async) & HA (sync) Prerequisites • FULL RECOVERY • Principal & Mirror require same edition of SQL Server Options • Supports automatic failover (witness) • Sync OR async
  13. 13. DR & HA - Database Mirroring continued … Witness Database • It’s role is to determine availability between Principal & Mirror • Used for HA not DR • Ideally, located in a third datacentre Advantages • Since SQL Server 2008 - • The principle compresses the transactions before sending to mirror. • Automatically detects & attempts to recover storage corruption Limitations • Can’t read mirror – unless using snapshot • Can only fail over one database at a time • Doesn’t copy SQL logins or jobs
  14. 14. Demo: Database MirroringFailover & Snapshot
  15. 15. AlwaysOn Availability Groups SQL Server 2012 Next evolution of db mirroring HA+DR solution Windows Server Failover Cluster license Sync – auto license Sync – auto failover Async – failover Async – forced forced SQL2012PROD1 SQL2012PROD2 SQL2012DR1 Primary Replica Secondary Replica Secondary Replica Read-Write Disallow connections Disallow connections <---------RockSolid Availability Group-----> Melbourne Primary data centre Sydney DR data centre
  16. 16. AlwaysOn Availability Groups continued .. Prerequisites • Windows Server Failover Clustering (WSFC) • SQL Server 2012 Enterprise license • Same instance collation • Advise same drive letters Options • Failover groups contain multiple db’s • Supports up to 5 availability groups • Supports async & sync failover
  17. 17. AlwaysOn Availability Groups continued ..Replica Mode – Automatic failover (sync - auto) OR HighSafety (sync - manual) OR High Performance (async - manual)Connection Mode in Secondary Role – Disallow connections ORAllow only read-intent connections
  18. 18. AlwaysOn Availability Groups continued ..Advantages • Recovery of corrupt pages are automatically attempted • HA & DR solution • Replicas can be used for reporting & backup operationsDisadvantages • Enterprise feature • No delay in applying transaction log updates if you want that control
  19. 19. Leveraging SQL Server licensing for High Availability / DRimplementations SQL Server customers can run one supportive passive instance • The passive server must be truly passive • One secondary passive server is ONLY allowed • When licensing Per Core you must license the highest number of core licenses even if this is the passive node
  20. 20. Leveraging SQL Server licensing for High Availability / DRimplementations 2008 2008 2008 R2 2008 R2 2012 2012 Enterprise Standard Enterprise Standard Enterprise StandardLog Yes Yes Yes Yes Yes YesShippingDatabase Yes Yes sync – Yes Yes sync – Yes Yes sync –Mirroring full safety full safety full safety only only onlyAlways on n/a n/a n/a n/a Yes – NoHigh requiresAvailability Windows clusteringClustering Yes Yes – 2 Yes Yes – 2 Yes Yes – 2 node node node support support support
  21. 21. Leveraging SQL Server licensing for High Availability / DRimplementations Server 1 – 4x core licenses required Server 2 – ACTIVE PASSIVE 4 x core VM 4 x core VM Server 2 – PASSIVE Server 1 – 4 x core VM ACTIVE 4 x core VM Server 2 – 8x core licenses required PASSIVE 4 x core VM
  22. 22. Leveraging SQL Server licensing for High Availability / DRimplementations Server 2 – PASSIVE Server 1 – 4 x core VM ACTIVE 4 x core VM Server 2 – 12x core licenses required PASSIVE 8 x core VM 8x licenses required as license requirement based on passive server
  23. 23. Final Q & A