HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Should I pause Mirroring and stop SQL Server services before running windows updates?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
serversqlpausestopservicesrunningwindowsmirroringandbefore

Problem

I am running Windows update on my SQL Servers (which are in a Principal-Mirror partnership, in High Safety mode).

I am starting with updating the mirror and I was wondering, to increase safety, should I pause mirroring and stop SQL Server Services and then run Windows Update? Or is this totally unnecessary?

Solution

Suggest you to PAUSE mirroring and then patch the windows.

Ideally, I would follow below approach :

-
If you have a witness configured, turned it OFF as during the patching, if sql server service is restarted or the server reboots, then a witness will initiate a failover.

ALTER DATABASE [db_name] SET WITNESS OFF


-
Always patch the current mirrored server, so if things go wrong, then you atleast have your principal ON.

  • Reboot the mirror server (if necessary)



-
Now failover to the newly patched mirror server. Run below T-SQL on the current Principal server ALTER DATABASE [your database] SET PARTNER FAILOVER

-
Once the failover is completed, patch the current mirror (which was originally primcipal)

  • Reboot if necessary



-
Now failback to the original principal server.

-
Add back the witness (if removed from step 1)

ALTER DATABASE [db_name] SET WITNESS = 'TCP://[FQDN]:[port_number]'

-
As a saftey measure, run DBCC CHECKDB on your databases.

From BOL :

Code Snippets

ALTER DATABASE [db_name] SET WITNESS OFF

Context

StackExchange Database Administrators Q#58229, answer score: 4

Revisions (0)

No revisions yet.