Browse All Articles > Prepare SP3 for MS SQL 2005 in a clustered environment
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:
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.
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.
Comments (0)