Database in Availability Group Issue

  • I have a database that currently believes its in an Availability Group that it is not in. When I check the sys.dm_hadr_database_replica_states view on the primary replica I see 2 rows one for a primary replica and one for a secondary replica.

    When I run the same query on the secondary replica I don't see any records I also do not have that database on the secondary replica.

    Back on the primary replica I attempt to remove it from the AG and get the following error

    Database 'X' cannot be removed from availability group 'AG'. The database is not joined to the specified availability group. Verify that the database name and the availability group name are correct, then retry the operation.

    Then I attempt to add it even though it says its there already and I get the following error

    Database 'X' cannot be added to availability group 'AG'. The database is already joined to the specified availability group. Verify that the database name is correct and that the database is not joined to an availability group, then retry the operation.

    Because this database thinks its in an AG I can not delete it or take it offline.

  • Be sure that the GUI of the management studio is refreshed.

    Check that the database is not part of another availiability group.

  • Hi John,

    I'm facing exactly the same issue on two production databases since a VM failure.

    Can you share how/if you found a solution ?  So far the tlog is growing on the primary server and I'm not able to rejoin or remove the database from the availability group.

    Patrick

  • Was able to fix the issue but it required a failover, restore with recovery of the impacted db's on the previous principal and then failover back to the original node. The issue was fixed and possible to add the databases back to the availability group.

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

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