Take an Availability Group Offline (SQL Server)

This topic describes how to take an AlwaysOn availability group from the ONLINE state to the OFFLINE state by using Transact-SQL in SQL Server 2012 SP1 and later versions. There is no data loss for synchronous-commit databases because if any synchronous-commit replica is not synchronized, the OFFLINE operation raises an error and leaves the availability group ONLINE. Keeping the availability group online protects unsynchronized synchronous-commit databases from possible data loss. After an availability group goes offline, its databases become unavailable to clients and you cannot bring the availability group back online. Therefore, take an availability group offline only to migrate the availability group resources from one WSFC cluster to another.

During a cross-cluster migration of AlwaysOn Availability Groups, if any applications connect directly to the primary replica of an availability group, the availability group must be taken offline. Cross-cluster migration of AlwaysOn Availability Groups supports OS upgrade with minimal downtime of availability groups. The typical scenario is to use cross-cluster migration of AlwaysOn Availability Groups for OS upgrade to Windows 8 or Windows Server 2012. For more information, see Cross-Cluster Migration of AlwaysOn Availability Groups for OS Upgrade.

Logging of OFFLINE operation: The identity of the WSFC node where the OFFLINE operation was initiated is stored in both the WSFC cluster log and the SQL ERRORLOG.

If you did not delete the availability group listener before taking the group offline: If you are migrating the availability group to another WSFC cluster, delete the VNN and VIP of the listener. You can delete them by using either the Failover Cluster Management console, the Remove-ClusterResource PowerShell cmdlet, or cluster.exe. Note that cluster.exe is deprecated on Windows 8.