SQL Server – Resolving DB Out of Sync on Secondary Node HAG

sql server

I have a question about HAG / DB synchronization in MS SQL server.

I have a HAG and in the secondary node I had to remove one DB on Saturday from the HAG. I added it back on Sunday and it's been out of sync since then. This secondary node it's read-only and more like a backup so it's not impacting anything.

I want to know what would be the best approach to put this DB back in sync. Right now the DB it's in the available databases but not synchronizing.

If I join this database to the HAG, it will automatically start seeding from the primary or is it better to restore the last full backup and t-logs and then join to the HAG?
The DB it's quite large. I tried restoring it in another VM and it took approximately two days and a half so I guess that I should stop the full backup for that DB in specific and just restore the last full backup and all t-logs until up to date right?

Thanks!

EDIT: I ended up restoring the full last backup with the t-logs in norecovery in the secondary node and then just joining the DB into the AG. Worked like a charm.

Thanks for the responses!

Best Answer

Imho, it's worth to try the following: Simulate the same scenario but with a tiny test db. Don't forget to do full/log backups which happened (?) with your big db on primary since Sunday. It will take ~10-15 mins to reproduce and you will know for sure will it go or not.

Regarding the question: I believe it will not start auto-seeding because your DB was recovered and readable before you removed it from HAG. Also, if there was a full backup on primary, it also affects the log chain.