SQLTeam.com | Weblogs | Forums

How to get Fail over report?



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.


take a look at this link https://technet.microsoft.com/en-us/library/cc772342(v=ws.11).aspx


I already been to this link, I do not want to view it from fail over manager. My requirement is for reports. I am looking for script which takes the date and time and returns the number of fail overs.