Restoring a database that is part of Distributed Availability Group

  • juniorDBA13

    Ten Centuries

    Points: 1021

    What is the process for restoring a database that is part of Distributed Availability Group?

     

  • John Mitchell-245523

    SSC Guru

    Points: 148769

    I think it involves removing the database from the availability group before restoring and adding it back in afterwards.  As for the exact process, I'd have to do a search for that.  I'll leave that part to you.

    John

  • juniorDBA13

    Ten Centuries

    Points: 1021

    That doesn't work.

    When I try adding the database back I get the following message

    Database 'TEST' cannot be joined to or unjoined from availability group 'TEST-AG'. This operation is not supported on the primary replica of the availability group.

  • John Mitchell-245523

    SSC Guru

    Points: 148769

    What doesn't work?  What process are you following?  The error message says that the operation isn't supported on the primary replica, so run it on a node that isn't the primary replica.

    John

  • juniorDBA13

    Ten Centuries

    Points: 1021

    I was running it on the primary replica.

    Seems like a bug as it works using the GUI

  • HandyD

    Mr or Mrs. 500

    Points: 507

    Can you script out the action from the GUI and see if it is running the same commands your script was running?

  • juniorDBA13

    Ten Centuries

    Points: 1021

    Yes it works when you script it

  • John Mitchell-245523

    SSC Guru

    Points: 148769

    I imagine that's because the script generated is a SQLCMD script that includes commands to make sure each statement is run against the correct server.  When you did it manually, you ran it on the primary replica, and got an error saying the operation isn't supported on the primary replica.

    John

Viewing 8 posts - 1 through 8 (of 8 total)

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