Need in Alwayson query which would tell me failover time

  • Hi All,

    Is there any single TSQL query which provides below info.

    When did my AlwaysOn Availability group failed over and from which node it failed to which new node(i.e. replica)?

    Thanks in Advance.

  • Here's a good article that I used to set up Alerts. This may be better than scanning the server log.

    http://sqlmag.com/blog/alwayson-ags-and-sql-server-jobs-setting-failover-alerts

  • Thank you for the help.

  • Couple of follow up questions.

    Question 1)

    I see below messages for each database which are part of AG.

    What does below messages indicate?

    db1 "SECONDARY" to "RESOLVING"

    db1 "RESOLVING" to "PRIMARY"

    db1 "PRIMARY" to "RESOLVING"

    db1 "RESOLVING" to "SECONDARY"

    Is this changing the database from secondary to primary and primary to secondary?

    Also, why we have that intermediate step like "RESOLVING"...

    Pl correct if I am wrong.

    Question 2)

    The above common table expression query, is that node specific? I mean, replica specific.

    i.e. whatever happened on the node will be only be displayed.

    Eventually we need to gather info from both the nodes/replicas and build a correlation to get the

    provide the AG Failover. Am I correct in my understanding.

    Thank you for sharing information.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply