Thursday, March 29, 2012

How to find time it took to failover SQL Server cluster from SQL Server error log

First run following query to read current error log. Please change date range to fit the time when failover happened

USE Master
Exec xp_ReadErrorLog 0, 1, 'The NETBIOS name of the local node that is running the server is', NULL, '2012-03-21', '2012-03-29', 'desc'

After the failover new error logs are created. So go to the prevous error log and run the same script. You might want to change start and end time according to your error log retention setting

Following are parameters details for xp_readerrorlog

  1. Value of error log file you want to read: 0 = current, 1 = Archive #1, 2 = Archive #2, etc...
  2. Log file type: 1 or NULL = error log, 2 = SQL Agent log
  3. Search string 1: String one you want to search for
  4. Search string 2: String two you want to search for to further refine the results
  5. Search from start time  
  6. Search to end time
  7. Sort order for results: N'asc' = ascending, N'desc' = descending

No comments:

Post a Comment