Configure an IBM DB2 database for new Brand Mobiliser
installations.
Prerequisites
- Install the DB2 database.
- 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.
- To add system groups, on the command line, run:
groupadd -g 999 db2iadm1
groupadd -g 998 db2fadm1
groupadd -g 997 dasadm1
- 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
- For each new user, change the password:
passwd mwiz2
passwd db2fenc1
passwd dasusr1
The default password for each user is “sql.”
- Create a DB2 instance:
$ pwd
/opt/IBMdb2/V9.7/instance/
$ ./db2icrt –a server –u db2fenc1 mwiz2
- Verify the database installation:
- Log in as mwiz2, using the password set in step 3.
- Start the database manager:
db2star
- Create the sample database:
db2sampl
- Start the DB2 command line processor:
db2
- Connect to the sample database:
connect to sample
- 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.
- Connect to the newly created brandmob database as the mwiz2
user:
db2 connect to brandmob user mwiz2 using sql
- Insert initial data and create the admin user:
04-BrandMobiliser-Base-Data.sql
Next
Enable the DB2 JDBC driver.