<

Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

Prepare SP3 for MS SQL 2005 in a clustered environment

Published on
6,088 Points
3,088 Views
Last Modified:
Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3.

When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed by the update of the database services. After a lot of searching I found the solution to my problem.
Because I spend a lot of time figuring out why my installation failed I decided to write this article so other people won't have to spend so much time and frustration installing the service pack.
This article also covers the problem for Service Pack 2. I haven't tested Service Pack 1 with this method.

What exactly goes wrong during the update?
When I looked closely at the installation I saw that on a certain moment the setup program start some actions for services and databases. After watching the databases being created and deleted I noticed that something went wrong at the "mssqlresource" database.
The setup program tries to overwrite the "mssqlresource" database but for some reason fails what results in a rollback of that part of the installation.
 

1. Create Backups

As for any DBA you should always backup your databases before you start the installation of updates or complete service packs. In my case I didn't have many databases on my server because it was a fresh installation. I created backups of all the present databases and I copied the "master" and the "mssqlresource" to a different location.
The "mssqlresource" database isn't visible in SSMS (SQL Server Management Studio) so I had to copy the files from this database.
 

2. Take the SQL Services offline

Before you stop the services for SQL Server you should take that part of the cluster down. If you don't do this the cluster will try to start the service as soon as it goes down.
Go to the "Cluster Administrator" and select the resource group where the services for that node reside. Right-click the "SQL Server (instancename)" and click on "Take offline". Do this for every SQL Service.
 

3. Copy and rename the mssqlresource database

Now the services are down we can copy and rename the "mssqlresource" database. Go to the shared array where the database is installed and copy and paste them in that directory. In my case I rename it to "mssqlresource_old.mdf" and "mssqlresource_old.ldf" but you can use any name you want.
 

4. Start SQL Server in single-user mode

Before we can make any changes to the system databases we put the SQL Server in the single-user mode so nobody except the admins can connect to the server.
Open a command prompt and type the following command:
 
NET START MSSQLSERVER /f /T3608

Open in new window

For servers with multiple instances you can use the following command:

NET START MSSQL$instancename /f /T3608

Open in new window

 

5. Alter the mssqlresource database

Through the SQLCMD program we can send queries to the SQL Server. In the command prompt type the following command:
 
SQLCMD -S servername\instance -U adminuser -P password

Open in new window


If you're authenticated you'll see a prompt like "1>". Now we can send the ALTER queries. Type the following command for the MDF and the LDF file and press the Enter-key after each command.

- MDF File
 
ALTER DATABASE mssqlsystemresource MODIFY FILE (NAME = data, FILENAME = 'mssqlsystemresource_old.mdf')
GO

Open in new window

-LDF File
 
ALTER DATABASE mssqlsystemresource MODIFY FILE (NAME = log, FILENAME = 'mssqlsystemresource_old.ldf')
GO

Open in new window


After the completion of both commands you'll get a message that the changes will take effect after the restart of the SQL Server.
 

6. Restart the SQL Server

Stop the service with the following command:
 
NET STOP MSSQLSERVER

Open in new window


For servers with multiple instances you can use the following command:
 
NET STOP MSSQL$instancename

Open in new window


Start the service with the following command:
 
NET START MSSQLSERVER

Open in new window


For servers with multiple instances you can use the following command:
 
NET START MSSQL$instancename

Open in new window


Now you've done the necessary preparations for installing SP2 and SP3 in a clustered environment. The database files that are renamed will be replaced by new files during the installation with the original file names.
0
Comment
Author:Sander Stad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
0 Comments

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Join & Write a Comment

This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month