Installing the ACME Database on DB2 UDB 8.1 (Windows) Using CLP

Installing the ACME Database on DB2 UDB 8.1 (Windows) Using CLP

Following are instructions on how to install ACME sample database on DB2 UDB 8.1 (Windows) using the CLP utility (explained in Appendix E).

  1. Copy the D:\sqlbib\db2_acme (where D is the letter of your CD-ROM drive) directory from the CD-ROM that comes with your book to the C:\ directory of your computer.

  2. Make sure you created the ACME database as described in the Postinstallation tasks section of Appendix D, and that your database has been started.

  3. Open the DB2 UDB Command window (StartàProgramsàIBM DB2àCommand Line ToolsàCommand Window).

  4. Issue the two following commands at the prompt (if you want your log files in C:\sqlbib\db2_acme\):

    			 Files\IBM\SQLLIB\BIN> db2 –tvfC: \sqlbib\db2_acme\create_acme_db2.sql
    			 -zC:\sqlbib\db2_acme\ create_acme_db2.log C:\Program Files\IBM\SQLLIB\BIN>
    			 db2 -tvfC: \sqlbib\db2_acme\load_data_db2.dat -zC:\sqlbib\db2_acme

    Each of these is actually one command, although the physical dimensions of the printed book dictate that they be presented in this way.


    Script  create_acme_ora.sql creates RDBMS objects (tables, indexes, constraints, views, and so on) and script  load_data_ora.dat populates ACME tables with data. You may want to run the first script by itself before trying the examples from Chapter 6. You can run  create_acme_ora.sql as many times as you want to create empty ACME database.


    When you run your scripts for the first time, you may see some messages at the beginning of your log file saying something like: <TABLE_NAME> IS UNDEFINED NAME. The message is not an error but rather a warning; your tables have not been created yet, so ignore it.

Some common errors from running DB2 scripts are shown in Table F-2.

Table F-2: Common Errors from Running DB2 Scripts




DB21061E Command line environment not initialized.

You are trying to execute db2 commands from a command line prompt rather than from the DB2 Command Window.

Start the DB2 Command Window and try again.

SQL0900N The application state is in error. A database connection does not exist. SQLSTATE=08003

You supplied an incorrect service name.

Specify the correct service name.

SQL1032N No start database manager command was issued. SQLSTATE=57019

Database services are not started.

Start database services as described in Appendix D.