Install IBM DB2 LUW RDBMS

If you created a VM, make sure you are running these steps as the normal user in that VM; not on the host system.

These instructions are for Pop!_OS, they should be similar for Ubuntu.

Get the software

Open Firefox and visit IBM DB2 Products page.

Click on the "Download IBM Db2 Software Community Edition" link.

You will need an IBM account to download the software. There is no cost to create an account and there is no cost to download and run the Db2 Community Edition.

Enter all the information it needs.

You might have to log back in with your new IBM ID or it may take you to the next page.

You will be presented with some marketing stuff. Choose your options and press the Continue button.

Since this will be installed on a Linux system, click the download link for "Linux (x64)".

This will download the file "v11.5.8_linuxx64_server_dec.tar.gz".

If you didn't change anything, the default location for downloads is "~/Downloads". This is okay.

Prep for building the software

Setup the directory structure

People have different ways of setting up the structure in the home directory.

When the OS was created, by default, the following directories were created:

.
├── Desktop
├── Documents
├── Downloads
├── Music
├── Pictures
├── Public
├── Templates
└── Videos

Open Terminal and add three more directories, Run:

cd
mkdir bin builds dev

The bin and dev directories will be useful later but for now we will focus on the builds directory.

Extract the downloaded file

Open Files and go to the Downloads folder.

Double click on the v11.5.8_linuxx64_server_dec.tar.gz file.

This will open Archive Manager.

After a little while, within that, you will see "server_dec". Click on the "Extract" button in the upper left hand corner.

A dialog box will open to select where to extract the file to. Extract the file to the ~/builds directory.

When it is done, close the dialog box, close Archive Manager, and close Files.

Rename the directory

In Terminal, Run:

cd
cd builds

to go to the builds directory.

Make sure the server_dec directory is present, Run:

ls

Rename server_dec to ibm-db2, Run:

mv server_dec ibm-db2

Enter the ibm-db2 directory, Run:

cd ibm-db2

Install additional software

In Terminal, Run the following commands to install additional software needed to run IBM DB2 LUW:

sudo apt install build-essential
sudo apt install libaio1
sudo dpkg --add-architecture i386
sudo apt install libstdc++6:i386
sudo apt install libpam0g:i386
sudo apt install ksh

Checking Prerequisites

Run:

./db2prereqcheck

If you went with Pop!_OS, this will fail with a message about "couldn't recognize the distribution". Don't worry, it will work.

If you installed Ubuntu instead of Pop!_OS, you will see a long list of information and at the bottom it will say that all requrements are met.

Installing IBM DB2 LUW as a "root" or "system" install

Run:

sudo ./db2setup -f sysreq

If you installed Ubuntu instead, Run

sudo ./db2setup

This will open a small dialog window.

  • Click on New Install
  • Make sure DB2 Version 11.5.8.0 Server Editions is highlighted
    • Purescale is not available on Ubuntu
  • Click Next
  • When you get to the window that has two buttons: Typical or Custom
    • Select Custom
    • Check the box that you agree to the Licence
    • Click Next
  • When presented with "Select Features":

    • Within Application development tools:
      • Check "Base application development tools"
    • Click Next
  • Go through the rest of the windows accepting the defaults until you see "Instance Owner".

    • The next two windows set the password for new userids: db2inst1 and db2fenc1
    • For the remaining windows, accept the defaults.
    • Note: Port number is 25000.
  • Go through the rest of the windows accepting the defaults until you see "Response File and Summary".

  • Click Finish

  • The install process will start and when it finishes, look through the log file.

    • All should look good except "Installing TSAMP". There is a warning for this.
  • Click Finish

To be on the safe side, restart after the install is finished.

When it reboots, there should be three users to select from on the login window. The "normal" userid (the one created when the OS was installed), and the db2inst1 and db2fenc1 userids.

Log in with the "normal" userid and open Terminal and Run:

cd /opt/ibm/db2/V11.5/

Look at the include and samples directories and make sure all the COBOL stuff is present.