Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Avamar:如何在 AlwaysOn 叢集設定的次要複本上成功還原 SQL 資料庫

Summary: Avamar 19.4.100-124 搭配 SQL 2016 AlwaysOn 2 節點叢集 客戶正在安全複本上重新導向 SQL 資料庫的還原,雖然 Avamar 還原已完成,但資料庫無法加入叢集,並顯示錯誤: 無法將資料庫「ABC」加入可用性群組「AG」的可用性複本「secondary\AG_Sec」

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Instructions

  • Avamar 備份 SQL 資料庫的重新導向還原會執行到次要複本。
  • 還原完成。
  • 次要資料庫處於「還原狀態」。
  • 嘗試加入可用性群組時,會顯示錯誤:

無法將資料庫「ABC」加入可用性群組「AG」的可用性複本「secondary\AG_Sec」。

此程式會記錄在《Avamar SQL Guide》(Avamar SQL Guide) 的「還原至原始可用性群組」一節底下。讀取:
 
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 分層同步,再將資料庫加入 AlwaysOn 群組。 

Article Properties


Last Published Date

31 Jul 2023

Version

2

Article Type

How To