Following are instructions on how to install ACME sample database on DB2 UDB 8.1 (Windows) using the CLP utility (explained in Appendix E).
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.
Make sure you created the ACME database as described in the Postinstallation tasks section of Appendix D, and that your database has been started.
Open the DB2 UDB Command window (StartàProgramsàIBM DB2àCommand Line ToolsàCommand Window).
Issue the two following commands at the prompt (if you want your log files in C:\sqlbib\db2_acme\):
C:\Program 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 \load_data_db2.log
Note |
Each of these is actually one command, although the physical dimensions of the printed book dictate that they be presented in this way. |
Note |
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. |
Tip |
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.
Error |
Explanation |
Solution |
---|---|---|
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. |