1

I am trying to restore the Latest content to one of my Primary Replica Database which is part of AOAG.

My question is during the Restore operation,

1) Will the synchronization still happens between Application and DB server ?

2) During the DB restoration will the DB which is part of AOAG is locked out so that the synchronization with Secondary AOAG replica not happens ?

Learning_Learning
  • 1,620
  • 25
  • 49

1 Answers1

1

1) Will the synchronization still happens between Application and DB server ?

No synchronization will not happen during restore operation

During the DB restoration will the DB which is part of AOAG is locked out so that the synchronization with Secondary AOAG replica not happens ?

Please note that you cannot just go ahead and restore database which is part of availability group, you would have to evict database from AOAG, restore it and then add it back to AOAG see This Link. The query would look like below(shamelessly copied from This SE thread)

--on primary

ALTER AVAILABILITY GROUP MyAG REMOVE DATABASE AdventureWorks2012;

--on primary

RESTORE DATABASE AdventureWorks2012
   FROM AdventureWorksBackups
   WITH NORECOVERY, 
      MOVE 'AdventureWorks2012_Data' TO 
'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Data\NewAdvWorks.mdf', 
      MOVE 'AdventureWorks2012_Log' 
TO 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Data\NewAdvWorks.ldf';
RESTORE LOG AdventureWorks2012
   FROM AdventureWorksBackups
   WITH RECOVERY;

--on secondary

RESTORE DATABASE AdventureWorks2012
   FROM AdventureWorksBackups
   WITH NORECOVERY, 
      MOVE 'AdventureWorks2012_Data' TO 
'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Data\NewAdvWorks.mdf', 
      MOVE 'AdventureWorks2012_Log' 
TO 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Data\NewAdvWorks.ldf';
RESTORE LOG AdventureWorks2012
   FROM AdventureWorksBackups
   WITH NORECOVERY;

--on primary

ALTER AVAILABILITY GROUP MyAG ADD DATABASE AdventureWorks2012;

--on secondary

ALTER DATABASE AdventureWorks2012 SET HADR AVAILABILITY GROUP = MyAG;
Shanky
  • 19,148
  • 4
  • 37
  • 58