Share via


SQL Server AlwaysOn- Service Restart Sequence

Question

Tuesday, August 26, 2014 9:07 AM

Team,

Most of our SQL databases are configured on AlwaysON Availability group. I was looking at best practices in restarting a SQL service. Ex: If we change any port details/windows patching etc.

I am particularly looking at the right sequence in which we restart the services.

All our databases are configured in Synchronous Failover mode. 

Regards,

Sharath

All replies (6)

Tuesday, August 26, 2014 12:19 PM âś…Answered | 1 vote

Hello,

If you must restart instances, use a rolling approach. Restart each secondary 1 by 1 to make sure they come up and synchronize back with the primary, then fail over the AG and restart the primary.

Sean Gallardy | Blog | Microsoft Certified Master


Tuesday, September 23, 2014 5:41 PM

Thanks, How about the sequence for Asynchronous configured databases in AAG? Is the same?


Tuesday, September 23, 2014 5:45 PM

Correct, I would do the asynchronous targets last as they have the most room for error.

Sean Gallardy | Blog | Microsoft Certified Master


Tuesday, September 23, 2014 5:56 PM

Thanks Sean, We are applying SP2 patches, then we must first patch secondary and then patch on primary right? Please correct me if I am wrong.....


Tuesday, September 23, 2014 6:02 PM

Yes, that's how rolling patches are done. Patch all secondaries to make sure they come up and connect to the primary. Make sure before doing the primary all of the synchronous secondaries are synchronized.

Sean Gallardy | Blog | Microsoft Certified Master


Tuesday, September 23, 2014 6:53 PM

In addition to what Sean has already mentioned, for asynchronous secondaries, you need to convert them to synchronous first and wait for the status to be synchronized before failing over to avoid data loss. Once all of the replicas have been upgraded, switch it back to asynchronous. The process is outlined here

Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
Blog | Twitter | LinkedIn
SQL Server High Availability and Disaster Recover Deep Dive Course