16.10.2015 Views

Getting Started with DB2 Express-C

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3 – <strong>DB2</strong> Installation 53<br />

3.5 Silent Install<br />

There may be situations where you need to install a <strong>DB2</strong> client on multiple computers; or<br />

you need to embed a <strong>DB2</strong> data server as part of your application, and would like to install it<br />

as part of your application installation process. In these situations, a silent install is the<br />

ideal way to install <strong>DB2</strong>.<br />

<strong>DB2</strong> enables silent installs through the use of response files which store installation<br />

information as simple text options. Listing 3.1 shows a snippet of a sample response file.<br />

PROD=UDB_EXPRESS_EDITION<br />

LIC_AGREEMENT=ACCEPT<br />

FILE=C:\Program Files\IBM\SQLLIB\<br />

INSTALL_TYPE=TYPICAL<br />

LANG=EN<br />

INSTANCE=<strong>DB2</strong><br />

<strong>DB2</strong>.NAME=<strong>DB2</strong><br />

DEFAULT_INSTANCE=<strong>DB2</strong><br />

<strong>DB2</strong>.SVCENAME=db2c_<strong>DB2</strong><br />

<strong>DB2</strong>.<strong>DB2</strong>COMM=TCPIP<br />

...<br />

Listing 3.1 – A sample response file<br />

There are a number of ways to generate a response file:<br />

• Install <strong>DB2</strong> <strong>Express</strong>-C once on a computer using the <strong>DB2</strong> Installation wizard. One<br />

of the first wizard options (as shown in Figure 3.3) allows you to select the<br />

checkbox to save your install responses to a response file. At the end of the<br />

installation, the wizard generates a response file into a specified directory and<br />

filename. This is a text file, so you can manually edit it afterwards.<br />

• Edit the sample response file provided <strong>with</strong> the <strong>DB2</strong> <strong>Express</strong>-C image. This sample<br />

file (denoted <strong>with</strong> a .rsp file extension) is located in the db2/platform/samples/<br />

directory<br />

• For Windows, you can also use the response file generator command:<br />

db2rspgn –d <br />

Finally, to silently install <strong>DB2</strong> using a response file, issue the following command on<br />

Windows:<br />

setup -u <br />

On Linux, issue the command:<br />

db2setup -r

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!