Part 2: Install DB2 on Ubuntu 24.04 LTS
To use DB2 as a content store in CA, it is convenient to install DB2 beforehand. This is part 2 of this manual. In part 1 I describe the download of the required files. In part 3 I will describe the installation of CA on Ubuntu 24.04 LTS.
1. Create the required user accounts
Refer to: https://www.ibm.com/docs/en/db2/11.5?topic=unix-creating-group-user-ids-db2-database-installation
On the destination host create the required user accounts as root (set passwords instead of xxxx):
$ adduser db2inst1 # Password: xxxx
$ adduser db2fenc1 # Password: yyyy
$ adduser dasusr1 # Password: zzzz
2. Unpack the Files
Change to the directory where you downloaded the DB2 files and unpack them:
$ tar -xzf <downloaded db2 file name>
In the created folder you will find a server_dec directory where a number of runnable scrips are found.
3. Complete the DB2 requirements
Still in the above directory, go on to check DB2 requirement:
$ cd server_dec
$ ./db2prereqcheck | less
This checks for various DB2 versions if the requirements are met. Probably you will see several unmet prerequisites. It depends on the range of libraries already installed on your system what is missing for DB2 to run. In my case I only had to install:
$ apt install lib32stdc++6
Additionally there is a 32-bit libpam required. This requires to add a i368 architecture to dpkg:
$ dpkg --add-architecture i386
$ apt update
$ apt install libpam0g:i386
However, in former (!) DB2 installations on Ubuntu 20.04 LTS (not 24.04 LTS), I also had to install:
$ apt install binutils
$ apt install ksh
$ apt install zlib1g
$ apt install libstdc++6
4. Complete Tivoli requirements
$ cd server_dec/db2/linuxamd64/tsamp
$ ./prereqSAM
Fulfilling all requirements will finally end up with the error message «prereqSAM: Error: Prerequisite checking for the ITSAMP installation failed: Ubuntu 24.04 x86_64». This is o.k., since Ubuntu 24.04 LTS is not officially supported by this DB2 version.
Please note: a missing ksh will not show up in the requirements check, but the installation will fail if not present. Therefore, be sure to have run:
$ apt install ksh
If anything goes wrong with the installation, you find helpful information about the reasons in the log files db2_install_log_xxxx and installSAM.xxxx.log (probably stored to /tmp/). If there are still libraries missing, you make some loops of uninstall DB2 - install libraries - install DB2, until everything is fine.
5. Install DB2
$ cd server_dec
$ ./db2_install
If an error occurs, e.g. due to missing requirements, you can restart by:
$ cd <db2 installation path>/install/
$ ./db2_deinstall -a
At the end you will get:
«The execution completed successfully.»
6. Install the DB2 activation key
You will need to apply this license to allow DB2 to be used as content store for CA. Change to the directory where you stored the DB2 Downloads, e.g.
$ cd /root/Downloads/ibm/DB2
$ unzip DB2_SE_Restricted_Activation_11.5.zip
This will create a std_o directory. Then review the current DB2 license:
$ /<db2 installation path>/adm/db2licm -l
To install the activation key, run:
$ cd <db2 download files path>
$ /<db2 installation path>/adm/db2licm -a ./std_o/db2/license/db2std_o.lic
Then you can run again the above command to show the current licenses.
To delete the pre-installed and now unused license, lookup the «Product identifier» entry of the Community License shown in the output of the above db2licm -l command (e.g. «db2dec»), then run:
$ /<db2 installation path>/adm/db2licm -r db2dec
7. Create the DB2 instance
$ cd /<db2 installation path>/instance
$ ./db2icrt -a SERVER -u db2fenc1 db2inst1
This should result in the message:
The execution completed successfully.
8. Apply workarounds / fixes for Ubuntu 24.04 LTS
Ubuntu 24.04 is not supported, last version is 22.04. During installation some symlinks are not created for this reason. When trying to start db2 (see below), then the following error occurs:
db2start: error while loading shared libraries: libaws-cpp-sdk-transfer.so: cannot open shared object file: No such file or directory
For a solution I refer to: https://dba.stackexchange.com/questions/333207/db2-v11-5-9-0-installation-error-while-loading-shared-libraries-libaws-cpp-sdk
To create the missing symlinks, run:
$ cd /<db2 installation path>/lib64
$ find awssdk/UBUNTU/22.04/ -type f -exec ln -s {} \;
Please note that this step has to be performed after each re-installation or after applying a DB2 fix.
9. Test your new DB2 installation
su to db2inst1 user:
$ sudo su -l db2inst1
Create the sample database:
$ cd /<db2 installation path>/bin
$ ./db2sampl
Some output is produced, ending up with «'db2sampl' processing complete.»
Now you can start DB2:
$ cd ~/sqllib/adm/
$ ./db2start
Connect to the sample database:
$ /<db2 installation path>/bin/db2 connect to sample
It will show some connection information, then you disconnect:
$ /<db2 installation path>/bin/db2 disconnect sample
Finally you can drop the sample database:
$ /<db2 installation path>/bin/db2 drop db sample
Congrats, you have now installed DB2 and done some basic tests for a successful installation!