17 High availability and disaster recovery

 

High availability and disaster recovery (HADR) are complicated and important topics when we’re talking about our databases. One of the core responsibilities of a production DBA is ensuring that databases are available so applications and business users can access them. SQL Server has several options we can implement to improve the resiliency and availability of our data, including the following:

  • Log shipping
  • Windows Server Failover Clusters
  • Availability groups

Throughout this chapter, we’ll demonstrate how dbatools can help simplify working with each of these HADR solutions, making them easier to configure and monitor. First, let’s talk about log shipping.

17.1 Log shipping

Log shipping is the process of backing up the transaction log of the primary database and copying those backups to one, or many, secondary copies to keep them in sync. Since SQL Server 2000, this method has been one of the most simple and effective options DBAs have to implement HADR solutions.

In our experience, SQL Server Management Studio (SSMS) can fail during log shipping deployments—even simple deployments! In response, we created a set of commands to make this task much easier and, more important, reliable and robust. This section will demonstrate how to implement log shipping, using a single command.

17.1.1 Configuring log shipping with dbatools

17.1.2 When log shipping goes bad: Gathering errors with dbatools

17.1.3 Cutting over to a log shipped secondary database

17.2 Windows Server Failover Cluster (WSFC)

17.3 Availability groups

17.3.1 Creating an availability group with dbatools

17.3.2 Explore existing availability groups

17.3.3 Managing existing AGs

17.4 Hands-on lab

sitemap