Tag: Patching

OS Patching in SQL Server Always On

<<Previous

This article is about DBA steps during OS Patching in SQL Server Always On and in continuation of the Steps in SQL Server Always On during OS patching. Please read the first article if you have directly landed on this page.

Till now you have seen why database backup is important and how to Validate Synchronization State. Now let’s see how to change the failover mode. Why we need to change, you already know from first article.

How to change Failover Mode:

Right Click on AG Group on Primary > Properties:

Change Failover Mode
AG Dashboard Properties

Change the Failover Mode to Manual and click OK:

Change Failover Mode
Change Failover Mode

4. Now you can apply the OS patch on secondary Node. If you are DBA then request Intel to patch the secondary server. Do not failover the cluster resources to other node. You can reboot the secondary server after reboot.

5. After secondary server comes back online, wait until databases are in SYNCHRONIZED state and make sure Failover Readiness shows No Data Loss as described in Step 2) Validate Synchronization State, described in first article.

6. Availability Group (AG) Failover:

Fail over the Availability Group (AG) to the secondary replica using SSMS (SQL Server Management Studio) and not from Failover Cluster Manager.

Right Click on AG on Primary and Choose Failover:

AlwaysOn Failover
AlwaysOn Failover

Click Next:

AlwaysOn Failover
AlwaysOn Failover

Select the new Primary Replica and click Next:

AlwaysOn Failover
AlwaysOn Failover

Next step would be to connect to the Replica to failover.

7. Wait until all the database synchronization state becomes SYNCHRONIZED. Follow the instructions in Step 2) Validate Synchronization State. (Refer first article)

8. Once all the Db status become Synchronized, you can start OS patching activity on new Secondary.

9. Keep monitoring the log file growth and if it is about to get full then we may need to remove the database from Always ON AG to prevent it from going to suspect mode.

10. Once the activity completed monitor until the databases become SYNCHRONIZED. Follow the instructions in Step 2) Validate Synchronization State.

11. Failback the AG to the original node and wait until all databases become SYNCHRONIZED. This step is not mandatory and depends upon the application setup.

12. Lastly the node acting as the primary replica, change the failover mode back to Automatic. In fact you should not forget this step. Please follow step 3) Failover Mode.

Hope this helps and leave you comments or questions.

You may also like to read the following articles:

Tempdb space issue in AlwaysOn secondary Replica

SQL Database Restore using NetBackup

{ Add a Comment }

Steps in SQL Server Always On during OS patching

This article is about detailed Steps in SQL Server Always On during OS patching. Any minor mistakes for Always On Availability Group (AG) failover during OS patching can cause huge downtime. And this is because the database can go to recovery pending state and application will not be able to connect.
Therefore it is very critical to follow proper steps. In addition to this, the article will help non DBAs or accidental DBAs as well.
One of the main idea behind implementing SQL Server Always On is to minimize downtime during any kind of patching activity.

Steps to Follow in SQL Server Always On During OS Patching
  1. Backup Confirmation:
    Please make sure we have good full/diff backups of all the databases. This is to avoid any unwanted situation. Like in worst case you may need to restore from database backup and re-establish Always On.
  2. Validate Synchronization State: Make sure that synchronization state for all databases is SYNCHRONIZED and Failover Readiness shows No Data Loss in Availability Group (AG) Dashboard.
  • Right Click on AG from Primary Server and go to Dashboard
Open Always On Dashboard
Open Always On Dashboard
  • You need to check Synchronization State is Synchronized, and Failover Readiness is No Data Loss.
    Also make sure there is no error shows in the AG Dashboard as shown below:
AlwaysOn Dashboard: Synchronization status
AlwaysOn Dashboard: Synchronization status

The above step is for you to validate that you do not loose any data during failover of Always On AG. Other synchronization State can be “Synchronizing” and Failover Readiness is “Data Loss”. In that case you got to do some work before failover.

3. Change Failover Mode:

Change the failover mode of AG group to manual. This step is to make sure to have control during Node reboot after patching. Obviously you don’t want the AG to failover automatically during the activity.

Continue Reading>>

 

{ Add a Comment }