Testing the Availability Group failover

In this recipe, we will failover our availability group to our secondary replica.

Getting ready

To follow this recipe, your AlwaysOn availability group should already be set up and the primary/secondary replicas should be functional. If it's not yet set up, you can use the previous recipes in this chapter to set up your AlwaysOn availability group.

In this recipe, we will failover from the primary replica (SQL01) to our secondary replica (SQL02). Before doing this, let's visually check whether the availability group looks like SQL02. Open SQL Server Management Studio and go to the AlwaysOn High Availability node. Here is what SQL02 looks like:

Notice that beside the SQLAG availability group name is the indicator ...

Get SQL Server 2014 with PowerShell v5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.