enable/disable availability group
alwayson ag in multisubnet
rem -------------------------------------------------------------------
SQL Server Configuration Manager
SQL Server 2016 C:\Windows\SysWOW64\SQLServerManager13.msc
SQL Server 2014 C:\Windows\SysWOW64\SQLServerManager12.msc
SQL Server 2012 C:\Windows\SysWOW64\SQLServerManager11.msc
SQL Server 2008 C:\Windows\SysWOW64\SQLServerManager10.msc
rem -----------------------------------------------------------------
In SQL Server Configuration Manager, click SQL Server Services,
right-click SQL Server (),
where is the name of a local server instance
for which you want to enable Always On Availability Groups, and click Properties.
Select the Always On High Availability tab.
Verify that Windows failover cluster name field contains the name of the local failover cluster.
If this field is blank, this server instance currently does not support Always On availability groups.
Either the local computer is not a cluster node, the WSFC cluster has been shut down,
or this edition of SQL Server 2017 that does not support Always On availability groups.
Select the Enable Always On Availability Groups check box, and click OK.
powershell:
Enable-SqlAlways On -Path SQLSERVER:\SQL\Computer\Instance
Disable-SqlAlways On -Path SQLSERVER:\SQL\Computer\Instance
SQL Server Configuration Manager saves your change.
Then, you must manually restart the SQL Server service.
This enables you to choose a restart time that is best for your business requirements.
When the SQL Server service restarts, Always On will be enabled,
and the IsHadrEnabled server property will be set to 1
rem -------------------------------------------------------------------
Always On availability groups feature must have been enabled on the each instance of SQL Server
that will host an availability replica for one or more availability groups.
rem -------------------------------------------------------------------
Enable Always On Availability Groups on only one server instance at a time.
After enabling Always On Availability
wait until the SQL Server service has restarted before you proceed to another server instance.
rem -------------------------------------------------------------------
While Always On Availability Groups is enabled on an instance of SQL Server,
the server instance has full control on the WSFC cluster.
rem ------------------------------------------------------------------
SELECT SERVERPROPERTY ('IsHadrEnabled');
# powershell
get-item . | select IsHadrEnabled
Using SQL Server Management Studio
To determine whether Always On Availability Groups is enabled
In Object Explorer, right-click the server instance, and click Properties.
In the Server Properties dialog box, click the General page.
The Is HADR Enabled property displays one of the following values:
True, if Always On Availability Groups is enabled
False, if Always On Availability Groups is disabled.
|