---
title: "Change the Availability Mode of an Availability Replica (SQL Server) | Microsoft Docs"
ms.custom: ""
ms.date: "05/17/2016"
ms.prod: sql
ms.reviewer: ""
ms.suite: "sql"
ms.technology: high-availability
ms.tgt_pltfrm: ""
ms.topic: conceptual
helpviewer_keywords:
- "Availability Groups [SQL Server], deploying"
- "Availability Groups [SQL Server], configuring"
- "Availability Groups [SQL Server], availability modes"
ms.assetid: c4da8f25-fb1b-45a4-8bf2-195df6df634c
caps.latest.revision: 36
author: MashaMSFT
ms.author: mathoma
manager: craigg
---
# Change the Availability Mode of an Availability Replica (SQL Server)
[!INCLUDE[appliesto-ss-xxxx-xxxx-xxx-md](../../../includes/appliesto-ss-xxxx-xxxx-xxx-md.md)]
This topic describes how to change the availability mode of an availability replica in an Always On availability group in [!INCLUDE[ssCurrent](../../../includes/sscurrent-md.md)] by using [!INCLUDE[ssManStudioFull](../../../includes/ssmanstudiofull-md.md)], [!INCLUDE[tsql](../../../includes/tsql-md.md)], or PowerShell. The availability mode is a replica property that controls the whether the replica commits asynchronously or synchronously. *Asynchronous-commit mode* maximizes performance at the expense of high availability and supports only forced manual failover (with possible data loss), typically called *forced failover*. *Synchronous-commit mode* emphasizes high availability over performance and, once the secondary replica is synchronized, supports manual failover and, optionally, automatic failover.
- **Before you begin:**
[Prerequisites](#Prerequisites)
[Security](#Security)
- **To change the availability mode of an availability replica, using:**
[SQL Server Management Studio](#SSMSProcedure)
[Transact-SQL](#TsqlProcedure)
[PowerShell](#PowerShellProcedure)
## Before You Begin
### Prerequisites
- You must be connected to the server instance that hosts the primary replica.
### Security
#### Permissions
Requires ALTER AVAILABILITY GROUP permission on the availability group, CONTROL AVAILABILITY GROUP permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission.
## Using SQL Server Management Studio
**To change the availability mode of an availability group**
1. In Object Explorer, connect to the server instance that hosts the primary replica, and expand the server tree.
2. Expand the **Always On High Availability** node and the **Availability Groups** node.
3. Click the availability group whose replica you want to change.
4. Right-click the replica, and click **Properties**.
5. In the **Availability Replica Properties** dialog box, use the **Availability mode** drop list to change the availability mode of this replica.
## Using Transact-SQL
**To change the availability mode of an availability group**
1. Connect to the server instance that hosts the primary replica.
2. Use the [ALTER AVAILABILITY GROUP](../../../t-sql/statements/alter-availability-group-transact-sql.md) statement, as follows:
ALTER AVAILABILITY GROUP *group_name* MODIFY REPLICA ON '*server_name*'
WITH ( {
AVAILABILITY_MODE = { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT }
| FAILOVER_MODE = { AUTOMATIC | MANUAL }
} )
where *group_name* is the name of the availability group and *server_name* is the name of the server instance that hosts the replica to be modified.
> [!NOTE]
> FAILOVER_MODE = AUTOMATIC is supported only if you also specify AVAILABILITY_MODE = SYNCHRONOUS_COMMIT.
The following example, entered on the primary replica of the `AccountsAG` availability group, changes the availability and failover modes to synchronous commit and automatic failover, respectively, for the replica hosted by the `INSTANCE09` server instance.
```
ALTER AVAILABILITY GROUP AccountsAG MODIFY REPLICA ON 'INSTANCE09'
WITH (AVAILABILITY_MODE = SYNCHRONOUS_COMMIT);
ALTER AVAILABILITY GROUP AccountsAG MODIFY REPLICA ON 'INSTANCE09'
WITH (FAILOVER_MODE = AUTOMATIC);
```
## Using PowerShell
**To change the availability mode of an availability group**
1. Change directory (**cd**) to the server instance that hosts the primary replica.
2. Use the **Set-SqlAvailabilityReplica** cmdlet with the **AvailabilityMode** parameter and, optionally, the **FailoverMode** parameter.
For example, the following command modifies the replica `MyReplica` in the availability group `MyAg` to use synchronous-commit availability mode and to support automatic failover.
```
Set-SqlAvailabilityReplica -AvailabilityMode "SynchronousCommit" -FailoverMode "Automatic" `
-Path SQLSERVER:\Sql\PrimaryServer\InstanceName\AvailabilityGroups\MyAg\AvailabilityReplicas\MyReplica
```
> [!NOTE]
> To view the syntax of a cmdlet, use the **Get-Help** cmdlet in the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] PowerShell environment. For more information, see [Get Help SQL Server PowerShell](../../../relational-databases/scripting/get-help-sql-server-powershell.md).
**To set up and use the SQL Server PowerShell provider**
- [SQL Server PowerShell Provider](../../../relational-databases/scripting/sql-server-powershell-provider.md)
## See Also
[Overview of Always On Availability Groups (SQL Server)](../../../database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server.md)
[Availability Modes (Always On Availability Groups)](../../../database-engine/availability-groups/windows/availability-modes-always-on-availability-groups.md)
[Failover and Failover Modes (Always On Availability Groups)](../../../database-engine/availability-groups/windows/failover-and-failover-modes-always-on-availability-groups.md)