Avamar:如何在 AlwaysOn 群集设置中的辅助复制副本上成功还原 SQL 数据库
Summary: 带有 SQL 2016 AlwaysOn 2 节点群集的 Avamar 19.4.100-124 客户在 secodnary 副本上执行 SQL 数据库的重定向还原,尽管 Avamar 还原已完成,但数据库无法加入群集,并显示错误: 无法将数据库“ABC”加入可用性副本“secondary\AG_Sec”上的可用性组“AG”
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
- 对 Avamar 备份的 SQL 数据库运行到辅助复制副本的重定向还原。
- 还原完成。
- 辅助数据库上的数据库处于“正在还原状态”。
- 尝试加入可用性组时显示错误:
无法将数据库“ABC”联接到可用性副本“secondary\AG_Sec”
上的可用性组“AG”。此过程记录在《Avamar SQL 指南》的“恢复到原始可用性组”部分下。上面写着:
When you restore to the original availability group, the restore process can automatically restore the databases on both the primary replica and the secondary replicas.
You can also restore databases only on the primary replica.
When you restore a database only on the primary replica, the corresponding database on the secondary replicas is in a restoring state.
To restore the databases on the secondary replicas as part of the availability group, manually prepare and restore the databases, and join them to the availability group on the secondary replicas.
You can also set the databases on a secondary replica online without rejoining them to the availability group by restoring the databases with the RECOVERY recovery operation.
辅助端预计处于正在还原状态。问题是辅助副本“secondary\AG_Sec”上的数据库“ABC”与主副本不同步。这是因为它缺少一些日志记录。
SQL Server AlwaysOn 无法应用剩余日志来使它们保持同步。
在这种情况下,第一步是从两个副本节点验证数据库“ABC”的 LSN 序列。
运行以下查询以检查此情况:
SELECT msdb.dbo.backupset.database_name,
msdb.dbo.backupset.backup_start_date,
msdb.dbo.backupset.backup_finish_date,
msdb.dbo.backupset.type,
msdb.dbo.backupset.database_backup_lsn,
msdb.dbo.backupset.first_lsn,
msdb.dbo.backupset.last_lsn
FROM msdb.dbo.backupmediafamily
INNER JOIN msdb.dbo.backupset
ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id
WHERE database_name IN ('ABC')
--and msdb.dbo.backupset.backup_finish_date between '1/20/2022' and '12/23/2022'
ORDER BY
2 DESC,
3 DESC
这将为您提供 2022 年(“ABC”)的完整备份历史记录详细信息。
您可以自定义日期范围以满足您的需求。
重要的一点是检查此数据库的主 LSN 编号和辅助 LSN 编号是否同步。
要解决此问题,请从 Primary:
Backup 还原辅助服务器上缺少的日志备份,然后在将数据库加入 AlwaysOn 组之前检查以确保 LSN nunber 同步。
Article Properties
Article Number: 000206971
Article Type: How To
Last Modified: 05 Sep 2025
Version: 3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.