Time Required: 60 minutes
Objective: Undertake an installation of the SQL Server 2012 by running setup.exe from the command prompt.
Description: This activity guides you through the steps necessary to install a second named instance, SQLSERVERUA2, by running setup.exe from the command prompt. For simplicity, this instance will only include the database engine that represents the minimum feature set for completing a new SQL Server 2012 Enterprise Edition install. On completion of the activity, you should understand how to use the SQL Server parameters to tailor the features to meet your specific business requirements. The same set of features can be installed using the command prompt installation as with the SQL Server Installation Wizard. Because you will only be installing the database engine, and not any of the shared features, you will only need approximately 1 GB of free disk space on your local drive to complete this activity.
1. If necessary, start your computer and log on using an Administrator account.
2. To open a Web browser, click the Start button, point to All Programs, and then click Internet Explorer. See Figure 2-39.
Figure 2-38 SQL Server physical folder structure
Microsoft Windows Server 2008 R2
2
3. Click in the Address bar, and type the following URL: msdn.microsoft.com/library to access the MSDN Library. In the Search MSDN with Bing box in the upper-left corner of the page, type SQL Server 2012 Command Prompt and click the Search icon. In the search results, click the top link, Install SQL Server 2012 from the Command Prompt, to open the Books Online for SQL Server 2012 “Install SQL Server 2012 from the Command Prompt” topic. See Figure 2-40.
This page lists the SQL Server parameters that are supported when creating a command-line script. For each component, certain parameters are required—while others are optional. In the list of SQL Server components, focus in particular on the SQL Server Setup Control and SQL Server Database Engine components. These parameters can be entered as a list separated by spaces on the command prompt or by adding them to a configuration .ini file and referencing the location of this file from the command line.
4. Mount the installation image file as a virtual drive or insert the DVD into your DVD drive if using physical media. Click the Start button and then click Computer from the Start menu. Note the drive letter of the removable storage with the mounted installation media. In Figure 2-41, SQLFULL_ENU is mounted on the E drive.
Figure 2-39 Open Internet Explorer from the All Programs menu
Microsoft Windows Server 2008 R2
5. Click the Start button, and from the Start menu click Run. In the Open text box, type cmd. See Figure 2-42.
6. Click OK to launch the command-line prompt (C:\Windows\System32\cmd.exe). At the command prompt, type the drive letter that you noted in Step 4 followed by : and then press the Enter key.
> E:
Figure 2-40 “Install SQL Server 2012 from the Command Prompt” topic in Microsoft Books Online for SQL Server 2012
Source: Microsoft Internet Explorer
Figure 2-41 View the removable storage devices using Windows Explorer
Microsoft Windows Server 2008 R2
2
7. Type whoami at the command prompt, and then press the Enter key to find the domain or computer name and username of the Windows Administrator account that you are using.
E:\> whoami
8. Type the SQL Server command-line application name setup.exe followed by the SQL Server Setup Control and SQL Server Database Engine parameters and then press Enter.
Note that depending on your screen buffer width setting, the line may wrap onto ad-ditional lines in the Command Prompt window. You may find it easier to prepare this command using a text editor and then copy and paste it into your command prompt.
E:\> setup.exe /ACTION=INSTALL /Q /FEATURES=SQLEngine /INSTANCENAME=SQLSERVERUA2 /SQLSYSADMINACCOUNTS=<Computer Name>\<UserName> /IACCEPTSQLSERVERLICENSETERMS
The parameters instruct the SQL Server Installer application setup.exe to install a new named instance of the database engine called SQLSERVERUA2 in quiet mode.
Quiet mode does not display any output in the user interface and is intended for unattended installations. Microsoft requires you to include the parameter /IACCEPT-SQLSERVERLICENSETERMS in order to accept license terms and conditions for quiet mode installations. You will need to replace <ComputerName>\<UserName>
with the output of the whoami command. This account will be added to the SQL System Administrators group, which will enable you to manage the installation once setup is complete. In Figure 2-43, win-tdtqpo1976n is the computer name and gschofield is the username of the administrator’s account.
Figure 2-42 Open a Command Prompt window
Microsoft Windows Server 2008 R2
Figure 2-43 Run the SQL Server Installer application setup.exe from the command prompt
Microsoft Windows Server 2008 R2
9. Click Yes if prompted by the User Account Control dialog box.
10. A setup.exe console window appears while the installation program is running. See Figure 2-44.
Once the installation process is complete, this window will automatically close.
Because quiet mode was selected using the /Q parameter, no other dialog boxes will appear during setup. You can change this behavior to display progress by using either the /QS parameter, which will install in quiet simple mode and display progress messages, or the /INDICATEPROGRESS parameter, which will send the log output directly into the console.
11. Click the Start button and then click Computer from the Start menu. Click in the Navigation text box, type C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\ and then press the Enter key. This opens the root folder location of the SQL Server Setup logs. Double-click the Summary document to view a summary of the installation that you performed. At the start of the file, you will see the Final result, which is either Passed or Failed. See Figure 2-45.
Figure 2-44 SQL Server Installer console
Microsoft Windows Server 2008 R2
Figure 2-45 SQL Server Installer Log window
Microsoft Windows Server 2008 R2