Creating and populating database tables for assets in DB2 manually

These are the instructions for manually configuring IBM® DB2® and creating and populating tables for IBM Rational® Asset Manager in DB2.

Before you begin

If you are using IBM WebSphere® Application Server and will be using the server setup application, you can skip this task because the server setup application can create and configure the databases for you.

DB2 must already be installed and running. Also, make sure that you know the location of the SQL scripts that are included with the installation media (typically, path to installation media\ db_scripts\DB2). Finally, ensure that you also know the installation directory for DB2 (typically C:\Program Files\IBM\SQLLIB for Windows, opt/ibm/DB2/V9.7 for Linux and /opt/IBM/db2/V9.7 for AIX®.

About this task

You can optionally use batch scripts to simplify this process. See Creating and populating database tables for assets in DB2 with batch files.

Procedure

To configure DB2 and create the database tables:

  1. Start the DB2 Control Center.
  2. Select the instance of the database.
  3. Create and add a new database.
    1. Click Tools > Command Editor.
    2. In the command editor, type (in uppercase):
      ATTACH TO <DATABASE_INSTANCE>
      (where <DATABASE_INSTANCE> is the name of the database instance you selected in step 2)
    3. Click Execute.
    4. Clear the previous command from the command editor and type (in uppercase):
      CREATE DATABASE <DATABASE_NAME> AUTOMATIC STORAGE YES USING CODESET UTF-8 TERRITORY US
      (where <DATABASE_NAME> may be any name you choose; for example, RAMDB)
    5. Click Execute.
    6. Click Add, select the database you just created, and click OK.
  4. Execute the dbcreate.sql script.
    1. Click Open.
    2. Navigate to the dbcreate.sql file.
    3. Click OK.
    4. Click Yes.
    5. Click Execute.
  5. Execute the RAMSCHEMA_DB2.sql script.
    1. Click Open.
    2. Navigate to the RAMSCHEMA_DB2.sql file.
    3. Click OK.
    4. Click Yes.
    5. In the Statement termination character text field, in place of the default semi-colon character ( ; ), type a caret ( ^ ).
    6. Click Execute.
  6. Execute the bootstrap_DB2.sql script.
    1. Click Open.
    2. Navigate to the bootstrap_DB2.sql file.
    3. Click OK.
    4. Click Yes.
    5. In the Statement termination character text field, in place of the caret ( ^ ), type a semi-colon ( ; ).
    6. Click Execute.
  7. Verify that the tables were created.
    1. Click Object View and open the database instance.
    2. Click Tables to verify that the tables contain data.

What to do next


Feedback