To install DB2 manually follow the below steps:
- Download DB2 v.8.x for Linux (I downloaded v. 8.1 Express) and transfer the gzip’ed tar-file to the Linux box.
- Unpack the distribution to the /tmp directory:
tar zxf DB2ExE82_Linux.tar.gz -C /tmp
- Change to root and go to the unpacked DB2 directory and start the installation:
cd /tmp/Linux ./db2_install
- Select the package to install – I chose “DB2.EXP” since I was installing DB2 Express.
- Create an user for the DB2 instance and an user for the administration server (make sure the users belong to a valid group and that the users have a home directory):
useradd db2inst1 useradd db2as groupadd db2inst1 groupadd db2as mkdir /home/db2inst1 mkdir /home/db2as chown db2inst1:db2inst1 -R /home/db2inst1 chown db2as:db2as -R /home/db2as <associate the group with the user e.g. using yast under SuSE or manually editing the /etc/groups file if you are so inclined>
- Create an instance:
cd /opt/IBM/V8.1/instance ./db2icrt -u db2inst1 db2inst1
- Create the administration server:
cd /opt/IBM/V8.1/instance ./dascrt -u db2as
- Set the environment for the db2inst1 user by adding the following to the users ~/.profile:
./sqllib/db2profile export DB2INSTANCE=db2inst1 export DB2PATH=~/sqllib export PATH=$PATH:$DB2PATH/bin
- Log in as the db2inst1 user and check the installation by creating the SAMPLE database:
su - db2inst1 db2sampl
Sources:
- informit.com