Avamar: SQL-databases herstellen op de secundaire replica in een AlwaysOn clusterinstellingen

Summary: Avamar 19.4.100-124 met SQL 2016 AlwaysOn cluster met 2 knooppunten Klant voert omleidingsherstel uit van de SQL-databases op de secodnary-replica en hoewel Avamar-herstel is voltooid, kunnen databases niet deelnemen aan het cluster met de fout: Kan de database 'ABC' niet toevoegen aan de beschikbaarheidsgroep 'AG' op de beschikbaarheidsreplica 'secundair\AG_Sec' ...

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

  • Een omgeleid herstel van een Avamar back-up van SQL Database wordt uitgevoerd naar de secundaire replica.
  • Het herstel wordt voltooid.
  • De database op de secundaire staat in "Restoring state".
  • Wanneer u probeert lid te worden van de beschikbaarheidsgroep, wordt er een fout weergegeven:

Kan database ABC niet toevoegen aan de beschikbaarheidsgroep AG op de beschikbaarheidsreplica 'secundair\AG_Sec.

Deze procedure wordt beschreven in de Avamar SQL Guide onder de sectie "Restore to the original availability group". Er staat:
 
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. 

De secundaire zal naar verwachting in een herstellende staat verkeren. Het probleem is dat de database 'ABC' op de secundaire replica 'secundair\AG_Sec' niet synchroon loopt met de primaire replica. Dit komt doordat er enkele logboekrecords ontbreken.

SQL Server AlwaysOn kan de resterende logboeken niet toepassen om ze beide gesynchroniseerd te houden. 

In een dergelijke situatie is de eerste stap het verifiëren van de LSN-sequentie voor database 'ABC' van beide replicaknooppunten.

Voer de volgende query uit om dit te controleren:
 
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

Dit geeft u een volledige back-upgeschiedenis voor ('ABC') voor het jaar 2022.
U kunt het datumbereik aanpassen aan uw behoeften.
Het belangrijkste punt is om te controleren of de primaire en secundaire LSN-nummers voor deze database synchroon lopen.

U kunt dit oplossen om de ontbrekende logback-ups op de secundaire back-up te herstellen vanuit Primair:
Back-up en controleer vervolgens of LSN-nunbers gesynchroniseerd zijn voordat u de database toevoegt aan de AlwaysOn-groep. 
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.