introduction to high availability with sql server
DESCRIPTION
Have you ever wondered how companies keep their databases online through unplanned disasters? Have you wondered which high availability features might be best for our shop? In this session we will go over a quick look at log shipping, database mirroring, transactional replication, failover cluster instances and availability groups. John will identify pros and cons for each features and share some tips from the field.TRANSCRIPT
![Page 1: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/1.jpg)
04/10/2023 www.linchpinpeople.com 1
Introduction to High Availability with SQL Server
![Page 2: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/2.jpg)
www.linchpinpeople.com 2
John Sterrett
@johnsterrettJohn.Sterrett@linchpinpeople.comJohnsterrett.comlinked.com/in/johnsterrettgoogle.com/+johnsterrett
Specialties / Focus Areas / Passions:
• Performance Tuning & Troubleshooting
• Virtualization• Infrastructure• Architecture
• High Availability• Disaster Recovery• Health Monitoring• Capacity Management• License Efficiency
Linchpin People Group Principle
Leader Austin SQL Server User Group Leader Virtual Chapter “High Availability and Disaster Recovery”PASS Regional Mentor
![Page 3: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/3.jpg)
www.linchpinpeople.com 3
Linchpin People® are database coaches and wellness experts for the Microsoft SQL Server Ecosystem. Our team includes more than 15 of the world’s top SQL Server experts, and we have presented over 175 combined sessions at SQL Saturdays, PASS Summit, and other events in the past year.
Do you have specific questions about your database environment? Check out www.LinchpinPeople.com and take a look at the range of services we provide, or contact one of us today to learn how we can help improve your business.
You know us individually, but do you know Linchpin People®?
![Page 4: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/4.jpg)
04/10/2023 www.linchpinpeople.com 4
Agenda• HA != DR
• Log Shipping
• Database Mirroring
• Transactional Replication
• AlwaysOn Failover Cluster Instance
• AlwaysOn Availability Groups
• Wrap Up / Question and Answer
![Page 5: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/5.jpg)
04/10/2023 www.linchpinpeople.com 5
Introduction
Definitions
•What do we mean when we say a system is Highly Available?
•What does it mean to have a Disaster Recovery system?
![Page 6: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/6.jpg)
04/10/2023 www.linchpinpeople.com 6
High Availability
What is High Availability• High availability is a system design approach and
associated service implementation that ensures a prearranged level of operational performance will be met during a contractual measurement period. –Wikipedia
• A System Design that allows for minimal downtime.• Protection from OS or hardware failure
![Page 7: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/7.jpg)
04/10/2023 www.linchpinpeople.com 7
Examples of Disasters
Photo https://www.flickr.com/photos/ross/39556863/
![Page 8: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/8.jpg)
04/10/2023 www.linchpinpeople.com 8
Most Common Disaster
![Page 9: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/9.jpg)
04/10/2023 www.linchpinpeople.com 9
Disaster Recovery
What is Disaster Recovery•Risk Management•Recovery Point Objective - RPO•Recovery Time Objective - RTO•Disaster Recovery Plan - DRP
•Backups are not enough
![Page 10: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/10.jpg)
04/10/2023 www.linchpinpeople.com 10
Options
SQL Server Options for HA/DR
•Log Shipping•Database Mirroring•Replication•Failover Cluster Instances•AlwaysOn Availability Groups
![Page 11: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/11.jpg)
04/10/2023 www.linchpinpeople.com 11
Intro to Log Shipping
1. Transactional Log Backup
2. Copy Transactional log backups3. Restore Transactional log
backups
http://www.mssqltips.com/sqlservertip/2073/migrating-a-vldb-in-sql-server-with-log-shipping/
![Page 12: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/12.jpg)
04/10/2023 www.linchpinpeople.com 12
![Page 13: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/13.jpg)
04/10/2023 www.linchpinpeople.com 13
Log Shipping
•Transaction Log backups occur on the primary•Process ships logs to secondary server(s)•Data can be read on the secondary except
during transaction log restore•Can have a Log Ship monitor server
![Page 14: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/14.jpg)
04/10/2023 www.linchpinpeople.com 14
Monitoring Log Shipping
• sp_help_log_shipping_monitor
![Page 15: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/15.jpg)
04/10/2023 www.linchpinpeople.com 15
Log Shipping Pros/Cons•Works with Standard Edition•Multiple target support•Readable secondary copies •Can delay restores
•Dependent on backup of primary
•Manual failover process•Reasonably high complexity
![Page 16: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/16.jpg)
04/10/2023 www.linchpinpeople.com 16
Database Mirroring - Modes• High Safety (Synchronous) with Automatic Failover• High Safety without Automatic Failover• High Performance (Asynchronous)
Primary Server Secondary Server
WitnessInstance
MirrorDB
Mirror DB
![Page 17: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/17.jpg)
04/10/2023 www.linchpinpeople.com 17
Synchronous Mode…
Mode
Principal • Transaction (Insert/Update/Delete) inserted into Transactional Log
• Transaction read from the transactional log• Transaction shipped to mirror
Mirror • Transaction written to mirrors transactional log• Acknowledgement sent to principal• Transaction committed
Principal • Acknowledgement received• Transaction committed.
![Page 18: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/18.jpg)
04/10/2023 www.linchpinpeople.com 18
Asynchronous Mode… (Enterprise)Mode
Principal • Transaction (Insert/Update/Delete) inserted into Transactional Log
• Transaction read from the transactional log• Transaction committed• Transaction shipped to mirror
Mirror • Transaction written to mirrors transactional log• Acknowledgement sent to principal• Transaction committed
Principal • Acknowledgement received
![Page 19: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/19.jpg)
04/10/2023 www.linchpinpeople.com 19
Database Mirroring
•Deprecated in SQL 2012•Database transactions are compressed and
shipped to a secondary (2008+)•Transfer may be sync or async (Enterprise)•Optional witness server can facilitate failover
![Page 20: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/20.jpg)
Warning.. Warning.. Warning..
http://technet.microsoft.com/en-us/library/ms366349.aspx
![Page 21: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/21.jpg)
04/10/2023 www.linchpinpeople.com 21
Pros and Cons
• Pros• Witness can be any edition of SQL Server• Page level corruption fixes• Doesn’t require Active Directory• Database level High Availability• High Safety only requires Standard Edition
• Cons• You cannot mirror system databases• Automatic Failover requires a witness• Database must be in full recovery• High Performance requires Enterprise Edition• Must create and sync Instance Objects (Jobs, Logins, etc..)
![Page 22: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/22.jpg)
04/10/2023 www.linchpinpeople.com 22
Replication
•Numerous topologies and options involved with replication
•Snapshot Replication•Transactional Replication•Merge Replication•Peer to Peer Replication
![Page 23: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/23.jpg)
04/10/2023 www.linchpinpeople.com 23
![Page 24: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/24.jpg)
How Transactional Replication Works
http://technet.microsoft.com/en-us/library/ms151706(v=sql.105).aspx
![Page 25: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/25.jpg)
04/10/2023 www.linchpinpeople.com 25
Replication Pros/Cons•Replicate to multiple servers•Replicate subset of data•Can be done with Simple Recovery Model•Standard Edition for transactional
•Manual failover process•Unknown RPO•Known to be fragile•Re-sync can be cumbersome•Complex
![Page 26: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/26.jpg)
04/10/2023 www.linchpinpeople.com 26
Failover Cluster Instances
SQL Instance
Node 1 Node 2
Windows Failover Cluster
Cluster Virtual Name
![Page 27: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/27.jpg)
27
How Windows - SQL Clustering works• Physical Nodes
• Windows cluster• Windows cluster group• MSDTC• SQL cluster• Other clustered application
• End User Access
![Page 28: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/28.jpg)
04/10/2023 www.linchpinpeople.com 28
Failover Cluster Instance (FCI)
•Pre Windows 2012 – Shared Storage•Windows Cluster (Windows 2012 Standard Ed)•Two Node Limit on SQL 2012 Standard•Quorum
![Page 29: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/29.jpg)
29
How Window – SQL Clustering Works – Failover Cluster ManagerThings that you should see in Service and Application/ Role
• Current Status
• Current Owner
• Resources• Client Access Point
• Virtual Network Name• IP address assigned with the name
• Storage allocated to the application• Services / Applications or Predefined
Resources• Others - optional
• File shares• Printers and so on
![Page 30: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/30.jpg)
04/10/2023 www.linchpinpeople.com 30
Quorum
![Page 31: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/31.jpg)
04/10/2023 www.linchpinpeople.com 31
![Page 32: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/32.jpg)
04/10/2023 www.linchpinpeople.com 32
![Page 33: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/33.jpg)
04/10/2023 www.linchpinpeople.com 33
![Page 34: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/34.jpg)
04/10/2023 www.linchpinpeople.com 34
![Page 35: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/35.jpg)
04/10/2023 www.linchpinpeople.com 35
Failover Cluster Pros/Cons•Multiple Servers (HA)•Allows for entire instance
protection•Automatic failover•Transparent connections
•Complex setup• Idle hardware•Some cases storage single
point of failure
![Page 36: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/36.jpg)
04/10/2023 www.linchpinpeople.com 36
Introduction to Availability Groups
Node 1 Node 2
Instance 1
Instance 2
AG (P) AG (S)
Data Center 1 Data Center 2
Windows Failover Cluster
Listner Name (VCO)
![Page 37: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/37.jpg)
04/10/2023 www.linchpinpeople.com 37
Database Mirroring Problems…• Cannot group databases• Only get one mirror database• No readable copies• Requires witness (extra SQL instance) for automatic
failover
![Page 38: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/38.jpg)
04/10/2023 www.linchpinpeople.com 38
Availability Group Benefits..• No shared storage• Listener (Virtual Computer Object for connectivity)• Multiple mirrors replicas• Readable copies
![Page 39: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/39.jpg)
04/10/2023 www.linchpinpeople.com 39
AlwaysOn Availability Groups
•SQL Server Enterprise Edition•Windows Cluster •Async and Sync modes•Databases failover as a group•No shared storage needed•Readable replicas•Supports up to 8 replicas
![Page 40: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/40.jpg)
Requires Downtime
![Page 41: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/41.jpg)
04/10/2023 www.linchpinpeople.com 41
![Page 42: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/42.jpg)
04/10/2023 www.linchpinpeople.com 42
AG Configurations
![Page 43: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/43.jpg)
04/10/2023 www.linchpinpeople.com 43
AG Dashboard
![Page 44: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/44.jpg)
04/10/2023 www.linchpinpeople.com 44
AlwaysOn Pros/Cons•No shared storage•Readable secondaries•SSMS administration•Configuration is easy•Grouping DB failover helps
for complex applications setups
•Enterprise Only - Large setups can be expensive
•Newer technology•App code changes may
be needed
![Page 45: Introduction to High Availability with SQL Server](https://reader035.vdocument.in/reader035/viewer/2022081413/548d20b4b4795949118b4712/html5/thumbnails/45.jpg)
04/10/2023 www.linchpinpeople.com 45
Questions?