DB2 Linux installation

Installation procedure is similar regardless of edition, Express-C, Express Edition and Enterprise Edition have both graphical and command line installation available. I prefer command line based installation.

First of all you should download DB2 files from IBM web page. Current version of Express-C is 9.7.2. What ever edition you are downloading, make sure that it matches your architecture. If you have 64-bit architecture, then choose that one.


IMPORTANT. These instructions are for DB2 9.7 or 9.5 and Ubuntu 10.04. These instructions should work with older Ubuntu versions, also. However, if you are installing DB2 9.1 on Ubuntu 10.04, then read these notes. Installation of 9.1 is basically same, but you have to do certain extra things to cover 9.1's lack of SHA512 support.


UPDATE ! It has been confirmed that these instructions work on Ubuntu 10.10, also. However, these instructions may not work with DB 9.8 especially on 64 bit systems.

After download is complete, unpack the file and change into the created directory


tar -xvzf db2exc_972_LNX_x86.tar.gz
cd expc

Now we are in directory expc, where all the binaries are. Actual installation must be done with root privileges. Before you start the installation you should run


./db2prereqcheck

which will tell you that libaio.so.1 is missing. Install the appropriate package with


sudo apt-get install libaio.so.1

In Ubuntu 9.10 and 10.04 it is also possible (depending on architecture and platform) that this check will complain of missing libstdc++.so.5 . You will not find it anymore in Ubuntu repositories. You can obtain the missing package from several sources, but take care that the package matches your architecture (x86, x64 etc).

Ubuntu x86 (32 bit)
If you have x86 (32 bit) architecture, then easiest way is to activate old Jaunty repository for a moment, install the package and then deactivate the added repository. In the /etc/apt/sources.list add line (replace uk with your local country code)

deb http://uk.archive.ubuntu.com/ubuntu jaunty main universe

Then synchronize repositories and install package

sudo apt-get update
sudo apt-get install libstdc++5

And then delete jaunty repository from /etc/apt/sources.list AND do sudo apt-get update again. Alternatively, you could also download the package directly from Jaunty repository and use dpkg.

Ubuntu x64 (64 bit)
If you are using x64 (64 bit) architecture, you will not get that easy, and you need both 32 bit and 64 bit versions. I will show two paths to achieve this goal

Path 1. You you have to download libstdc++5 amdx64 package, and then execute following steps


dpkg -i libstdc++5_3.3.6-17ubuntu1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/i/ia32-libs/ia32-libs_2.7ubuntu6.1_amd64.deb
dpkg-deb -x ia32-libs_2.7ubuntu6.1_amd64.deb ia32-libs
sudo cp ia32-libs/usr/lib32/libstdc++.so.5.0.7 /usr/lib32/
cd /usr/lib32
sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5

Path 2.(UPDATE: There is some typo in path 2 commands. Use Path 1 instead!!!) Download 64 bit and 32 bit packages. Then install 64 bit version (NOT the 32 bit version)

sudo dpkg -i libstdc++5_3.3.6-18_amd64.deb

Then execute


dpkg --extract libstdc++5_3.3.6-18_i386.deb ./
cd usr/lib
sudo -i
cp libstdc++.so.5.0.7 /usr/lib32/
cd /usr/lib32
ln -s libstdc++.so.5.0.7 libstdc++.so.5

Now we should be ready to install DB2. Manual installation is started with


sudo expc/db2_install

Installation program will ask for installation directory (just use the default). Installation takes a while, and if it is successful, you should get the message The Execution completed successfully. DB2 is now installed, but it is not yet ready for use. After this we continue with DB2 Linux Configuration.

Comments
8 Responses to “DB2 Linux installation”
  1. BM says:

    Thanks a lot for the tips on installing libstdc++.so.5! You saved me a ton of time and pain.

  2. Ramiro says:

    Hello! thanks for this guide, I’ve following the Path #2 to install DB2 9.8 into my Ubuntu 10.10 machine.

    I followed every step, uninstalled previous version of libstdc++.so.5 but I still get the following error:

    WARNING:
    The 32 bit library file libstdc++.so.6 is not found on the system.
    32-bit applications may be affected.
    ERROR:
    package (or file) /usr/lib/libstdc++.so.5 not found.
    Check the following web site for the up-to-date system requirements
    of IBM DB2 9.8.
    http://www.ibm.com/software/data/db2/udb/sysreqs.html
    http://www.software.ibm.com/data/db2/linux/validate

    Aborting the current installation …

    This is how my /usr/lib and lib32 looks like:
    ramiro@T400:/usr/lib$ ls -l | grep libstdc++.so.5
    lrwxrwxrwx 1 root root 18 2011-01-25 16:10 libstdc++.so.5 -> libstdc++.so.5.0.7
    -rw-r–r– 1 root root 829320 2008-07-15 15:36 libstdc++.so.5.0.7

    ramiro@T400:/usr/lib32$ ls -l | grep libstdc++.so.5
    lrwxrwxrwx 1 root root 18 2011-01-25 16:07 libstdc++.so.5 -> libstdc++.so.5.0.7
    -rw-r–r– 1 root root 737112 2011-01-25 16:06 libstdc++.so.5.0.7

    Can you help me on this?
    Thanks a lot in advance.

    • technomagus says:

      First of all, everything on this guide has been tested only on DB2 versions up to 9.7, and I see that you are using 9.8. However, I doubt that is the problem (but could be, since there are differences between 9.1 and 9.5, for example). Also, I have not tested these instructions on Ubuntu 10.10, because I use on our database servers 10.04 LTS.

      You did not mention whether you are really using 64 bit architecture or 32 bit. Path 1 or 2 should only be used when you have 64 bit version of Ubuntu Linux.

      Also, it seems that I have probably made a typo in Path 2 instructions. I tested them myself now and they do not seem to work as intended. However, Path 1 works. Try it, that may correct the problem.

      However, these instructions are to install libstdc++.so.5 which is missing. libstdc++.so.6 should not be missing, but the warning you included states that you are now missing that, too.

      My advice is to try Path 1, and see what happens. It is also possible that you have to install 32bit version of libstdc++.so.6 again.

      • Ramiro says:

        Thanks a lot for your reply techomagus,

        I was using Ubuntu 10.10 64 bits version. I followed path 1 and 2 and I still did no have luck, same error 😦

        I downloaded 9.7 ESE fixpack 3a (64bits too) and this worked perfectly without a single problem after following this instructions. So on the good side I can confirm that this guide applies to ubuntu 10.10 too, but unfortunately it does not work with DB2 9.8…. which is kind of odd… as far as I know db2 9.8 is 9.7 core + DB2 Purescale feature… weird.
        Db2 control center and other GUI apps worked like a charm.

        I still have to try 9.8 + 10.04 combination, I will let you know if I have time to test this.

        Thanks so much for your help I really appreciate it.
        Have a nice day!

      • technomagus says:

        Good to know this. I will update the information on Ubuntu 10.10 compatibility, and put a warning about DB2 v 9.8 for the time being.

        Ubuntu 10.04 is a LTS version, which could mean that DB2 9.8 may work. I have an impression that IBM has usually targeted Ubuntu LTS versions as supported platform, since it is has longer life-cycle and is more predictable from the configuration point of view.

  3. praveen says:

    I successfully installed db2 9.7 on ubuntu 10.10 but i’m unable to start the db2 control center and db2 admin. can u please help me out in explaining the post installation steps to launch db2cc??

    • technomagus says:

      I assume that “successfully installed” means that you have created the necessary user accounts for administration and instance (usually dasusr1 and db2inst1), appropriate groups and set up kernel parameters according to the memory and resources of your system.

      db2cc is currently obsolete, and I suggest you download and install IBM DataStudio, and use it instead. In the future db2cc (probably) won’t be shipped with DB2 anymore.

      I assume you mean db2admin command which is launched from command line. It should be launched as dasusr1 or as someone who belongs to dasadm1 group.

      > su dasusr1
      > . ~/das/dasprofile
      > db2admin start

      In Ubuntu 10.10 there may happen that you cannot launch db2admin in the same way it is done in Ubuntu 10.04 (and previously). In that case you should use absolute path to the binary

      > su dasusr1
      > . ~/das/dasprofile
      > /opt/ibm/db2/V9.7/das/bin/db2admin start

      Now db2 administration service should start

  4. akshay naidu says:

    i hav installed ubuntu 11.04 32 bit
    can i install db2 express c 64 bit in it

Leave a reply to technomagus Cancel reply

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 105 other subscribers