AlwaysOn HA - database stuck in initializing- after failover

  • Hello

    We had to failover our primary db server for maintenance to our secondary replica. The primary was rebooted during maintenance.

    We failed back after the maintenance and one of the databases is not synchronizing.

    I checked sys.dm_hadr_database_replica_states, and it is showing that it is INITIALIZING.

    It has been in this state for more than 45 mins now. The last_sent_time, last_received_time, last_hardened_time and last-redone_time are all stuck with a time stamp 45 mins ago.

    They haven't changed. How do i resume this database and bring it back in sync?

    I tried suspending and resuming the data movement, but hasn't helped.

    Please advise.

    thanks

  • is this a synchronous or asynchronous session?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • synchronous commit.

  • have you had a full backup run since the secondary database fell behind?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • So you went from A to B.

    Then you went from B back to A.

    All Databases except for one came ONLINE.

    The one you are having problem says INITIALIZING.

    OK.

    The last Copy of the database that is up to date and functional should be on B.

    What I would do in this case is to

    1. REMOVE the Database from the Availability Group.

    2. REMOVE the actual Database from Server A

    3. Do a DBCC CHECKDB on the B Server Database

    3. Do a Full back up of the Database on Server B

    4. Add the Database back to the Availability Group and see if the Synchronize

    Check your SQL Server Logs for additional information..

  • We were able to fix this.

    this is what we did

    1) We stopped Tlog backups on both primary and secondary

    2) On the secondary we tried to remove the database from availability group. It failed though, but the db status went to Restoring.

    3) Then we applied log backups from primary server. No errors.

    3) We applied all backups and the database was all set. We resumed the data movement and the db got in sync.

    Thanks for all the help.

  • we dont take backups on secondary.

Viewing 7 posts - 1 through 6 (of 6 total)

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