If you are like most, you probable do not install the newest version of SQL Server as soon as the bits are released by Microsoft. Instead you wait for a one or more Community Updates (CUs) or the first Server Pack (SP) to be released. Why would anyone want to be on the bleeding edge and discovering bugs that cause you nothing but headaches? I know there are a few of you out that that enjoy playing with the new bits as soon as they are released, but the masses normally wait for some of the kinks to be ironed out of a new release.
If you are more in the norm of waiting to install SQL Server until a set of patches are rolled up into a CU or an SP, then you probably find yourself installing SQL Server and then turn around and install the latest set of rolled up patches. If you have a number of SQL Server installations to do you might even find yourself forgetting to install the patches on some of your servers. We are all only human and are known to make mistakes. With the introduction of SQL Server 2012’s “Product Update” feature it is much easier to incorporate the latest set of patches into a one-step installation of SQL Server. In this article I will show you a number of ways you can use Product Update to make it simple for you to make sure all of your SQL Server 2012 instances get patched with the set of updates you desire every time you install SQL Server 2012.
Problems with Manually Patching SQL Server Installation
I’ve been at a number of different shops where there are multiple DBA’s supporting many different SQL Server installations. In this type of environment usually all the DBAs agree we should all be on the same release. But in reality not everyone applies CUs and SPs consistently, even when the same person does the installations. This inconsistence is normally caused because someone forgot to apply the patches.
I have seen this mismatch of versions lead to some installations having problems while others run just fine. This typically is caused when someone installs only the Release to Manufacture (RTM) version and forgets to follow-up with an installation of the appropriate CU or SP. By using the Product Update feature of SQL Server 2012 you avoid forgetting to apply post-RTM patches.
What is the Product Update feature?
Product Update is a new feature that was incorporated in SQL Server 2012. It allows you to tell the SQL Server, during the installation process, that you want to also install updates. By telling the installation process that you want to install updates, the installation of process installs both the RTM and updated bits in a single installation step. The Product Update feature is an expansion of the Slipstream functionality that came out with SQL Server 2008, but is much easier to use.
The Product Update process can automatically find the latest updates by using the Window Update feature if your machine has an internet connection, or you can manually tell the Product Update feature how to find the updates by running the setup process from the command prompt, or modifying one of the installation ini files. You can even incorporate the updates with the product media so the Product Updates will be installed every time you install SQL Server 2012 from the updated product media. In this article I will be showing you how to run the SQL Server installation from the command prompt to incorporate CU2, as well as how you can automatically trigger the SQL Server 2012 installation process to always install CU2.
Manually Telling the SQL Server Installation Process to Apply CU2 Updates
The first thing you need to do in order to have the installation process install CU2 updates is to obtain the updated bits. You can download them by doing a Bing search for “KB2703275”. Once you have downloaded the bits and unpacked the download file you will have a single exe file.
To manually incorporate the CU2 bits into the installation process for SQL Server 2012 you need to run the installation from the command prompt, and pass it a couple of parameters. The first parameter you need to pass is the “Action” parameter to tell setup.exe that you want to install SQL Server. The next parameter you need to pass is “UpdateEnabled”. This setup parameter identifies whether or not the setup process should search for product updates. If you want it to search for updates you need to set this parameter to “True”. The last parameter you need to specify is “UpdateSource”, which is used to identify where the CU2 update executable (exe) exists. Figure 1 shows the command I enter at the command prompt window to manually start the SQL Server 2012 installation that incorporates the CU2 product updates on my Windows 7.0 laptop.
Figure 1: My command prompt window with setup.exe command
As you can see I ran the setup.exe from the SQL Server Installation folder that was on the D drive and passed my three parameters. Note that the “UpdateSource” parameter identified that my downloaded CU2 exe existed in directory “C:\Download\CU2”.
After launching the SQL Server installation this way, SQL Server will start installing. Right after the “License Term” window, the installation process shows the “Product Update” window. Figure 2 shows what my “Product Update” screen shows. On this screen you can tell I’m installing CU2 updates by looking at the HotFix that is being included, which I have circled in Red.
Figure 2: Product Updates Window
By clicking on the “Next >” button the SQL Server setup process will continue and install the original RTM bits and then the CU2 updates as a single one-step installation process.
Automatically Including CU2 Updates When You Install SQL Server
You may want to automatically have CU2 installed when you run the SQL Server 2012 setup.exe, without having to manually pass the update parameters. This can be done by modifying the DefaultSetup.ini file with the appropriate additional parameters. This ini file can be found in the X64 or X86 installation folder.
To get SQL Server to install the CU2 installation automatically when you execute the setup.exec all you need to do is first copy the SQL Server bits off the installation CD to a folder on your SQL Server machine. Once the installation files have been copied, find the appropriate installation folder (either X64 or X86) and then use your favorite text editor to open up the DefaultSetup.ini file to add the following lines to the end of the ini file:
Action="Install" UpdateEnabled=True UpdateSource="C:\Download\CU2"
Making this change to the DefaultConfigure.ini file tells the installation process, when it installs SQL Server, it needs to also look for updates in directory “C:\Download\CU2”. Once the ini file has been updated all you needed to do is just double click on the setup.exe executable and the installation process will start and then automatically look for the CU2 updates in folder “C:\Download\CU2. By modifying the DefaultSetup.ini file there is no need to pass any additional parameters when starting the SQL Server installation process.
Creating a New ISO Image That Contains CU2
In most SQL Server shops you will find you need to install SQL Server 2012 across many servers. Today most people are installing SQL Server on virtualized machines, and they use an ISO image to identify the SQL Server 2012 media. Therefore if you want to have your RTM version of SQL Server automatically install CU2 you will need to modify the ISO image.
To do this just copy the bits off the ISO image to a directory. Then in that directory somewhere copy the downloaded CU2 executable. I typically just create a new directory and then place the CU2 exe into that directory. Lastly I modify the DefaultSetup.ini file like I did in the prior section. Once all those changes are done, you can then use your favorite ISO burning software to create a new ISO image that contains your new installation files, including the modified DefaultSetup.ini file and the CU2 exe.
To make sure all your future installations install the RTM along with the CU2 updates all you need to do is make sure your updated ISO image is the one that you mount for each and every one of your virtual machine SQL Server installations.
One-Step Installation Process
I’ve worked at a number of different SQL Server shops, and I always find that people take the installation CD and install SQL Server and think they are done. They forgot to install the currently available Community Update or Service Pack. This causes a number of different SQL Server installations to be running different versions of SQL Server. Or they might first install the RTM version, and then once that is completed turn around and run the Community Update version or Service Pack installation, which is more time consuming. By using the techniques I’ve shown you in this article you can make sure your new SQL Server 2012 installations are installed and patched in a one-step installation process by using the new “Product Update” feature that came with SQL Server 2012. There is no longer the need to run multiple installations exe’s to install and patch SQL Server 2012.