Configuring DB2 Databases

Configure an IBM DB2 database for new Brand Mobiliser installations.

Prerequisites
  1. Install the DB2 database.
  2. Create a new hashed password for the admin user, and save it in the /sql/common/1.3.1/04-BrandMobiliser-Base-Data.sql script.
Task

To complete this task, you must either be a root user or have sudo privileges. DB2 database scripts are located in the BRAND_HOME/sql/db2/1.3.1 directory.

  1. To add system groups, on the command line, run:
    groupadd -g 999 db2iadm1
    groupadd -g 998 db2fadm1
    groupadd -g 997 dasadm1
  2. To add system users, run:
    useradd -u 1004 -g db2iadm1 -m -d /home/mwiz2 mwiz2   
    useradd -u 1003 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1   
    useradd -u 1002 -g dasadm1 -m -d /home/dasusr1 dasusr1 
  3. For each new user, change the password:
    passwd mwiz2
    passwd db2fenc1
    passwd dasusr1 

    The default password for each user is “sql.”

  4. Create a DB2 instance:
    $ pwd   
    /opt/IBMdb2/V9.7/instance/   
    $ ./db2icrt –a server –u db2fenc1 mwiz2 
  5. Verify the database installation:
    1. Log in as mwiz2, using the password set in step 3.
    2. Start the database manager:
      db2star
    3. Create the sample database:
      db2sampl
    4. Start the DB2 command line processor:
      db2
    5. Connect to the sample database:
      connect to sample
  6. Create the brandmob database and grant DBA privileges to the mwiz2 user, by running:
    01-BrandMobiliser-DB_DB2.sql

    Ensure that the current DB2 instance has write privileges to the data directory, which the script assumes is /home/db2.

  7. Connect to the newly created brandmob database as the mwiz2 user:
    db2 connect to brandmob user mwiz2 using sql
  8. Insert initial data and create the admin user:
    04-BrandMobiliser-Base-Data.sql
Next
Enable the DB2 JDBC driver.
Related tasks
Enabling the DB2 JDBC Driver