add database to AG failed in one replica

Surendra Adhikari 206 Reputation points
2021-09-17T06:07:53.303+00:00

I added a database in AG with 4 replicas (3 secondary replicas). The database was successfully added in 2 replicas but one. Now how can I add the database in that replica only?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,820 questions
{count} votes

Accepted answer
  1. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor
    2021-09-17T07:20:18.787+00:00

    Hi SurendraAdhikari-2570,

    The database was successfully added in 2 replicas but one. Now how can I add the database in that replica only?

    So you have joined the secondary replica to the availability group, and have prepared the secondary database in the secondary replica, right?
    If so, please go to the secondary replica, in Object Explorer, Expand the Always On High Availability node ->the Availability Groups->expand the Availability Databases node, Right-click the database, and click Join to Availability Group.

    133014-image.png

    Or use the query in the secondary replica:

    ALTER DATABASE database_name SET HADR AVAILABILITY GROUP = group_name  
    

    Best Regards,
    Amelia


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful