Creating and configuring a database for DB2 UDB 6.1

Before you can effectively run WebSphere Application Server, you must create a DB2 UDB instance and the was database, which WebSphere Application Server uses.

Creating a database instance

  1. Ensure that you are logged into the machine with superuser (root) privileges.
  2. Create an administrative group for DB2 and name it, for example, db2adm.
  3. Create a user ID to be the DB2 instance owner and name it, for example, db2inst1. Specify db2adm as the group for db2inst1. For the steps in this section, use a password such as ibmdb2. Note that DB2 requires a password of 8 or fewer characters.
  4. Add db2inst1 and root to the db2adm group.
  5. Create a database instance by entering the following at a command prompt:
    # /opt/IBMdb2/V6.1/instance/db2icrt -u db2inst1 db2inst1
  6. Create symbolic links:
    # /opt/IBMdb2/V6.1/cfg/db2ln
  7. Optionally, install the sample database. As root, set the environment variable DB2INSTANCE to db2inst1, then run:
    # /opt/IBMdb2/V6.1/samples/db2sampl
  8. Configure the instance owner to run db2profile on startup. For ksh, add the line below to the instance owner .profile. Note the space between the period (.) and the first forward slash (/). . /home/db2inst1/sqllib/db2profile

    For csh, add the following line to the .cshrc of the instance owner:

    source /home/db2inst1/sqllib/db2cshrc
  9. Configure root to run the db2profile on startup. This is required to install and run WebSphere Application Server.
  10. As user db2inst1, run db2start to start DB2.

Configuring a database for the administrative configuration

Because this is the first installation, create a database to store the configuration. The was database will be defined by its JDBC URL as jdbc:db2:was. Create the was database and set its DB2 application heap size by entering the command:

$ db2 create database was

Wait a while, then enter the command below to set the application heap size:

$ db2 update db config for WAS using applheapsz 256

Restart the machine. If an application heap size of 256 doesn't work for your system, increase the size to, for example, 512.

To verify the connection to the was database, log in as db2inst1 and then enter the command:

$ db2 connect to was