Creating and populating database tables for assets in DB2 with batch files

Use batch files and database scripts to create and populate tables in IBM® DB2® for IBM Rational® Asset Manager.

Before you begin

If you are using IBM WebSphere® Application Server and will be using the server setup application on a supported operating system other than z/OS®, you can skip this task because the server setup application can create and configure the databases for you.

If you prefer to create the database and tables manually, see Creating database tables for assets in DB2 manually.

You can create the database and tables automatically by running batch files. DB2 must already be installed and running. Ensure that you know the location of the SQL scripts that are included in the installation media. The location is install_location\ram\DatabaseScripts\DB2 if you installed by using Installation Manager. You must also know the installation directory for DB2 (typically C:\Program Files\IBM\SQLLIB for Windows and opt/IBM/DB2/V10.1 for Linux, AIX®, or Linux for zSeries.

On Linux, AIX, or Linux for zSeries, log in as a user with sufficient privileges to create the database. For example, log in as the DB2 instance owner. The default user is db2inst1.

You will use the following scripts:
  • For Windows: dbcreate_populate.bat
  • For Linux:For AIX: dbcreate_populate.sh
  • For Linux for zSeries: dbcreate_populate_zLinux.sh
  • dbcreate.sql
  • RAMSCHEMA_DB2.sql
  • bootStrap_DB2.sql

Procedure

  1. If you are installing from the CD, then copy the SQL scripts to your local file system.
  2. For Linux:For AIX:For Linux for zSeries: Check that you have write permission for the directory containing the SQL scripts.
  3. In a command line, change to the directory containing the SQL scripts for DB2 (path to installation media\ db_scripts\DB).
  4. Run the following batch file:
    • For Windows: dbcreate_populate.bat
    • For Linux:For AIX: dbcreate_populate.sh
    • For Linux for zSeries: dbcreate_populate_zlinux.sh
  5. When prompted, enter the name of the database or press the Enter key to accept the default database name (RAMDB).
  6. At the next prompt, enter the installation directory path for DB2, or press the Enter key to accept the default value (C:\Program Files\IBM\SQLLIB for Windows, and /opt/IBM/DB2/V10.1 for Linux, AIX, or Linux for zSeries.
  7. The batch file runs. The script performs the following actions:
    • A database with the name that you entered is created.
    • Tablespace is configured for the database.
    • Tables and schema for RAM are created in the database.
    Note: When you run the batch file for the first time, you might see a number of SQL0204N error messages that name is an undefined name, and they will be similar to the following example:
    ** CLI error in executing the SQL statement:
    (-204): [IBM][CLI Driver][DB2/NT] SQL0204N  "RAMSCHEMA.FORUM" is an undefined name.  SQLSTATE=42704
    If you are running the batch file for the first time, then you can safely ignore these messages.
  8. Verify that the tables were created. For example, start the DB2 Control Center and browse for the RAMDB database. Verify that the database and tables were created.

What to do next


Feedback