Control doesn't pass to the next command until the installation is finished. Using the start /wait option is especially important when you invoke the installation from a batch file that includes other activities that are dependent on the installation. For example, suppose you want to write a batch file that performs an unattended installation of an instance named INST1, starts the SQL Server service, and runs a .sql script file that creates a database and its objects (e.g., tables, stored procedures). The batch file might look like this:
start /wait D:\X86\Setup\setupsql.exe -s -f1 C:\WINNT\setup.iss
NET START MSSQL$INST1
OSQL /E /I "c:\data\scripts\createappdb.sql"
If you don't use the start /wait option, control moves to the second command in the batch as soon as the installation starts, and the NET START command tries to start a service that doesn't exist yet.
Troubleshooting an unattended installation is much trickier than troubleshooting a standard installation. A standard installation usually informs you when the setup program experiences a problem by displaying a dialog box containing an error message accompanied by a loud beep. An unattended installation simply terminates with no interactive notice.
To see how you can troubleshoot an unattended installation, let's look at a couple of problems I've encountered. Suppose you've just finished installing another product on the server, then you attempt to run an unattended installation of SQL Server. The setup program detects that the server wasn't restarted after the previous installation and aborts with no notice. If you keep an open Task Manager window, you'll notice that the setupsql.exe program isn't active and that SQL Server wasn't installed. You should also examine the log files. Upon successful installation, the \WINNT\setup.log file should show 0 as the error code; however, in the scenario I described, it would probably show -1, which signifies a General error. Also, you should see the error message A previous program installation created pending file operations on the installation machine. You must restart the computer before running setup.
Another error I've encountered several times when performing unattended installation is Dialog boxes are out of order. I realized that a problem existed soon after I invoked the installation, when I opened the Task Manager and saw that setupsql.exe was running but no processes were loading and unloading as is typical with an unattended installation that's running properly. Also, the folders that installation usually creates under \Program Files\Microsoft SQL Server hadn't been created. The setupsql.exe program didn't seem to be using CPU or I/O resources and simply disappeared after about 10 minutes. The setup.log file showed a -12 error code, and the sqlstp.log file showed no errorin fact, it seemed unfinished. Sqlstp contained no completion notification, just a message saying Begin Action: DialogShow<dialogname>. BOL says the following about error code -12: "Dialog boxes are out of order. This is a common error, caused when a dialog box appears out of order in the setup initialization file (Setup.iss). This can occur due to a system problem during the creation of Setup.iss." Sure enough, after I re-recorded a setup.iss file, the unattended installation completed successfully.
In addition to a full installation, you can also perform an unattended installation of a SQL Server 2000 service pack. To apply a service pack to the default instance, invoke the setupsql.exe program from the service pack installation folder, and specify the answer file sql2kdef.iss, which resides in the root service pack installation folder. For example, if the service pack installation files are in c:\sql2ksp2, issue the following command:
start /wait c:\sql2ksp2\x86\setup\setupsql.exe -s -f1 c:\sql2ksp2\sql2kdef.iss
To apply a service pack to a named instance, use the sql2knm.iss answer file, but first revise the following two lines in the file to reflect the appropriate instance name:
InstanceName=INSTANCE_NAME
NMPPipeName=\\.\pipe\MSSQL$INSTANCE_NAME\sql\query
Another advanced option, remote installation, lets you install SQL Server 2000 on a remote computer. You could manually record a setup.iss file from a local computer, copy it to the remote computer, and activate the setupsql.exe program and the setup.iss file on the remote computer. However, you can save yourself the trouble by running the setupsql.exe program on a local computer, choosing Remote Computer in the Computer Name dialog box, and specifying the computer name you want to install to. When you click Next, the Remote Setup Information dialog box shown in Figure 10 appears.
You first provide account details (user, password, domain), the Universal Naming Convention (UNC) path to the target folder (e.g., \\LABYRINTH\C$\Program Files\Microsoft SQL Server), and the UNC path to the source installation files (e.g., \\SERVER1\Install\SQL2KE\X86\Setup). Next, the installation program walks you through the regular installation dialog boxes and records the setup.iss file according to your selections. The program then copies the setup.iss file to the target computer's \WINNT folder and activates setupsql.exe along with the copied setup.iss file.
If you open Task Manager on the remote computer, you can see the setupsql.exe process loading and unloading other processes during the installation. On the local computer, the setup program shows that the remote installation is in progress and notifies you when it's finished.
The Final Word
Although a basic installation can be simple, you need to pay close attention to the installation options you choose, and understand them thoroughly. Good installation choices provide a firm foundation for running and administering SQL Server. And if you thought performing unattended and remote installations sounded complex, I hope that this article helps you feel more comfortable with them.
End of Article
Prev. page
1
2
3
[4]
next page -->