Avamar:如何在 AlwaysOn 群集設定中的次要副本上成功還原 SQL 資料庫
Summary: Avamar 19.4.100-124 與 SQL 2016 AlwaysOn 2 節點叢集 客戶在 secodnary 複本上進行 SQL 資料庫的重新導向還原,雖然 Avamar 還原完成,但資料庫無法加入叢集,並傳回錯誤: 無法將資料庫「ABC」聯接到可用性副本「輔助\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”聯接到可用性副本“輔助\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.
輔助資料庫應處於還原狀態。問題是次要副本“次要\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 號碼是否同步。
若要解決從「primary:
backup」還原輔助資料庫上缺少的日誌備份的問題,請檢查以確保 LSN nunbers在將資料庫加入 AlwaysOn 組之前保持同步。
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.