0

在本文之后,我正在尝试将辅助数据库加入我的 SQL Server 2012 可用性组:

将辅助数据库加入可用性组 (SQL Server)

当我尝试这样做时,本地 SQL Server Windows 事件日志给出错误 1407:

The remote copy of database "<DBNAME>" is not related to the local copy of the database

我已按照所有步骤操作并使用 NORECOVERY 创建了最近的备份和恢复。

目标 SQL 服务器的错误日志给出了以下错误:

AlwaysOn: The local replica of availability group '<AGNAME>' is going offline because the corresponding resource in the Windows Server Failover Clustering (WSFC) cluster is no longer online. This is an informational message only. No user action is required.

The state of the local availability replica in availability group '<AGNAME>' has changed from 'SECONDARY_NORMAL' to 'RESOLVING_NORMAL'. The replica state changed because of either a startup, a failover, a communication issue, or a cluster error. For more information, see the availability group dashboard, SQL Server error log, Windows Server Failover Cluster management console or Windows Server Failover Cluster log. 

The state of the local availability replica in availability group '<AGNAME>' has changed from 'RESOLVING_NORMAL' to 'NOT_AVAILABLE'. The replica state changed because of either a startup, a failover, a communication issue, or a cluster error. For more information, see the availability group dashboard, SQL Server error log, Windows Server Failover Cluster management console or Windows Server Failover Cluster log. 

集群及其所有节点都在线。AG 仪表板不提供任何其他信息来帮助诊断问题。

打开所有防火墙并没有解决问题。

Windows 事件日志给出了这一行:

The database 'DelphiOBUDB' is marked RESTORING and is in a state that does not allow recovery to be run.

但是,当您还原数据库并根据教程指南指定 NORECOVERY 标志时,数据库将处于还原模式。

如何将数据库加入我的可用性组?

4

1 回答 1

0

问题与在重新运行 powershell 脚本以重新创建可用性组之前删除数据库有关。

尝试使用相同的数据库名称时,我也看到了这个错误:

Add-SqlAvailabilityDatabase : The connection to the primary replica is not active.  The command cannot be processed.

答案是执行 powershell 脚本以使用新的和不同的数据库名称创建数据库和可用性组。

于 2013-10-04T16:01:51.690 回答