5. Distribution Specific Considerations

In this part of the HOWTO, we will cover any tweaks, fixes or requirements that need to be made to get DB2 UDB running on specific Linux distributions.

5.1. Red Hat Enterprise Linux (RHEL) 3

These installation notes are based on a single-partition installation using the 2.4.21–20 kernel (September 20, 2004).

5.1.1. Pre-installation notes

The pdksh package required for a multiple-partition environment setup is installed by default on Red Hat Enterprise Linux 3.

RHEL 3 has backported the asynchronous I/O kernel capabilities of the 2.6 kernel into their 2.4 kernel, but you will need to download and install the libaio RPM package to take advantage of this.

To check for the pdksh or libaio RPM packages, run the commands:
rpm -qi pdksh
rpm -qi libaio
If either package needs to be installed, you can add it to your system with the Red Hat up2date utility (this requires registration for a Red Hat Network account). Just run:
up2date pdksh
up2date libaio

No Java package is installed by default, so there are no conflicts with the Java 2 SDK from IBM that DB2 UDB installs.

5.1.2. Installation notes

The installation on Red Hat Enterprise Linux 3 completed successfully, with no problems getting the GUI tools or installer working, and no errors during the install. This smooth installation isn't surprising, given that RHEL 3 is an officially supported platform for Version 8.2

5.1.3. Post-installation notes

Initialize the Asynchronous I/O so DB2 UDB can take advantage of this new kernel feature. As the instance owner:
db2set DB2LINUXAIO=TRUE

5.2. SuSE Linux Enterprise (SLES) 9

SuSE Linux Enterprise Server 9 was released in August 2004 to great anticipation. It is currently the only Enterprise level Linux distribution certified by DB2 UDB that runs on the 2.6 kernel by default.

These notes are based on the 2.6.5-7 kernel (the SuSE Linux kernel update as of September 10, 2004), and installing a single-partition environment.

5.2.1. Pre-installation notes

  1. The pdksh package is installed in a default setup (required for multiple-partition and high availability installations)

  2. The IBMJava2-JRE-1.4.2 rpm package is also installed by default

  3. The kernel parameters (ipcs -l) before DB2 UDB installation:
    
        max number of segments:         4096
            max segsize:                    32768
            max number of arrays:           128
            max queues system wide:         16
            default max size of queue:      16384

  4. Asynchronous I/O package (libaio) is also installed by default.

5.2.2. Installation Notes

I received an error during start up of the db2setup utility:
/db2/ese/db2/linux/install/db2jinst:
line 131: 3474 Segmentation fault
$JAVA_PATH/$JAVA_INTERPRETER $JAVA_OPTIONS \
    -cp $JAVA_CLASSPATH $DB2SetupRun "$@" 2>/tmp/db2setup.err.running
The solution here is to run
export LD_ASSUME_KERNEL="2.4.19"
from the terminal where you launched the db2setup utility, then run db2setup again. This change will only affect the Java installer, not the kernel performance.

5.2.3. Post-installation notes

The kernel parameters (ipcs -l) after installation look like:

        max number of segments:         4096
        max segsize:                    262144 (updated)
        max number of arrays:           1024 (updated)
        max queues system wide:         1024 (updated)
        default max size of queue:      16384

Initialize the Asynchronous I/O so DB2 UDB can take advantage of this new kernel feature. As the instance owner:
db2set DB2LINUXAIO=TRUE

Optional: update the DB2 UDB JDK_PATH parameters so DB2 UDB uses SLES's installed Java 2 package. As the instance owner:
db2 UPDATE DBM CFG USING JDK_PATH /opt/IBMJava2-142
		db2 UPDATE ADMIN CFG USING JDK_PATH /opt/IBMJava2-142
	

Surprisingly, my installation didn't have Mozilla installed by default. To have the DB2 UDB help display properly, Mozilla should be installed using YaST.

5.3. SuSE Linux Enterprise (SLES) 8

These installation notes are based on the 2.4.21 kernel (SLES kernel on September 20, 2004)

5.3.1. Pre-installation notes

The pdksh package is installed in the default setup (required for multiple-partition and high availability installations).

Also, SLES 8 installs the IBMJava2–SDK-1.3.1 rpm package in a typical installation.

5.3.2. Installation notes

SuSE Linux Professional installs its own 1.3.1 Java JRE by default (the "IBMJava2-SDK-1.3.1" rpm package). During the DB2 UDB installation, this will cause a warning to be generated:
Command to be run: "/bin/rpm -ivh \
    '/mnt/cdrom/db2/linux/Java-1.4/IBMJava2-SDK-1.4.1-2.0'.i386.rpm"
Warning: there may be a version of this package already installed.
Since this package was supplied by SuSE Linux, it will have been installed into a different directory tree than the JDK from IBM that DB2 UDB installs. Therefore, there are 3 options you can choose to deal with this issue:

  1. Uninstall the Java2-1.3.1 package before installing, using either the YaST tool, or with the command line rpm -e IBMJava2-SDK-1.3.1 command. After installation, this will leave the IBMJava2–SDK–1.4.1 package as the only Java installation on the system.

  2. Leave both Java packages installed. By default, DB2 UDB will use the 1.4.1 JRE that it installs. The fact that SuSE Linux's Java package installs to a different directory means that the two packages will not conflict.

  3. Remove the IBM package (either with YaST or with rpm -e IBMJava2-SDK-1.4.1) after the installation completes. Update the DB2 UDB JDK_PATH configuration parameters to use the package installed by SuSE Linux:
    db2 UPDATE DBM CFG USING JDK_PATH /usr/lib/java
    db2 UPDATE ADMIN CFG USING JDK_PATH /usr/lib/java

Other than that one minor issue, DB2 UDB installed cleanly and setup was problem free.

5.4. SuSE Linux Professional 9.1

Note that IBM does not officially support this distribution for DB2 UDB V8.2. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support will help you resolve the issue.

These notes are based on a single-partition installation on the 2.4.21 kernel (September 20, 2004).

5.4.1. Pre-installation notes

If you want to run a multiple-partition environment, you will need to install the pdksh package found on CD 4.

5.4.2. Installation notes

SuSE Linux Professional installs its own 1.4.2 Java JRE by default (the "java2–jre-1.4.2" package). During the DB2 UDB installation, this will cause a warning to be generated:
Command to be run: "/bin/rpm -ivh \
    '/mnt/cdrom/db2/linux/Java-1.4/IBMJava2-SDK-1.4.1-2.0'.i386.rpm"
Warning: there may be a version of this package already installed.
Since this package was supplied by SuSE Linux, it will have been installed into a different directory tree than the JDK from IBM that DB2 UDB installs. Therefore, there are 3 options you can choose to deal with this issue:

  1. Uninstall the java2–jre–1.4.2 package before installing, using either the YaST tool, or with command line rpm erase command. This will leave the IBMJava2–SDK package as the only Java installation on the system.

  2. Leave both Java packages installed. By default, DB2 UDB will use the 1.4.1 JRE that it installs. The fact that SuSE Linux's Java package installs to a different directory means that the two packages will not conflict.

  3. Remove the IBM package (either with YaST or with rpm -e IBMJava2-SDK) after the installation completes. Update the DB2 UDB JDK_PATH configuration parameters to use the package installed by SuSE Linux:
    db2 UPDATE DBM CFG USING JDK_PATH /usr/lib/java
    db2 UPDATE ADMIN CFG USING JDK_PATH /usr/lib/java

Other than that one minor issue, DB2 UDB installed cleanly and setup was problem free.

5.5. SuSE Linux Personal 9.1

Note that IBM does not officially support this distribution for DB2 UDB V8.2. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support will help you resolve the issue.

These notes are based on the 2.6.4-52-default kernel and installing to a single-partition environment.

5.5.1. Pre-installation notes

The pdksh package is not installed by default. If you want to install a multiple-partition environment on SuSE Linux Personal, you will have to install.

The installer may complain about being unable to use the SMTP server even though postfix is installed and sendmail is available in the path. Make sure that postfix has been started before installation.

5.5.2. Installation notes

The usual trick of adding an xhost entry for localhost and then exporting the DISPLAY=localhost:0 when installing (so that the graphical utilities are displayed on a non-root user's desktop) didn't seem to work here. Instead, try executing ssh -X root@localhost and launch the utilities from there.

5.6. Fedora Core 2

Note that IBM does not officially support this distribution for DB2 UDB V8.2. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support will help you resolve the issue.

Fedora Core 2 is a release of the Fedora Project (the Red-Hat-sponsored and community-supported open source project). The Fedora Project is a source for new technologies and enhancements that may be incorporated into Red Hat Enterprise Linux (RHEL) in the future.

These notes are based on both the default 2.6.5-1 and the update 2.6.8-1 kernels (the Fedora Core 2 kernel update on September 13, 2004 was 2.6.8-1), and installing to a single-partition environment.

5.6.1. Pre-installation notes

The kernel parameters (ipcs -l) before DB2 UDB installation:

	max number of segments:             4096
        max segsize:                        32768
        max number of arrays:               128
        max queues system wide:             16
        default max size of queue:          16384

The asynchronous I/O package (libaio) is also required to take advantage of the 2.6 kernel improvements. Install the libaio package from the Fedora Core CD.

5.6.2. Install Notes

The default 2.6.5 kernel had no installation issues with the db2setup GUI installer.

On the 2.6.8 kernel, however, I received an error when running the db2setup utility (the error may not display to the terminal; instead, if the db2setup command seems to fail without error, check the /tmp/db2setup.err file) :
JVMDG080: Cannot find class com/ibm/jvm/Trace
JVMXM012: Error occurred in diagnostics initialization(2)
Could not create the Java virtual machine.
The workaround for this error is to install Sun's Java 2 Platform Standard Edition 5.0 RC (Fedora Core 2 doesn't install a Java package by default). The rpm file is available from http://java.sun.com/j2se/1.5.0/download.jsp. After installing Java, set the environment variables in the terminal where you execute the db2setup utility:
export DB2USELOCALJRE=TRUE
export JAVA_HOME=/usr/java/jre1.5.0/
/usr/java/jre1.5.0/ is the location where Java is installed by default in the rpm from Sun.

The last step to making this work – and this is very important – is to add in a link named "jre" in Sun's Java folder so that db2setup works properly with the directory:
cd /usr/java/jre1.5.0/
mkdir jre
cd jre
ln -s ../bin bin

After making these changes, the db2setup GUI installer works properly.

Alternatively, you can avoid the Java-based problems by installing on Fedora Core 2 using
./db2setup -r db2ese.rsp
where db2ese.rsp is a slightly modified response file (the sample response files are found in the "db2/linux/samples/ directory)

5.6.3. Post-installation notes

The kernel parameters (ipcs -l) after installation look like:

        max number of segments:         4096
        max segsize:                    262144 (updated)
        max number of arrays:           1024 (updated)
        max queues system wide:         1024 (updated)
        default max size of queue:      16384

Initialize the Asynchronous I/O so DB2 UDB can take advantage of this new kernel feature. As the instance owner, run:
db2set DB2LINUXAIO=TRUE

For the GUI tools (DB2 UDB Control Center, DB2 UDB Configuration Assistant, DB2 UDB First Steps) to work properly under the 2.6.8-1 kernel, you'll need to tell DB2 UDB to use the Sun JRE. As the instance owner, execute these commands:
db2 UPDATE DBM CFG USING JDK_PATH /usr/java/jre1.5.0/
db2 UPDATE ADMIN CFG USING JDK_PATH /usr/java/jre1.5.0/
With that update, the DB2 UDB Java-based tools will work properly.

5.7. Mandrake Linux 10.1 (Community)

Note that IBM does not officially support this distribution for DB2 UDB V8.2. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support will help you resolve the issue.

These notes are based on the 2.6.8.1–16mdk kernel and installing to a single-partition environment.

5.7.1. Pre-installation notes

The pdksh package is not installed by default. If you want to install a multiple-partition environment on Mandrake Linux, you will have to install it using drakconf (it's on CD3). Also, no Java package is installed by default, so we don't have to worry about any conflicts arising from that.

5.7.2. Installation notes

The GUI based installation went smoothly, with no reported problems or issues. If you do experience a hang with the Java installer, try the Sun Java workaround described in the Fedora Core 2 section.

5.7.3. Post-installation notes

Be careful of the Mandrake Linux security "msec" utility – it can mess up DB2 UDB functionality by changing world readable directories (like /home/db2inst1/sqllib/) that are necessary to run DB2 UDB to non-world readable. If you find that DB2 UDB is not working properly, investigate your security settings.

5.8. Gentoo (2005-01-17)

Note that IBM does not officially support this distribution for DB2 UDB V8.2. Any problems you encounter using this distribution must be replicated on a supported distribution before IBM Support will help you resolve the issue.

These notes are based on a single-partition installation on the 2.6.9-gentoo-r13 kernel (2005-01-17). Following the manual install instructions in the DB2 Information Center, we use the RPM method of installing DB2 UDB V8.2, through a modified db2_install script. This is just one of many ways you could accomplish this task, but this method has been tested (at least once) and it works.

5.8.1. Pre-installation notes

Emerge the rpm package and any of its pre-requisites:
emerge rpm
If you want to run a multiple-partition environment, you will need to emerge either the pdksh or ksh package.

5.8.2. Installation notes

Gentoo uses the latest version of the GNU coreutils package of utilities, which includes the tail command. The DB2 install script (db2_install) and several instance administration shell scripts rely on deprecated command line arguments to tail that have been removed entirely from the latest GNU coreutils version of tail. Therefore, you must copy the contents of the install CD and modify the db2_install script before you can successfully run the install.

The RPM packages supplied with the DB2 install CD contain dependency listings that cannot be satisfied inside a Gentoo environment, because Gentoo does not use RPM as a native packaging method. To overcome these dependencies, you also need to modify the db2_install script to ignore dependencies and force the installation of DB2 onto your system.

Perform the following steps to modify the db2_install script for the required tail and rpm changes and install the product:

  1. (Skip this step if you downloaded a tarball containing the DB2 install code.) Assuming you want to copy the contents of the DB2 install CD to a subdirectory named "cdrom" in your home directory, issue the following command:
    cp -r /mnt/cdrom/* ~/cdrom

  2. Open the ~/cdrom/db2/linux/db2_install script in your text editor and modify the following lines

    From:
    output_df="`df -k ${dirname2?} | tail -1`"

    To:
    output_df="`df -k ${dirname2?} | tail -n -1`"

    From:
    ( rpm -ivh  ${INSTDEV?}/${pkg?}${RPMEXTN?} 2>&1; \ 
       echo $? > ${TMPRC?} ) | tee -a ${DB2INSTLOG?}

    To:
    ( rpm --force --nodeps -ivh  ${INSTDEV?}/${pkg?}${RPMEXTN?} 2>&1; \ 
       echo $? > ${TMPRC?} ) | tee -a ${DB2INSTLOG?}

  3. Change to the ~/cdrom directory and issue the following command as root:
    ./db2_install

  4. The DB2 installer prompts you to enter the keyword of the product you want to install. for example, issuing the db2_inst command for the DB2 UDB Express Edition for Linux install displays the following screen:
    
Specify one or more of the following keywords, 
    separated by spaces, to install DB2 products.
    
     Keyword        Product Description
     DB2.EXP        DB2 UDB Express Edition for LINUX
    
    Enter "help" to redisplay product names.
    
    Enter "quit" to exit.
    
    ***********************************************************
    DB2.EXP
    

The DB2 installer will now install many RPM packages into the /opt/IBM/db2/V8.1/ directory.

5.8.2.1. Installing DB2 UDB FixPaks on a non-RPM distribution

When installing a DB2 FixPak onto an existing DB2 installation, the RPM utility is used, which will cause problems on a distribution that does not use the RPM installation method by default. Since Gentoo is one of those distributions, you must make the following changes to the installFixPak script.

In the installFixPak script, change this line:

		echo "Updating to ${fullfsname?} ... "
		rpm -ivh ${fullfsname?}
	
to read:

		echo "Updating to ${fullfsname?} ... "
		rpm --force --nodeps --ivh ${fullfsname?}
	

5.8.3. Post-installation notes

Now that you have installed DB2, you need to create the groups, users, DB2 Administration Server instance, and database instance for your database. The following instructions create users and groups with the default names used in the DB2 documentation (dasadm1, db2inst1, db2fenc1).

  1. As root, create the required groups:
    
groupadd -g 999 db2iadm1
    groupadd -g 998 db2fadm1
    groupadd -g 997 dasadm1
    

  2. As root, create the required users and assign them to their corresponding groups:
    
useradd -u 1004 -g db2iadm1 -m -d /home/db2inst1 db2inst1 
    useradd -u 1003 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1 
    useradd -u 1002 -g dasadm1 -m -d /home/dasusr1 dasusr1
    

  3. Before you can create the DB2 Administration Server and database instance, you have to modify the db2iutil library to update calls to the tail command to the current GNU syntax. As root, open the /opt/IBM/db2/V8.1/instance/db2iutil file in an editor and make the following changes (or apply the changes to the file using the patch utility):
    
--- db2iutil.orig       2005-01-17 07:05:58.000000000 -0500
    +++ db2iutil    2005-01-17 07:06:32.000000000 -0500
    @@ -327,7 +327,7 @@
         fi
     
         # Get output of the "df" command
    -    output_df="`df -k  ${dirname2?} | tail -1`"
    +    output_df="`df -k  ${dirname2?} | tail -n 1`"
         # On some platforms, the filesystem is on the previous line causing us
         # one less token for awk to find.
         free_space_in_fs=`echo ${output_df?} | awk '{if ($4 !~ /%/) {print $4} else
     {print $3}}'`
    @@ -382,7 +382,7 @@
         rm -f ${TMPFILE3?}
     
         # Get the name of the filesystem where dir $dirname2 resides.
    -    df -k ${dirname2?} | tail +2 > ${TMPFILE3?}
    +    df -k ${dirname2?} | tail -n +2 > ${TMPFILE3?}
     
         # There must be only one line in TMPFILE3 file
         lcount=`wc -l ${TMPFILE3?} | awk '{print $1}'`
    @@ -394,7 +394,7 @@
                 chk_fsystype 22
             stop_prog 1
         fi
    -    fsname=`awk '{print $NF}' ${TMPFILE3?} | tail -1`
    +    fsname=`awk '{print $NF}' ${TMPFILE3?} | tail -n 1`
     
         rm -f ${TMPFILE3?}
         foundit=${FALSE?}
    @@ -879,7 +879,7 @@
             ${DB2VER_V2?})
                 # Dir of DB2 V2 instances
                 if [ -f ${DB2V2ILIST?} ]; then
    -                tail +2 ${DB2V2ILIST?} > ${TMPFILE3?}
    +                tail -n +2 ${DB2V2ILIST?} > ${TMPFILE3?}
                     if [ -s ${TMPFILE3?} ]; then
                         for iname in `cat ${TMPFILE3?}`; do
                             db2ilist=${db2ilist?}" ${iname?}"
    @@ -891,7 +891,7 @@
             ${DB2VER_DJ?})
                 # Dir of DB2 V2 instances
                 if [ -f ${DJV211ILIST?} ]; then
    -                tail +2 ${DJV211ILIST?} > ${TMPFILE3?}
    +                tail -n +2 ${DJV211ILIST?} > ${TMPFILE3?}
                     if [ -s ${TMPFILE3?} ]; then
                         for iname in `cat ${TMPFILE3?}`; do
                             db2ilist=${db2ilist?}" ${iname?}"
    

  4. Create the DB2 Administration Server:
    /opt/IBM/db2/V8.1/instance/dascrt -u dasadm1
    

    Create the DB2 database instance:
    /opt/IBM/db2/V8.1/instance/db2icrt -a server -u db2fenc1 db2inst1 
    

5.8.3.1. Enabling remote connections

When you perform a manual install of DB2, the installer does not automatically set up the communication protocols for your DB2 server. To enable connections to your DB2 server from remote clients, perform the following steps:

  1. Set the port on which DB2 should communicate. Ensure that you select a port that is not blocked by a firewall or used by another service defined in the /etc/services file. To set the communications port, update the DB2 database manager configuration variable SVCENAME. For example, to set the communications port to 50055, issue the following command as the instance user ("db2inst1", if you've been using the defaults):
    db2 update dbm cfg using svcename 50055

  2. Set the DB2 communications protocol registry variable to define the protocol supported by the server. Typically the only protocol you would use is TCP/IP, so issue the following command as the instance user ("db2inst1" if you've been using the defaults):
    db2set DB2COMM=tcpip

  3. Restart the database instance to enable the settings to take effect.
    
db2stop
    db2start
    

You should now be able to catalog and connect to your Gentoo server from a remote client.

5.8.3.2. Running the DB2 Control Center and other DB2 GUI tools

To run the DB2 Control Center or other DB2 GUI tools, you must install the IBM Software Developers' Kit for Java. This RPM is included in the DB2 install CD-ROM in the /db2/linux/Java-1.4/ directory. To install the IBM Software Developers' Kit for Java, change to the root directory of the CD-ROM and issue the following command as root:

rpm --force --nodeps -ivh db2/linux/Java-1.4/IBMJava2-SDK-1.4.1-2.0.i386.rpm

Log in as the db2inst1 and invoke the DB2 Control Center:
db2cc