-> Below script can be used to get Always On Availability group failover time from current SQL Server error log.
sp_readerrorlog 0,1,'The state of the local availability replica','JBAG'
From the above command,
sp_readerrorlog is the command.
0 refers to current SQL Server error log file. Increment this value to check old logs.
1 refers to SQL Server error log.
“The state of the local availability replica“ refers to search string 1.
“JBAG” refers to search string 2. I have used the name of availability group for which I am checking the failover time.
Thank You,
Vivek Janakiraman
Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.