Unattended installation of SQL Server

Unattended installation of SQL Server

It is a third post on series related to installation and configuration of SQL Server installations.

This series is for professionals who start their journey with SQL Server administration and also for those who want to extend and structure their knowledge on SQL Server administration.

Preparations

We are starting with the following assumptions:

  1. All steps described in this first blog post has been configured
  2. ISO file with SQL Server binaries and Cumulative Update files are available – steps how to download it are described in previous blog post 
  3. There is a connection between Windows server and domain controller
  4. No issues with connectivity with Active Directory domain (no AD-related errors in System Event Log)

Use case

Imagine a situation when you are tasked to install a dozen SQL Server instances. Using an approach described in previous blog post  installation can take a significant amount of resources and time, also there is a probability of errors due to typos (e.g. in directory paths, etc.)
There are two options that can be used for the installation:

  1. Using ConfigurationFile.ini
  2. Using command line parameters to setup.exe file

Below there are step-by-step instructions on how to install SQL Server using both options.

Installation of SQL Server using ConfigurationFile.ini

In the previous post on one of the last configuration screen (Ready to Install), I have marked the path to ConfigurationFile.ini generated automatically by the installer. This file contains all of the settings that you have selected during installation using GUI.
Let’s go to C:Program FilesMicrosoft SQL Server140Setup BootstrapLog<date_time> location

Let’s have a look at the ConfigurationFile.ini file:

Inside file we have several sections that are interesting for us:

  1. QUIET – determines if a user interface is disabled
  2. QUIETSIMPLE – Setup will display  progress only, without any user interaction
  3. UIMODE – defines how User Interface will be displayed, requires that QUIETSIMPLE is set to True
  4. UpdateEnabled – allows installation of updates
  5. UpdateSource – specifies the location of updates
  6. INDICATEPROGRESS – specifies that the detailed log will be shown on the console

Having all these parameters we can start installing SQL Server using different modes

Manual installation with populated configuration settings

In this sections following parameters will be used:

  1. QUIET=”False”
  2. QUIETSIMPLE=”False”
  3. UIMODE=”Normal”
  4. UpdateEnabled=”False”
  5. UpdateSource=”MU”
  6. INDICATEPROGRESS=”False”

To start installation run command line and provide the following command:

where E: is the path to SQL Server binaries.

After running above command, GUI installation with start with values already provided

All of the configuration values are taken from ConfigruationFile.ini.

Manual installation with populated configuration settings using latest Cumulative Update located in D:DBAUpdates directory

In this sections following parameters will be used:

  1. QUIET=”False”
  2. QUIETSIMPLE=”False”
  3. UIMODE=”Normal”
  4. UpdateEnabled=”True”
  5. UpdateSource=”D:DBAUpdates”
  6. INDICATEPROGRESS=”False”

To start installation run command line and provide the following command:

where E: is the path to SQL Server binaries

After running above command, GUI installation with start with values already provided.

All of the configuration values are taken from ConfigruationFile.ini.

Automated installation using latest Cumulative Update from D:DBAUpdates directory with progress indication

In this sections following parameters will be used:

  1. QUIET=”False”
  2. QUIETSIMPLE=”True”
  3. ;UIMODE=”Normal” <- commented out
  4. UpdateEnabled=”True”
  5. UpdateSource=”D:DBAUpdates”
  6. INDICATEPROGRESS=”False”

To start installation run command line and provide the following command:

where E: is the path to SQL Server binaries

After running above command, the installation will start using values from the configuration file.

After setting up all installation file, installation of SQL Server itself will start.

After completing this step SQL Server is ready for use.

Fully automated installation using latest Cumulative Update from D:DBAUpdates directory

In this sections following parameters will be used:

  1. QUIET=”True”
  2. QUIETSIMPLE=”False”
  3. ;UIMODE=”Normal” <- commented out
  4. UpdateEnabled=”True”
  5. UpdateSource=”D:DBAUpdates”
  6. INDICATEPROGRESS=”True”

To start installation run command line and provide the following command:

Where E: is the path to SQL Server binaries

There will be no GUI window displayed, the only information is shown on the console. Once all steps complete SQL Server is ready for use.

Installation of SQL Server using a command line

An alternative option is to use command line parameters to install SQL Server. In the following example, I am going to install SQL Server with indication of installation.

For the installation following parameters are provided:

  • QS
  • ACTION=Install
  • FEATURES=SQLENGINE
  • ENU
  • UpdateEnabled=1
  • UpdateSource=”D:DBAUpdates”
  • INSTANCEDIR=”D:MSSQLServer”
  • INSTANCENAME=MSSQLSERVER
  • SQLSVCACCOUNT=”DATACOMMUNITYSQLServerEngine$”
  • SQLSYSADMINACCOUNTS=”DATACOMMUNITYadministrator”
  • AGTSVCACCOUNT=”DATACOMMUNITYSQLServerAgent$”
  • AGTSVCSTARTUPTYPE=”Automatic”
  • BROWSERSVCSTARTUPTYPE=”Disabled”
  • INSTALLSQLDATADIR=”D:MSSQLServer”
  • SQLBACKUPDIR=”D:SQLBackup”
  • SQLCOLLATION=”SQL_Latin1_General_CP1_CI_AS”
  • SQLSVCSTARTUPTYPE=”Automatic”
  • SQLTEMPDBDIR=”D:SQLTempDB01″ “D:SQLTempDB02” “D:SQLTempDB03” “D:SQLTempDB04”
  • SQLTEMPDBLOGDIR=”D:SQLTLog”
  • SQLUSERDBDIR=”D:SQLData00″
  • SQLUSERDBLOGDIR=”D:SQLTLog”
  • SQLTEMPDBFILECOUNT=4
  • IACCEPTSQLSERVERLICENSETERMS

Having all parameters together, command will look like as follows:

After running above command, installation will start

After installation, the progress window will be closed and SQL Server is ready for install.

This option my preferred way to install SQL Server. If you are interested in PowerShell script for unattended SQL Server installation based on provided parameters, visit my GitHub repository.

Summary

In complex environments installation of SQL Server instances can be a tedious task that can be easily automated. This blog post extensively describes methods of possible installation.
Also, smaller environments can benefit from this approach by minimizing the time needed for installation, keeping quality on the same level. Every time when you want to use unattended installation SQL Server, check this blog post for all steps.

Links

More information about steps described above can be found on the following sites:
Install SQL Server using a configuration file
Install SQL Server from the Command Prompt
https://github.com/michalsadowski/SQLBuild

Previous The most-read posts in 2018
Next Last Week Reading (2019-01-06)

About author

Michal Sadowski
Michal Sadowski 3 posts

Senior Database Platform Engineer, leader of Krakow chapter of Data Community Krakow - PASS Chapter. With more than 10 years of experience in Microsoft technology, helps in advisory for performance optimization on database and application levels. Holds many Microsoft certificates including MCSA: Windows Server 2008/2012/2016, MCSA: SQL Server 2012/2014/2016, MCSE: Data Platform and MCT.

View all posts by this author →

You might also like

Last week reading (2018-11-18)

No, you don’t need a blockchain Thomas LaRock (T) says: “Don’t buy a blockchain solution unless you know for certain you need one.” Anatomy of a spool Hugo (T) collected

Last Week Reading (2019-01-06)

Good morning chaps! Bunch of news from data’s world freshly served. Press Introduction to Testing Your PowerShell Code with Pester Robert Cain introduces us Pester for making tests. 9 popular

Last week reading (2018-07-15)

Structured Streaming with Databricks into Power BI & Cosmos DB Giuliano Rapoz (Microsoft) is showing the concept of Structured Streaming with all these puzzles. Lightning fast query performance with Azure

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply

63 − 58 =

Protected with IP Blacklist CloudIP Blacklist Cloud