Saturday, May 14, 2011

Installing and Testing DB2 9.7.4 on Ubuntu 11.04

The full refresh of DB2 Express-C 9.7.4 — the enterprise scale database server from IBM that is free to develop, deploy and distribute — was released last week.

Reading what's new with DB2 Express-C 9.7.4, one of the new features that caught my eye was the Text Search component. This is not the first appearance of Text Search: it was first integrated in DB2 Express-C 9.5.2 and it allowed for fast searches on text columns. But with time, you had two engines to choose from, lacking a unified solution. With DB2 Express-C 9.7.4, this standard solution is introduced to bring improvements in the areas of performance, configuration and tuning.

Probably a first in IBM's history, the DB2 Express-C 9.7.4 template for Rightscale/Amazon EC2 was made available on the cloud well before publishing the product through traditional channels. How about that for commitment to the cloud? :)

Brand new DB2 on brand new Ubuntu

Seeing all this buzz around this new Fix Pack for DB2, I took the quest of testing it first locally: a full install on a brand new copy of Ubuntu 11.04!

My scenario covers:

  1. Downloading DB2 Express-C 9.7.4, including the language pack for a proper full install
  2. Minimal CRUD testing:
    1. create a SAMPLE database
    2. start the current database manager instance background processes
    3. create a connection to the DB
    4. use the CLP to run at least a basic SELECT
  3. Check the state of installation files, instance setup, and local DB connections (db2val)
  4. Retrieve the current Version and Service Level of the installed product (db2level)
  5. Check licenses:
    1. Check the limitations of the free, unwarranted licence (2 CPUs / 2GB of memory)
    2. Apply a Fixed Term License
    3. Check the new limitations of DB2 Express Edition (4GB of memory)
  6. Having had issues in the past, test the uninstall of DB2.

Results of the DB2 Express-C 9.7.4 test

Installing on a brand new copy of Ubuntu 11.04, I bumped right into the error of the missing dependency:
Missing libaio1

But this can be solved as simply as running

$ sudo apt-get install libaio1
and then running again the db2setup script as root.
The GUI installation wizard is here to confirm:
Installing DB2 as root

My plan is to make a full install — more chances to find possible flaws — so I chose Custom as installation type:
Choosing Custom for a full install

Other reasons for choosing custom install are to be able to review the choice of components or see if some of the ones you might need aren't unchecked by default.
For instance, if you plan to install Ruby on Rails and DB2 on Ubuntu 11.04, make sure to check the Application development tools component: it's needed to build the Ruby driver.
Make sure to select all features

The rest of the instalation is almost self-explanatory, so moving forward to the first set of tests, the database creation, connection and the CLP behaved as expected:
Creating SAMPLE DB and basic querying

The license was also applied successfully, so in the end all 4GB of memory were put to good use:

Checking licence and applying the new one

Following the documentation for the uninstall process, it completed with success, but I couldn't resist and I quickly went through the installation again, eager to test the connectivity between the new Rails 3.1 beta and DB2 Express-C 9.7.4!

But that will fuel another article!


  1. Thanks. Will give it try!

  2. chayala db2sample execute vhayala 10 tas lagtat ka?