Is there any way I can find the number of times the fail over occurred? I wanted to know in last month how many fail over happened. In LOG there is large set of data and difficult to parse. Do we have any powershell/SQL Script?
I thought we can set up a monitoring script using the method
select * from sys.dm_hadr_availability_replica_states
We need to create a Job which runs every X minutes (Example: 15 minutes) and filters the above columns to find the fail overs. But this gives only future fail overs.