Original product version: SQL Server 2012 Enterprise, SQL Server 2014 Enterprise, SQL Server 2016 Enterprise Original KB number: 10179
Important notes
Microsoft CSS data indicates that a significant percentage of customer issues is often previously addressed in a released CU, but not applied proactively and hence recommends ongoing, proactive installation of CUs as they become available. For more information, see Announcing updates to the SQL Server Incremental Servicing Model (ISM).
The parent node for Always On Availability Groups documentation and provides a one stop reference for various questions, see Always On Availability Groups (SQL Server).
I need pointers on setting up and configuring Always On Availability groups
If you are looking for documentation on setting up Always On configuration, please see the following documents:
I am having problems configuring Always On Availability groups
Typical configuration problems include Always On Availability Groups are disabled, accounts are incorrectly configured, the database mirroring endpoint doesn't exist, the endpoint is inaccessible (SQL Server Error 1418), network access doesn't exist, and a join database command fails (SQL Server Error 35250). Review the following document for help on troubleshooting these issues:
I am having issues with Listener configuration (19471, 19476, and other errors)
One of the most common configuration issues customers encounter is availability group listener creation. The errors are similar to the following:
Msg 19471, Level 16, State 0, Line 2The WSFC cluster could not bring the Network Name resource with DNS name '' online. The DNS name may have been taken or have a conflict with existing name services, or the WSFC cluster service may not be running or may be inaccessible. Use a different DNS name to resolve name conflicts, or check the WSFC cluster log for more information.
Msg 19476, Level 16, State 4, Line 2The attempt to create the network name and IP address for the listener failed. The WSFC service may not be running or may be inaccessible in its current state, or the values provided for the network name and IP address may be incorrect. Check the state of the WSFC cluster and validate the network name and IP address with the network administrator.
The majority of time, listener creation failure resulting in the previous messages are due to a lack of permissions for the Cluster Name Object (CNO) in Active Directory to create and read the listener computer object. For troubleshooting this problem, please review the following articles:
Improper configuration of Maximum failures in the specified period is one of the leading causes for primary not automatically failing over to the secondary. The default value for this setting is N-1, where N is the number of replicas. For more information, see Failover cluster (group) maximum failures limit.
I am having issues connecting to Always On Availability groups
After you configure the availability group listener for an Always On Availability Group in SQL Server 2012, you may be unable to ping the listener or connect to it from an application. You may get an error that's similar to the following:
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
To troubleshoot this and similar errors, review the following:
I am having issues configuring Always On Availability groups in my Azure VM (IaaS)
Lot of issues related to Always On occur due to improper configuration of the listener. If you are having connection issues to the listener,
Make sure you read all the limitations of ILB listener and followed all the steps documented in the following article paying particular attention to dependency configuration, IP address, and various other parameters in the PowerShell script.
If unsure, you may want to delete and recreate the listener as per the above document.
If you recently moved your VM to a different service or if the IP addresses changed, you need to update the value of the IP address resource to reflect the new address and you need to recreate the load balanced endpoint for your AG. You can update the IP address using the Get or Set commands as follows:
It takes a long time to failover from primary to secondary or vice-versa
After an automatic failover or a planned manual failover without data loss on an availability group, you may find that the failover time exceeds your recovery time objective (RTO). To troubleshoot the causes and potential resolutions, see Troubleshoot: Availability Group Exceeded RTO.
Changes on the Primary Replica are either not reflected on or slow to replicate to the Secondary Replica
You may notice that changes on primary replica are not getting propagated to secondary in a timely manner. To troubleshoot and resolve these problems, try the following:
How to configure alerts for checking if the secondary is lagging behind the primary?
You can use the following script:
SQL
SELECT ag.name AS ag_name, ar.replica_server_name AS ag_replica_server,
dr_state.database_id AS database_id,
is_ag_replica_local = CASEWHEN ar_state.is_local = 1THEN N'LOCAL'ELSE'REMOTE'END,
ag_replica_role = CASEWHEN ar_state.role_desc ISNULLTHEN N'DISCONNECTED'ELSE ar_state.role_desc
END,
dr_state.last_hardened_lsn, dr_state.last_hardened_time,
datediff(s,last_hardened_time, getdate()) AS'seconds behind primary'FROM (( sys.availability_groups AS ag
JOIN sys.availability_replicas AS ar
ON ag.group_id = ar.group_id)
JOIN sys.dm_hadr_availability_replica_states AS ar_state
ON ar.replica_id = ar_state.replica_id)
JOIN sys.dm_hadr_database_replica_states dr_state
ON ag.group_id = dr_state.group_id AND dr_state.replica_id = ar_state.replica_id
How to get alerted if the state of the database is other than synchronized?
You can use the following script:
SQL
SELECT ag.name AS ag_name, ar.replica_server_name AS ag_replica_server,
dr_state.database_id AS database_id,
is_ag_replica_local = CASEWHEN ar_state.is_local = 1THEN N'LOCAL'ELSE'REMOTE'END,
ag_replica_role = CASEWHEN ar_state.role_desc ISNULLTHEN N'DISCONNECTED'ELSE ar_state.role_desc
END,
ar_state.connected_state_desc, ar.availability_mode_desc, dr_state.synchronization_state_desc
FROM (( sys.availability_groups AS ag
JOIN sys.availability_replicas AS ar
ON ag.group_id = ar.group_id )
JOIN sys.dm_hadr_availability_replica_states AS ar_state
ON ar.replica_id = ar_state.replica_id)
JOIN sys.dm_hadr_database_replica_states dr_state
ON ag.group_id = dr_state.group_id AND dr_state.replica_id = ar_state.replica_id
You can also review the following links for additional methods to monitor Always On groups:
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.