A database which was part of 2 AGs on the same server

  • I have a database which was part of AG1. Now that same database was removed from AG1 and added into AG2. AG1 and AG2 are on the same server acting as a Primary. This DB is in sync across all servers which are participating in AG2; however, when i expand AG1, I still that same database with a yellow triangle. Now I am trying to remove it from AG1 but I can't. How do I remove this DB completely from AG1?

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • Have you removed it from all the secondaries of AG1 already? If so, you should be able to just delete the database on AG1. But, if it's still participating in the AG in some way, you'll have to resolve that first.

    Alan H
    MCSE - Data Management and Analytics
    Senior SQL Server DBA

    Best way to ask a question: http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • I see what you are saying but the problem is not about removing the database. Environment details to help you better understand.

    We have AG1 (DAG) which acts as a Primary

    We have AG2 (Normal AG) which acts as a primary.

    'TestDB' which was part of DAG was removed from DAG and was added into AG2. I am not sure which steps were taken and how it (whoever did this) happened. But now it just shows under AG1 DAG and has a little yellow triangle next to it. I know it is not participating in AG1 but it is showing there and I need to remove it. I have tried removing it by running the alter AG AGName remove database TestDB, but that didn't work. This database doesn't exist in forwarder.

    Attachments:
    You must be logged in to view attached files.

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • I've never worked with a DAG before, but when I've encountered this problem with regular AGs, I remove it from the AG (which it sounds like you already have), make sure it's not in the secondary replicas, and then delete the database--not from the AG--as if it weren't in an AG and just delete it (drop database).

    Now I'm wondering if you're saying that it used to be in the DAG, with N number of secondary replicas and now it's on AG2 with the exact same secondary replicas. That would be "interesting" and I have no idea how you would deal with that.

    Alan H
    MCSE - Data Management and Analytics
    Senior SQL Server DBA

    Best way to ask a question: http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Syed

    In this link https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/distributed-availability-groups?view=sql-server-ver15

    under "Understand distributed availability groups" which diagram is your setup?

    Alex S
  • I believe this is due to the secondary AG of the DAG still having a "copy" of this database on its own AG. Once it is removed from all replicas on all AGs participating in the DAG it will either disappear entirely from your primary AG (DAG) list, or it can then be removed.

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

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