Installing IBM DB2 8.2.4 Express on Linux

Install Compatibility Libraries

Since DB2's installer is Java-based, it requires libXp.so, which is a deprecated X11 library. If you're trying to install DB2 on Fedora Core 5 or another linux distribution of similar or newer vintage than you'll need to get that library. For FC5, you can install the xorg-x11-deprecated-libs RPM using:

yum install xorg-x11-deprecated-libs

For other rpm based platforms, you may need to find the appropriate RPM on rpmfind and install it using rpm -i.

DB2 Installation

IBM DB2 V8.2.4 was once available the IBM website as a tarball. Extract the tarball using tar xfz and cd into the db2exc_LNX_26x86 directory.

Run the db2_install script.

When prompted to specify a keyword, type DB2.EXP and press return.

When the script completes, run rpm -qa and verify that the following RPM's were installed:

IBM_db2jhen81-8.1.2-105
IBM_db2fs81-8.1.2-105
IBM_db2smpl81-8.1.2-105
IBM_db2conv81-8.1.2-105
IBM_db2adts81-8.1.2-105
IBM_db2crte81-8.1.2-105
IBM_db2cliv81-8.1.2-105
IBM_db2icuc81-8.1.2-105
IBM_db2sp81-8.1.2-105
IBM_db2cj81-8.1.2-105
IBM_db2jdbc81-8.1.2-105
IBM_db2das81-8.1.2-105
IBM_db2cc81-8.1.2-105
IBM_db2ldap81-8.1.2-105
IBM_db2icut81-8.1.2-105
IBM_db2chen81-8.1.2-105
IBM_db2dc81-8.1.2-105
IBM_db2ca81-8.1.2-105
IBM_db2engn81-8.1.2-105
IBM_db2cucs81-8.1.2-105
IBM_db2adt81-8.1.2-105
IBM_db2rte81-8.1.2-105
IBM_db2msen81-8.1.2-105
IBM_db2repl81-8.1.2-105
IBM_db2inst81-8.1.2-105
IBM_db2exsg81-8.1.2-105

Ignore the Misinformation

There are many, many instances where the DB2 Version 8.2 distribution identifies itself as version 8.1 instead of 8.2.4. For example, the RPM's have a 8.1.2 version number. These clues might lead one to think that he or she has accidentally installed version 8.1 instead of version 8.2.4, but this is not the case.

Java Installation

IBM DB2 V8.2.4 requires IBM's java. Failure to install the IBM java distribution that comes with the DB2 distribution will cause the installation of the tools catalog to fail. Change directories to db2/linux26/Java-1.4 and rum the following command:

rpm -i IBMJava2-SDK-1.4.2-1.0.i386.rpm

Creating an Instance

A DB2 installation consists of an administration server and one or more instances. Each instance contains one or more databases. The administration server coordinates the instances. The administration server is owned by an OS-level user. Each instance is owned by a seperate OS-level user as well.

To create an instance and an administration server, run /opt/IBM/db2/V8.1/instance/db2isetup, a java-based installation program.

On the screen titled Welcome to the DB2 Instance Setup wizard, click Next

On the screen titled Set user information for the DB2 Administration Server, leave the defaults, enter a password into the Password and Confirm Password text boxes and click Next

On the screen titled Set up a DB2 instance, leave the default radio button checked (Create a DB2 instance) and click Next

On the screen titled Set user information for the DB2 instance owner, leave the defaults, enter a password into the Password and Confirm Password text boxes and click Next

On the screen titled Set user information for the DB2 fenced user, leave the defaults, enter a password into the Password and Confirm Password text boxes and click Next

On the screen titled Configure DB2 instance TCP/IP communication, leave the default radio button checked (Configure), leave the default Service name and Port number and click Next

On the screen titled Set instance properties, leave the default Authentication type pulldown (Server), leave the default Startup box checked (Autostart the instance at system startup) and click Next

On the screen titled Prepare the DB2 tools catalog, accept the default "Do not prepare the DB2 tools catalog on this computer" and click Next

On the screen titled Set up the administration contact list, leave the defaults and click Next. (You may have to check and then uncheck the "Enable notification" button before Next is enabled)

A dialog will come up with a warning about not being able to send notifications until the smtp server has been specified. Click OK.

On the screen titled Specify a contact for health monitor notification, enter your Name and Email address and click Next.

On the screen titled Set up Informix data source support, click the check box next to "Defer this task until after installation is complete" and click Next.

On the screen titled Start copying files, click Finish.

A progress dialog will come up. When the process is finished, it will go away.

On the screen titled Setup is complete, click Finish.

Should you need to create additional DB2 instances, follow this procedure again using a different user name and skipping the steps pertaining to the Administration Server. The /opt/IBM/db2/V8.1/instance/db2ilist command lists all of the DB2 instances on the local computer.

If you need to drop an instance, run /opt/IBM/db2/V8.1/instance/db2idrop instancename, substituting the name of the instance you want to drop for instancename.

The /opt/IBM/db2/V8.1/instance/daslist command lists all of the DB2 administration servers on the local computer.

If you need to drop an administration server, run /opt/IBM/db2/V8.1/instance/dasdrop servername, substituting the name of the administration server you want to drop for servername.

Creating a Sample Database

To create a sample database, run the command /opt/IBM/db2/V8.1/bin/db2sampl.

Starting the Database at Boot Time

You can use the following script to start/stop the database at boot/shutdown time.


#!/bin/sh

case "$1" in
start)
/opt/IBM/db2/V8.1/instance/db2istrt
;;
stop)
kill -9 `ps -efa | grep db2wdog | grep -v grep | cut -c10-15`
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac

exit 0

Install this script and run it with the "start" option to start up the database. Running it with the "stop" option shuts the database down. To access a database, it must be running.

During instance configuration, there's a check box indicating whether the instance will be configured to start at boot time. If you didn't check it, to get each instance to start at boot time, you need to run the following command as root for each instance.

/opt/IBM/db2/V8.1/instance/db2iauto -on INSTANCE_USER

Where INSTANCE_USER is replaced by the username of the user associated with the instance you want to start at boot time.

If you want to disable instances from starting at boot time, you need to run the following command as root for each instance:

/opt/IBM/db2/V8.1/instance/db2iauto -off INSTANCE_USER