Installing DB2 on Debian/Ubuntu

IBM’s DB2 product is delivered as a binary installer for the Linux platform in a tarball format. It would be nice if IBM produced rpm or deb packages for distributing DB2, but I will complain no further. The installer has gotten *much better* since when I first battled with installing DB2 on Linux back in 2006. After downloading the binary, unpack it and kick it off!

root#   mkdir -p /opt/ibm/db2expc_installer
root#   cp v11.1_linuxx64_expc.tar.gz /opt/ibm/db2expc_installer
root#   cd /opt/ibm/db2expc_installer
root#   tar -xfz v11.1_linuxx64_expc.tar.gz
root#   cd expc
root#   ./db2_installer

This failed of course, no binary delivered in this form ever works out of the box. This was good though, as I really wanted to run db2_setup instead of the installer. The setup program is a Java GUI that makes it very simple to go through the configuration, including creating user accounts required by the DB2 RDBMS.

 Requirement not matched for DB2 database “Server” . Version: “11.1.1.1”.

Summary of prerequisites that are not met on the current system:

DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: “/lib/i386-linux-gnu/libpam.so*”.
DBT3520E The db2prereqcheck utility could not find the library file libaio.so.1.
DBT3514W The db2prereqcheck utility failed to find the following 32-bit library file: “libstdc++.so.6”.

Ugh…32-bit binaries required.

root#   dpkg –add-architecture i386
root#   apt-get update
root#   apt-get install libaio1 libstdc++6:i386 libpam0g:i386

Now it is possible to run the installer, this time with the GUI to make the job easy.

root#  ./db2setup

DBI1190I  db2setup is preparing the DB2 Setup wizard which will guide
you through th6:ie program setup process. Please wait.

The GUI setup program holds one’s hand the whole way, allowing one to setup db2inst1 and db2fenc1 users. After the installation is complete, I ran visudo to add my user account to the sudoers file for DB2 management:

bryan ALL=(db2inst1) /opt/ibm/db2/V11.1_01/bin/*
bryan ALL=(db2fenc1) /opt/ibn/db2/V11.1_01/bin/*

Finally, I usually like to create the SAMPLE database so that I can test out SQL commands and other IBM tools on a test database that actually has a good amount of data and tables.

db2inst1$   ./db2sampl

Creating database “SAMPLE”…
Connecting to database “SAMPLE”…
Creating tables and data in schema “DB2INST1″…
Creating tables with XML columns and XML data in schema “DB2INST1″…

‘db2sampl’ processing complete.

Now to install the CLI/ODBC library for C++ programs, and maybe IBM Data Studio…

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s