Wednesday, September 16, 2009

Automating SQL 2008 w/SP1 installs

Building customer solutions can require the maintenance of many development environments; therefore, I’d rather not be spending my whole day doing watching the progress bar of some app install. In addition, each development environment may differ slightly in configuration; therefore I need the ability to just point and click for installs, yet I still need to provide the flexibility to change the installation configuration when needed. There are many ways to do this…I know folks that have built elaborate deployment tools that leverage either SQL or XML to get configurations; however here are some ideas for how I do things using syspreped VM images. This process can easily be packaged and integrated into a nice automated build process using something like SCCM.

Slipstreaming Source Installation Binaries: Installing prerequisite software is a pain, especially if you have to go back around and patch or apply a service pack. As a best practice, it is always best to build using the “most current” advertisements and patches. We all know, applying patches is something that won’t go away, however if I can reduce my deployment time by merging service packs (which always take long), I can make my process more efficient. Here is a post that provides the steps for slipstreaming SQL 2008 with SP1.

Unattended Installation: Unattended installations methods provide value from automation, in addition to insuring consistency in the configuration of a system. For example, say I’m deploying across many systems such as a web farm. I’d want the build automated versus going to each machine. SQL 2008 supports unattended installs by using a configuration file. This configuration file provides the ability to deploy SQL throughout the enterprise with the same configurations. Here is the MSDN link which covers installing SQL using configuration files.

How To: Create an installation directory to store the source installation files. Within that directory, you can store any pre-requisites. For example, mine is: \\XXX.XXX.XXX.XXX\Source\SQLServer2008Ent_FullSP1\Soruce

Within the pre-requisites directory (\\XXX.XXX.XXX.XXX\Source\SQLServer2008Ent_FullSP1\Pre-Req), I keep the following support files:

  1. .NET 3.5 SP1 (Full)
  2. KB959209 (Updates for .NET 3.5 SP1)
  3. Windows 4.5 Installer

The installation directory (\\XXX.XXX.XXX.XXX\Source\SQLServer2008Ent_FullSP1\Setup) maintains:

  1. Installation Files
  2. Configuration File (ConfigurationFile.ini) 

The following commands can be wrapped up into a batch file or installation package to be executed by the installation process.

  1. dotnetfx35.exe /qb /norestart
  2. NDP35SP1-KB958484-x86.exe /q /v /norestart
  3. wusa Windows6.0-KB942288-v2-x86.msu /quiet (will require reboot)
  4. setup.exe /SQLSVCPASSWORD="********" /AGTSVCPASSWORD="********" /ConfigurationFile="%Path to ConfigurationFile.INI%"

No comments: