Install IBM DB2 LUW RDBMS

Install the Database System

Get the software

Visit the “Download IBM Db2 Software Community Edition” at Download DB2 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 “v12.1.1_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 of their 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 v12.1.1_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 should work.

Run:

sudo ./db2setup -f sysreq

This will open a small dialog window.

  • Click on New Install

  • Make sure DB2 Version 12.1.1 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. You might see this message:

The value "DB2AUTOSTART=YES" was set in the Profile Registry for the "db2inst1"
instance.

ERROR: An error occurred while trying to start the "db2inst1" instance. The
return code is "127" and the SQL Message is:   "PROCESS_ERROR"

ERROR: An error occurred while configuring the instance "db2inst1".

Configuring DB2 instances :.......Failure
Updating global profile registry :.......Success
WARNING: A minor error occurred while installing "DB2 Server Edition " on this
computer. Some features may not function correctly.
  • Click Finish

Install additional files.

Because Pop!_OS is using Ubuntu 22.04 LTS, the following files must be sym-linked into the lib64 directory:

cd /opt/ibm/db2/V12.1/lib64
sudo ln -s awssdk/UBUNTU/22.04/libaws-cpp-sdk-core.so libaws-cpp-sdk-core.so
sudo ln -s awssdk/UBUNTU/22.04/libaws-cpp-sdk-kinesis.so libaws-cpp-sdk-kinesis.so
sudo ln -s awssdk/UBUNTU/22.04/libaws-cpp-sdk-s3.so libaws-cpp-sdk-s3.so
sudo ln -s awssdk/UBUNTU/22.04/libaws-cpp-sdk-transfer.so libaws-cpp-sdk-transfer.so

Restart the system.

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/V12.1/

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