Friday, 14 April 2017

SQL Server 2016- How to check AG is ready for failover using DMV.

If the below query will return 1 then only we should perform failover. if return Zero means there is an issue. check the Database status is SYNCHRONIZED or not.

Select database_name, is_failover_ready from sys.dm_hadr_database_replica_cluster_states

where replica_id in (select replica_id from sys.dm_hadr_availability_replica_states)

 Note A value of zero for any of the availability databases can prevent automatic failover, and this value indicates that the availability database was not SYNCHRONIZED.

No comments:

Post a Comment