Use Transact-SQL

To manually fail over an availability group:

  1. Connect to the server instance that hosts the target secondary replica.
  2. Use the ALTER AVAILABILITY GROUP statement, as follows:ALTER AVAILABILITY GROUP group_name FAILOVER
  3. In the statement, group_name is the name of the availability group.The following example manually fails over the MyAg availability group to the connected secondary replica:
ALTER AVAILABILITY GROUP MyAg FAILOVER;

Sources:

https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/perform-a-planned-manual-failover-of-an-availability-group-sql-server?redirectedfrom=MSDN&view=sql-server-ver15

Last modified: August 20, 2020

Author

Comments

Write a Reply or Comment