High Availability (HA) and disaster recovery (DR) 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 the applications and business users can access them. SQL Server has several options for us to implement to improve the resiliency and availability of our data including:
- Log Shipping
- Windows Failover Cluster Services
- 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 up, let’s talk about Log Shipping.
Log Shipping is the process of backing up the transaction log of the primary database, and copying those backups off to one, or many, secondary copies to keep them in sync. Since SQL Server 2000, this has been one of the most simple and effective options DBAs have to implement HA and DR solutions.
In our experience, SQL Server Management Studio 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 importantly, reliable and robust.
This section will demonstrate how to implement Log Shipping using a single command.