Appendix F: Installing the ACME Database

Appendix F: Installing the ACME Database

This appendix explains how to install the sample ACME database on the RDBMS of your choice. Refer to the section that corresponds to the database platform you've created.

Installing the ACME Sample Database on Oracle 9i (Windows) Using SQL*Plus

Following are instructions on how to install ACME sample database on Oracle 9i (Windows) using the SQL*Plus utility (explained in Appendix E).

  1. If the Oracle services are not started, start them as described in Appendix D.

  2. Copy the D:\sqlbib\oracle_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.

  3. Start SQL*Plus from the command line by typing:

    C:\> sqlplus
    			 /nolog
  4. If you want to create a log file, use the spool command (described in Appendix E). For example, if you want the resulting log file load.log to be created in the same directory, the other files you need are:

    SQL> spool
    			 C:\sqlbib\oracle_acme\load.log
  5. Run script C:\sqlbib\oracle_acme\load.sql:

    SQL>
    			 @C:\sqlbib\oracle_acme\load.sql
    
  6. This script creates the Oracle ACME database. Stop spooling (if started) by issuing:

    SQL> spool
    			 off
  7. Type quit to exit SQL*Plus.

    Note 

    Script  load.sql runs two other scripts,  create_acme_ora.sql and  load_data_ora.dat. The first one creates RDBMS objects (tables, indexes, constraints, views, and so on) and the second script 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  load.sql and  create_acme_ora.sql as many times as you want to create a loaded or empty ACME database, correspondingly.

When you run your script for the first time, you may see ORA-00942 errors (table or view does not exist). That is not a problem; the script is trying to drop tables that do not yet exist.

The most common errors you may see in your log file are in Table F-1.

Table F-1: Common Errors from Running Oracle Scripts

Error

Explanation

Solution

ORA-12560: TNS: protocol adapter error

Oracle is not started.

Start Oracle and try running your scripts again.

ORA-12154: TNS: could not resolve service name

You supplied an incorrect service name.

You don't need to supply a service name, just user ID and password.

ORA-01031: insufficient privileges

You are not a member of ORA_DBA OS group.

Either log in as a user who is a member of the ORA_DBA group or add current user to the ORA_DBA group.

ORA-01033: Oracle initialization or shutdown in progress

Oracle is being started.

Wait and try again.