Installing IBM Db2 12.1.6 Community Edition on RHEL 10.1 – Setup and DBA / DevOps Tasks
In March 2025 I described the installation of Db2 12.1.1 on Oracle Linux 9. In the meantime IBM released several mod packs, and since Db2 12.1.4 Red Hat Enterprise Linux 10 is supported for single node and DPF deployments. In this blog post, we will install IBM Db2 12.1.6 Community Edition on a RHEL 10.1 virtual machine and set up a test server that can be used for development and testing.
After the base installation we create a Db2 instance and a database, allow remote connections and then walk through typical DBA and DevOps tasks: configuration, backup and recovery (including a point-in-time recovery), monitoring, maintenance and updating Db2 to a new mod pack.
Prerequisites
| Requirement | Details |
|---|---|
| Operating System | Red Hat Enterprise Linux 10.1, installed as described in this post (8 GB RAM, 4 vCPUs, 500 GB disk, shared folder c:\sw mounted as /sw, SELinux and firewall disabled). RHEL 10 is supported since Db2 12.1.4 (single node and DPF, not yet pureScale). |
| Db2 Software | Db2 12.1 Mod 6 Fix Pack 0 (12.1.6.0, released 10 November 2026), Server Fix Pack for Linux x86-64 from Fix Central |
| IBM Account | A free IBMid to download from Fix Central |
| Root Access | Full administrative privileges on the VM |
Note on licensing: Fix Pack images can be used to install a complete Db2 server. Without a purchased license the Community Edition license (db2dec) is applied automatically. It has all features, but is limited to 4 cores and a maximum amount of instance memory (check the limits with db2licm -l, see chapter 1.5). Our VM with 4 vCPUs and 8 GB RAM fits into these limits.
1. Base Installation
1.1 Download the Db2 software
On the page Download Db2 fix packs by version we select Db2 12.1 Mod 6 Fix Pack 0, follow the Fix Central link for Linux 64-bit, x86-64 and select the Db2 Server Fix Pack. This image contains the base code for all Db2 server editions. After logging in with the IBMid the file v12.1.6_linuxx64_server_dec.tar.gz (about 1.5 GB) can be downloaded. We place it in the folder c:\sw\db2 of the Windows host, so it is available in the VM as /sw/db2.
1.2 Prepare the OS
Db2 needs a few additional OS packages. The 32-bit libraries are only required for 32-bit non-SQL routines (e.g. old 32-bit C stored procedures), therefore we skip them on a test system:
# run as root
dnf -y install ksh libaio libxcrypt-compat numactl-libs python3-dnf-plugin-versionlock
# optional: 32-bit libraries for 32-bit non-SQL routines
# dnf -y install libstdc++.i686 pam.i686
# unpack the server software
gzip -cd /sw/db2/v12.1.6_linuxx64_server_dec.tar.gz|tar -xC ~
# directories for database files, backups and archived transaction logs
mkdir -p /db2/data /db2/backup /db2/archlog
Sample Output (click to expand):
[root@lin1 ~]# # run as root
dnf -y install ksh libaio libxcrypt-compat numactl-libs python3-dnf-plugin-versionlock
# optional: 32-bit libraries for 32-bit non-SQL routines
# dnf -y install libstdc++.i686 pam.i686
# unpack the server software
gzip -cd /sw/db2/v12.1.6_linuxx64_server_dec.tar.gz|tar -xC ~
# directories for database files, backups and archived transaction logs
mkdir -p /db2/data /db2/backup /db2/archlog
Updating Subscription Management repositories.
Last metadata expiration check: 0:05:05 ago on Sun 29 Nov 2026 10:09:31 AM CET.
Package ksh-3:1.0.10-12.el10.x86_64 is already installed.
Package libaio-0.3.112-1.el10.x86_64 is already installed.
Package numactl-libs-2.0.19-3.el10.x86_64 is already installed.
Dependencies resolved.
================================================================================================================================================================
Package Architecture Version Repository Size
================================================================================================================================================================
Installing:
libxcrypt-compat x86_64 4.4.36-10.el10 rhel-10-for-x86_64-appstream-rpms 93 k
python3-dnf-plugin-versionlock noarch 4.7.0-12.el10 rhel-10-for-x86_64-baseos-rpms 33 k
Transaction Summary
================================================================================================================================================================
Install 2 Packages
Total download size: 126 k
Installed size: 228 k
Downloading Packages:
(1/2): libxcrypt-compat-4.4.36-10.el10.x86_64.rpm 130 kB/s | 93 kB 00:00
(2/2): python3-dnf-plugin-versionlock-4.7.0-12.el10.noarch.rpm 34 kB/s | 33 kB 00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 130 kB/s | 126 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libxcrypt-compat-4.4.36-10.el10.x86_64 1/2
Installing : python3-dnf-plugin-versionlock-4.7.0-12.el10.noarch 2/2
Running scriptlet: python3-dnf-plugin-versionlock-4.7.0-12.el10.noarch 2/2
Installed products updated.
Installed:
libxcrypt-compat-4.4.36-10.el10.x86_64 python3-dnf-plugin-versionlock-4.7.0-12.el10.noarch
Complete!
[root@lin1 ~]#
1.3 Check the prerequisites
The tool db2prereqcheck checks whether the system meets the requirements of the Db2 version:
# run as root
cd ~/server_dec
./db2prereqcheck -i -v 12.1.6.0
Sample Output (click to expand):
[root@lin1 ~]# # run as root
cd ~/server_dec
./db2prereqcheck -i -v 12.1.6.0
==========================================================================
Sun Nov 29 10:16:10 2026
Checking prerequisites for DB2 installation. Version "12.1.6.0". Operating system "Linux"
Validating "kernel level " ...
Required minimum operating system kernel level: "5.14.0".
Actual operating system kernel level: "6.12.0".
Requirement matched.
Validating "Linux distribution " ...
Required minimum operating system distribution: "RHEL"; Version: "9"; Service pack: "4".
Actual operating system distribution Version: "10"; Service pack: "3".
Requirement matched.
Validating "ksh symbolic link" ...
Verifies ksh resolves to a supported shell implementation.
Requirement matched.
Validating "Bin user" ...
Verifies the required operating-system bin user exists.
Requirement matched.
Validating "free space" ...
The directory "/root" has enough space on host "lin1.fritz.box".
Requirement matched.
Validating "libxcrypt-compat" ...
Package (or file) found: "libxcrypt-compat"
Requirement matched.
Validating "libcurl.so.4 library" ...
Verifies the libcurl.so.4 runtime library can be loaded.
Requirement matched.
Validating "C++ Library version " ...
Required minimum C++ library: "libstdc++.so.6"
Standard C++ library is located in the following directory: "/usr/lib64/libstdc++.so.6.0.33".
Actual C++ library: "CXXABI_1.3.1"
Requirement matched.
Validating "libaio package" ...
Verifies the libaio runtime library can be loaded.
Requirement matched.
Validating "libnuma package" ...
Verifies the libnuma runtime library can be loaded.
Requirement matched.
Validating "libicu" ...
Required minimum version for "libicu": "49"
Actual version of package: "74.2"
Requirement matched.
DBT3533I The db2prereqcheck utility has confirmed that all installation prerequisites were met.
[root@lin1 server_dec]#
1.4 Install Db2
Now we install the Db2 server non-interactively into /opt/ibm/db2/V12.1 and accept the license with -y:
# run as root
cd ~/server_dec
./db2_install -n -b /opt/ibm/db2/V12.1 -y -p SERVER
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
cd ~/server_dec
./db2_install -n -b /opt/ibm/db2/V12.1 -y -p SERVER
Unit db2fmcd.service could not be found.
Deployment and Usage Data: This program collects data about the usage of the
program or its features, and about its deployment environment, and uses this
data to manage, support, improve and offer IBM products and services. This
Deployment and Usage Data collection and transmission functionality is enabled
by default, but you can opt out and disable it at any time as described in the
program documentation. For more information about IBM's collection and use of
Deployment and Usage Data, see the program documentation and the License
Information for the program.
The execution completed successfully.
For more information see the DB2 installation log at
"/tmp/db2_install.log.3438".
[root@lin1 server_dec]#
The installation takes a few minutes. The log file is written to /tmp/db2_install.log.<pid>. On RHEL 10 the message Unit db2fmcd.service could not be found. might be shown at the step “Starting Db2 Fault Monitor”. The installation still completes successfully (see chapter 2.4 for the autostart of the instance).
1.5 Verify the installation and the license
# run as root
# list the installed Db2 copies
/opt/ibm/db2/V12.1/install/db2ls
# show the license
/opt/ibm/db2/V12.1/adm/db2licm -l
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
# list the installed Db2 copies
/opt/ibm/db2/V12.1/install/db2ls
# show the license
/opt/ibm/db2/V12.1/adm/db2licm -l
Install Path Level Fix Pack Special Install Number Install Date Installer UID
---------------------------------------------------------------------------------------------------------------------
/opt/ibm/db2/V12.1 12.1.6.0 0 Sun Nov 29 10:19:06 2026 CET 0
Product name: "DB2 Community Edition"
License type: "Community"
Expiry date: "Permanent"
Product identifier: "db2dec"
Version information: "12.1"
Max amount of memory (GB): "8"
Max number of cores: "4"
Enforcement policy: "Soft Stop"
Features:
IBM DB2 Performance Management Offering: "Not licensed"
[root@lin1 server_dec]#
The output of db2licm -l should show the product identifier db2dec, the license type “Community” and the expiry date “Permanent”, together with the maximum number of cores and the maximum amount of memory.
2. The Db2 Instance
A Db2 instance is the database manager environment that owns one or more databases. It belongs to an OS user (the instance owner), and fenced user-defined functions and stored procedures run under a second OS user (the fenced user).
2.1 Create the OS users and groups
In contrast to my previous post we use the naming conventions from the IBM documentation and an additional group db2share (see chapter 2.2):
# run as root
groupadd db2iadm1
groupadd db2fsdm1
# shared group for the access to the instance files (see chapter 2.2)
groupadd db2share
useradd -g db2iadm1 -G db2share -m db2inst1
useradd -g db2fsdm1 -G db2share -m db2fenc1
echo 'db2inst1:changeme'|chpasswd
echo 'db2fenc1:changeme'|chpasswd
# access to the VirtualBox shared folder /sw
usermod -a -G vboxsf db2inst1
# the instance owner owns the database directories
chown -R db2inst1:db2iadm1 /db2
2.2 Create the instance
The instance is created with server authentication (users are authenticated by the OS of the Db2 server) and the TCP/IP port 50000. In Db2 12.1.6 db2icrt requires either the option -sharedgroup or -nosharedgroup, otherwise it fails with DBI20196E. With -sharedgroup the instance files are not world-writable, instead they are accessible for the members of the group db2share. The group must exist before the instance is created and must not be the primary group of the instance owner. Its members are the instance owner, the fenced user and all local users that connect to the instance (like app1 in chapter 3.3):
# run as root
/opt/ibm/db2/V12.1/instance/db2icrt -a server -p 50000 -sharedgroup db2share -u db2fenc1 db2inst1
# list the instances of this Db2 copy
/opt/ibm/db2/V12.1/instance/db2ilist
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
/opt/ibm/db2/V12.1/instance/db2icrt -a server -p 50000 -sharedgroup db2share -u db2fenc1 db2inst1
# list the instances of this Db2 copy
/opt/ibm/db2/V12.1/instance/db2ilist
DBI1446I The db2icrt command is running.
DB2 installation is being initialized.
Total number of tasks to be performed: 4
Total estimated time for all tasks to be performed: 309 second(s)
Task #1 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #1 end
Task #2 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #2 end
Task #3 start
Description: Configuring Db2 instances
Estimated time 300 second(s)
Task #3 end
Task #4 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #4 end
Deployment and Usage Data: This program collects data about the usage of the
program or its features, and about its deployment environment, and uses this
data to manage, support, improve and offer IBM products and services. This
Deployment and Usage Data collection and transmission functionality is enabled
by default, but you can opt out and disable it at any time as described in the
program documentation. For more information about IBM's collection and use of
Deployment and Usage Data, see the program documentation and the License
Information for the program.
The execution completed successfully.
For more information see the DB2 installation log at "/tmp/db2icrt.log.12588".
DBI1070I Program db2icrt completed successfully.
db2inst1
[root@lin1 server_dec]#
2.3 Start the instance and enable TCP/IP
The instance is managed as the instance owner. db2icrt added the Db2 environment (~/sqllib/db2profile) to the .bashrc of db2inst1:
# run as root
su - db2inst1 << 'EOF'
# make sure TCP/IP is enabled and the port is set
db2set DB2COMM=TCPIP
db2 update dbm cfg using SVCENAME 50000
db2start
# show the Db2 version and build level
db2level
# show the registry variables and the port
db2set -all
db2 get dbm cfg | grep SVCENAME
# check that Db2 listens on port 50000
ss -tlnp | grep 50000
# stop the instance
db2stop
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
# make sure TCP/IP is enabled and the port is set
db2set DB2COMM=TCPIP
db2 update dbm cfg using SVCENAME 50000
db2start
# show the Db2 version and build level
db2level
# show the registry variables and the port
db2set -all
db2 get dbm cfg | grep SVCENAME
# check that Db2 listens on port 50000
ss -tlnp | grep 50000
# stop the instance
db2stop
EOF
Last login: Sun Nov 29 10:29:00 CET 2026 on pts/0
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
11/29/2026 10:34:32 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
DB21085I This instance or install (instance name, where applicable:
"db2inst1") uses "64" bits and DB2 code release "SQL12016" with level
identifier "02070110".
Informational tokens are "DB2 v12.1.6.0", "s2610161644", "DYN2610161644AMD64",
and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V12.1".
[i] DB2COMM=TCPIP
[g] DB2SYSTEM=lin1.fritz.box
TCP/IP Service name (SVCENAME) = 50000
SSL service name (SSL_SVCENAME) =
LISTEN 0 4096 0.0.0.0:50000 0.0.0.0:* users:(("db2sysc",pid=17911,fd=9))
11/29/2026 10:34:34 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
[root@lin1 server_dec]#
Personal settings of the instance owner should be placed in the file ~/sqllib/userprofile. It is sourced by db2profile and is preserved when the instance is updated:
# run as root
cat << 'EOF' >> /home/db2inst1/sqllib/userprofile
# follow the Db2 diagnostic log (like tail -f)
alias dlog='db2diag -f'
# change to the diagnostic directory
alias dcd='cd ~/sqllib/db2dump'
EOF
chown db2inst1:db2iadm1 /home/db2inst1/sqllib/userprofile
2.4 Start the instance automatically
Db2 has its own fault monitor (db2fmcd) and the command db2iauto -on db2inst1 to start an instance at boot time. Because of the db2fmcd.service message during the installation on RHEL 10, we use a simple systemd unit instead. This also fits well into an automated setup, because the instance can be handled like any other service:
# run as root
cat << 'EOF' > /etc/systemd/system/db2inst1.service
[Unit]
Description=IBM Db2 instance db2inst1
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
User=db2inst1
LimitNOFILE=65536
ExecStart=/bin/bash -lc db2start
ExecStop=/bin/bash -lc "db2stop force"
TimeoutStartSec=300
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable db2inst1 --now
systemctl status db2inst1
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
cat << 'EOF' > /etc/systemd/system/db2inst1.service
[Unit]
Description=IBM Db2 instance db2inst1
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
User=db2inst1
LimitNOFILE=65536
ExecStart=/bin/bash -lc db2start
ExecStop=/bin/bash -lc "db2stop force"
TimeoutStartSec=300
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable db2inst1 --now
systemctl status db2inst1
Created symlink '/etc/systemd/system/multi-user.target.wants/db2inst1.service' → '/etc/systemd/system/db2inst1.service'.
● db2inst1.service - IBM Db2 instance db2inst1
Loaded: loaded (/etc/systemd/system/db2inst1.service; enabled; preset: disabled)
Active: active (exited) since Sun 2026-11-29 10:36:30 CET; 23ms ago
Invocation: aba14e57aaf641b892f016307f376610
Process: 18234 ExecStart=/bin/bash -lc db2start (code=exited, status=0/SUCCESS)
Main PID: 18234 (code=exited, status=0/SUCCESS)
Tasks: 23 (limit: 48421)
Memory: 420.8M (peak: 472.3M)
CPU: 927ms
CGroup: /system.slice/db2inst1.service
├─18286 "db2wdog 0 [db2inst1]"
├─18290 "db2sysc 0"
├─18298 "db2ckpwd 0"
├─18299 "db2ckpwd 0"
├─18300 "db2ckpwd 0"
├─18302 "db2vend (PD Vendor Process - 1) 0"
└─18319 db2fmpr 1,0,0,0,1,0,0,00000000,0,0,0,0000000000000000,0000000000000000,00000000,00000000,00000000,00000000,00000000,00000000,0000,00000000>
Nov 29 10:36:28 lin1.fritz.box systemd[1]: Starting db2inst1.service - IBM Db2 instance db2inst1...
Nov 29 10:36:30 lin1.fritz.box bash[18234]: 11/29/2026 10:36:30 0 0 SQL1063N DB2START processing was successful.
Nov 29 10:36:30 lin1.fritz.box bash[18234]: SQL1063N DB2START processing was successful.
Nov 29 10:36:30 lin1.fritz.box systemd[1]: Finished db2inst1.service - IBM Db2 instance db2inst1.
[root@lin1 server_dec]#
The instance must be stopped before the unit is started for the first time: db2start returns an error (SQL1026N) if the instance is already running, and the unit is marked as failed.
3. Databases, Users and Remote Connections
3.1 Create databases
The tool db2sampl creates the well-known SAMPLE database. For our tests we also create our own database testdb in the directory /db2/data:
# run as root
su - db2inst1 << 'EOF'
db2sampl
db2 "create database testdb on /db2/data dbpath on /db2/data using codeset UTF-8 territory DE pagesize 32 K"
# list the databases of the instance
db2 list db directory
# start the database and list the active databases
db2 activate db testdb
db2 list active databases
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2sampl
db2 "create database testdb on /db2/data dbpath on /db2/data using codeset UTF-8 territory DE pagesize 32 K"
# list the databases of the instance
db2 list db directory
# start the database and list the active databases
db2 activate db testdb
db2 list active databases
EOF
Last login: Sun Nov 29 10:34:28 CET 2026
Creating database "SAMPLE"...
Connecting to database "SAMPLE"...
Creating tables and data in schema "DB2INST1"...
Creating tables with XML columns and XML data in schema "DB2INST1"...
Creating tables with VECTOR columns and VECTOR data in schema "DB2INST1"...
'db2sampl' processing complete.
DB20000I The CREATE DATABASE command completed successfully.
System Database Directory
Number of entries in the directory = 2
Database 1 entry:
Database alias = TESTDB
Database name = TESTDB
Local database directory = /db2/data
Database release level = 16.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
Database 2 entry:
Database alias = SAMPLE
Database name = SAMPLE
Local database directory = /home/db2inst1
Database release level = 16.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
DB20000I The ACTIVATE DATABASE command completed successfully.
Active Databases
Database name = TESTDB
Applications connected currently = 0
Database path = /db2/data/db2inst1/NODE0000/SQL00001/MEMBER0000/
[root@lin1 server_dec]#
The database uses automatic storage, so table spaces grow automatically in the storage path /db2/data.
3.2 Working with the Db2 Command Line Processor (CLP)
SQL statements can be passed to the db2 command in double quotes. The connection is kept until db2 connect reset or db2 terminate:
# run as root
su - db2inst1 << 'EOF'
db2 connect to testdb
db2 "create table demo.orders (id int not null generated always as identity primary key, customer varchar(50), amount decimal(10,2), created timestamp default current timestamp)"
db2 "insert into demo.orders (customer, amount) values ('Huber', 120.50), ('Maier', 75.00)"
db2 "select * from demo.orders"
db2 list tables for schema demo
db2 describe table demo.orders
db2 connect reset
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2 connect to testdb
db2 "create table demo.orders (id int not null generated always as identity primary key, customer varchar(50), amount decimal(10,2), created timestamp default current timestamp)"
db2 "insert into demo.orders (customer, amount) values ('Huber', 120.50), ('Maier', 75.00)"
db2 "select * from demo.orders"
db2 list tables for schema demo
db2 describe table demo.orders
db2 connect reset
EOF
Last login: Sun Nov 29 10:37:51 CET 2026
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = DB2INST1
Local database alias = TESTDB
DB20000I The SQL command completed successfully.
DB20000I The SQL command completed successfully.
ID CUSTOMER AMOUNT CREATED
----------- -------------------------------------------------- ------------ --------------------------
1 Huber 120.50 2026-11-29-10.41.14.251979
2 Maier 75.00 2026-11-29-10.41.14.251979
2 record(s) selected.
Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
ORDERS DEMO T 2026-11-29-10.41.14.078134
1 record(s) selected.
Data type Column
Column name schema Data type name Length Scale Nulls
------------------------------- --------- ------------------- ---------- ----- ------
ID SYSIBM INTEGER 4 0 No
CUSTOMER SYSIBM VARCHAR 50 0 Yes
AMOUNT SYSIBM DECIMAL 10 2 Yes
CREATED SYSIBM TIMESTAMP 10 6 Yes
4 record(s) selected.
DB20000I The SQL command completed successfully.
[root@lin1 server_dec]#
Longer scripts are run with db2 -tvf script.sql (-t: statements end with a semicolon, -v: echo the statements, -f: read from file). Calling db2 without arguments starts the interactive CLP, which is left with quit.
3.3 Create an application user
Db2 has no database users of its own. Users are authenticated by the operating system (or LDAP) and authorized with GRANT statements in the database:
# run as root
useradd -G db2share app1; echo 'app1:changeme'|chpasswd
# grant privileges and test the connection as db2inst1
su - db2inst1 << 'EOF'
db2 connect to testdb
db2 "grant connect on database to user app1"
db2 "grant select, insert, update, delete on demo.orders to user app1"
db2 connect reset
# test the connection as app1
db2 connect to testdb user app1 using changeme
db2 "select count(*) from demo.orders"
db2 terminate
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
useradd -G db2share app1; echo 'app1:changeme'|chpasswd
# grant privileges and test the connection as db2inst1
su - db2inst1 << 'EOF'
db2 connect to testdb
db2 "grant connect on database to user app1"
db2 "grant select, insert, update, delete on demo.orders to user app1"
db2 connect reset
# test the connection as app1
db2 connect to testdb user app1 using changeme
db2 "select count(*) from demo.orders"
db2 terminate
EOF
Last login: Sun Nov 29 10:41:12 CET 2026
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = DB2INST1
Local database alias = TESTDB
DB20000I The SQL command completed successfully.
DB20000I The SQL command completed successfully.
DB20000I The SQL command completed successfully.
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = APP1
Local database alias = TESTDB
1
-----------
2
1 record(s) selected.
DB20000I The TERMINATE command completed successfully.
[root@lin1 server_dec]#
3.4 Remote connections
The instance already listens on port 50000. The firewall is disabled in our VM; on a system with an active firewall the port has to be opened with firewall-cmd --permanent --add-port=50000/tcp && firewall-cmd --reload.
Tools like DBeaver connect with the IBM JDBC driver (JCC) and the URL jdbc:db2://<hostname>:50000/testdb. On a client with the IBM Data Server Client installed, the database is cataloged once and can then be used with the CLP:
# run on the client
db2 catalog tcpip node db2srv remote <hostname> server 50000
db2 catalog db testdb at node db2srv
db2 terminate
db2 connect to testdb user app1 using changeme
4. Typical DBA Tasks
All commands in this chapter are run as the instance owner db2inst1. As in chapter 2.3 they are wrapped in su - db2inst1 << 'EOF' ... EOF, so each block can be pasted into a root terminal. The output shows the result of each command.
4.1 Configuration
Db2 has three configuration levels: the registry (db2set), the database manager configuration of the instance (dbm cfg) and the database configuration (db cfg). New databases use the self-tuning memory manager (STMM), so on a test system most memory parameters can stay on AUTOMATIC:
# run as root
su - db2inst1 << 'EOF'
db2set -all
db2 get dbm cfg | grep -E "INSTANCE_MEMORY|SVCENAME|DIAGPATH"
db2 connect to testdb
db2 get db cfg show detail | grep -E "SELF_TUNING_MEM|DATABASE_MEMORY|LOGFILSIZ|LOGPRIMARY|LOGARCHMETH1|AUTO_MAINT"
# example: larger transaction logs (active after the next database activation)
db2 update db cfg for testdb using LOGFILSIZ 16384 LOGPRIMARY 10 LOGSECOND 20
db2 connect reset
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2set -all
db2 get dbm cfg | grep -E "INSTANCE_MEMORY|SVCENAME|DIAGPATH"
db2 connect to testdb
db2 get db cfg show detail | grep -E "SELF_TUNING_MEM|DATABASE_MEMORY|LOGFILSIZ|LOGPRIMARY|LOGARCHMETH1|AUTO_MAINT"
# example: larger transaction logs (active after the next database activation)
db2 update db cfg for testdb using LOGFILSIZ 16384 LOGPRIMARY 10 LOGSECOND 20
db2 connect reset
EOF
Last login: Sun Nov 29 10:42:09 CET 2026
[i] DB2COMM=TCPIP
[g] DB2SYSTEM=lin1.fritz.box
Diagnostic data directory path (DIAGPATH) = /home/db2inst1/sqllib/db2dump/ $m
Current member resolved DIAGPATH = /home/db2inst1/sqllib/db2dump/DIAG0000/
Alternate diagnostic data directory path (ALT_DIAGPATH) =
Current member resolved ALT_DIAGPATH =
Global instance memory (% or 4KB) (INSTANCE_MEMORY) = AUTOMATIC(1625734)
TCP/IP Service name (SVCENAME) = 50000
SSL service name (SSL_SVCENAME) =
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = DB2INST1
Local database alias = TESTDB
Self tuning memory (SELF_TUNING_MEM) = ON (Active) ON
Size of database shared memory (4KB) (DATABASE_MEMORY) = AUTOMATIC(451488) AUTOMATIC(446008)
Log file size (4KB) (LOGFILSIZ) = 1024 1024
Number of primary log files (LOGPRIMARY) = 13 13
First log archive method (LOGARCHMETH1) = OFF OFF
Automatic maintenance (AUTO_MAINT) = ON ON
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.
DB20000I The SQL command completed successfully.
[root@lin1 server_dec]#
4.2 Backup and recovery
By default a new database uses circular logging, which only allows offline backups and no roll-forward recovery. For online backups and point-in-time recovery we switch to archive logging. After this change the database is in BACKUP PENDING state and needs a full offline backup:
# run as root
su - db2inst1 << 'EOF'
db2 update db cfg for testdb using LOGARCHMETH1 DISK:/db2/archlog
# offline backup (disconnects all applications!)
db2 force applications all
db2 deactivate db testdb
db2 backup db testdb to /db2/backup compress
db2 activate db testdb
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2 update db cfg for testdb using LOGARCHMETH1 DISK:/db2/archlog
# offline backup (disconnects all applications!)
db2 force applications all
db2 deactivate db testdb
db2 backup db testdb to /db2/backup compress
db2 activate db testdb
EOF
Last login: Sun Nov 29 10:47:46 CET 2026
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
DB20000I The DEACTIVATE DATABASE command completed successfully.
Backup successful. The timestamp for this backup image is : 20261129104944
DB20000I The ACTIVATE DATABASE command completed successfully.
[root@lin1 server_dec]#
From now on online backups are possible. With include logs the log files needed to restore a consistent database are stored in the backup image:
# run as root
su - db2inst1 << 'EOF'
db2 backup db testdb online to /db2/backup compress include logs
# list the backups in the recovery history
db2 list history backup all for testdb
# check the backup image
ls -l /db2/backup
db2ckbkp -h /db2/backup/TESTDB.0.db2inst1.DBPART000.20261129105052.001
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2 backup db testdb online to /db2/backup compress include logs
# list the backups in the recovery history
db2 list history backup all for testdb
# check the backup image
ls -l /db2/backup
db2ckbkp -h /db2/backup/TESTDB.0.db2inst1.DBPART000.20261129105052.001
EOF
Last login: Sun Nov 29 10:50:51 CET 2026
Backup successful. The timestamp for this backup image is : 20261129105303
List History File for testdb
Number of matching file entries = 3
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20261129104944001 F D S0000000.LOG S0000000.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP TESTDB OFFLINE
Start Time: 20261129104944
End Time: 20261129104945
Status: A
Total Size: 75554816 (bytes)
Seq Size: 75554816 (bytes)
Compr Lib: C
Encrypted: No
Incl Logs: No
----------------------------------------------------------------------------
EID: 2 Location: /db2/backup
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20261129105052001 N D S0000000.LOG S0000000.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP TESTDB ONLINE
Start Time: 20261129105052
End Time: 20261129105053
Status: A
Total Size: 51441664 (bytes)
Seq Size: 51441664 (bytes)
Compr Lib: C
Encrypted: No
Incl Logs: Yes
----------------------------------------------------------------------------
EID: 5 Location: /db2/backup
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20261129105303001 N D S0000001.LOG S0000001.LOG
----------------------------------------------------------------------------
Contains 3 tablespace(s):
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP TESTDB ONLINE
Start Time: 20261129105303
End Time: 20261129105304
Status: A
Total Size: 51441664 (bytes)
Seq Size: 51441664 (bytes)
Compr Lib: C
Encrypted: No
Incl Logs: Yes
----------------------------------------------------------------------------
EID: 7 Location: /db2/backup
total 174256
-rw------- 1 db2inst1 db2iadm1 75554816 Nov 29 10:49 TESTDB.0.db2inst1.DBPART000.20261129104944.001
-rw------- 1 db2inst1 db2iadm1 51441664 Nov 29 10:50 TESTDB.0.db2inst1.DBPART000.20261129105052.001
-rw------- 1 db2inst1 db2iadm1 51441664 Nov 29 10:53 TESTDB.0.db2inst1.DBPART000.20261129105303.001
=====================
MEDIA HEADER REACHED:
=====================
Server Database Name -- TESTDB
Server Database Alias -- TESTDB
Client Database Alias -- TESTDB
Timestamp -- 20261129105052
Database Partition Number -- 0
Instance -- db2inst1
Database Configuration Type -- 0 (Non-shared data)
Sequence Number -- 1
Database Member ID -- 0
Image Version -- 2
Minimum Compat. Image Version -- 2
Release ID -- 0x1600 (DB2 v12.1.6.0)
Product Version -- V:12 R:1 M:6 F:0 I:0 SB:0
Database Seed -- 0xFF8F88FA
DB Comment's Codepage (Volume) -- 0
DB Comment (Volume) --
DB Comment's Codepage (System) -- 0
DB Comment (System) --
Authentication Value -- 255 (Not specified)
Backup Mode -- 1 (Online)
Includes Logs -- 1 (Yes)
Compression -- 1 (Compressed)
Backup Type -- 0 (Database-level)
Backup Granularity -- 0 (Non-incremental)
Merged Backup Image -- 0 (No)
Status Flags -- 0x1021
Consistent across all members
LOGARCHMETH1 is set
Database uses default primary log path
System Catalogs in this image -- 1 (Yes)
Catalog Partition Number -- 0
DB Codeset -- UTF-8
DB Territory -- DE
LogID -- 1795945125
LogPath -- Default
Backup Buffer Size -- 7344128 (1793 4K pages)
Number of Sessions -- 1
Platform -- 0x1E (Linux-x86-64)
Encrypt Info Flags -- 0x0
The proper image file name would be:
TESTDB.0.db2inst1.DBPART000.20261129105052.001
[1] Buffers processed: ########
Image Verification Complete - successful.
[root@lin1 server_dec]#
Point-in-time recovery: Let’s simulate a user error. We insert a row, note the time and drop the table afterwards. archive log closes the current log file and copies it to /db2/archlog:
# run as root
su - db2inst1 << 'EOF'
db2 connect to testdb
db2 "insert into demo.orders (customer, amount) values ('Schmidt', 300.00)"
db2 "values current timestamp"
# wait a few seconds
sleep 10
db2 "drop table demo.orders"
db2 connect reset
db2 archive log for db testdb
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2 connect to testdb
db2 "insert into demo.orders (customer, amount) values ('Schmidt', 300.00)"
db2 "values current timestamp"
# wait a few seconds
sleep 10
db2 "drop table demo.orders"
db2 connect reset
db2 archive log for db testdb
EOF
Last login: Sun Nov 29 10:53:02 CET 2026
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = DB2INST1
Local database alias = TESTDB
DB20000I The SQL command completed successfully.
1
--------------------------
2026-11-29-10.53.58.387190
1 record(s) selected.
DB20000I The SQL command completed successfully.
DB20000I The SQL command completed successfully.
DB20000I The ARCHIVE LOG command completed successfully.
[root@lin1 server_dec]#
Now we restore the online backup and roll forward to the timestamp before the DROP TABLE (the format is yyyy-mm-dd-hh.mm.ss):
# run as root
su - db2inst1 << 'EOF'
db2 force applications all
db2 deactivate db testdb
db2 restore db testdb from /db2/backup taken at 20261129105303 replace existing without prompting
db2 rollforward db testdb to 2026-11-29-10.53.58 using local time and stop
db2 connect to testdb
db2 "select * from demo.orders"
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2 force applications all
db2 deactivate db testdb
db2 restore db testdb from /db2/backup taken at 20261129105303 replace existing without prompting
db2 rollforward db testdb to 2026-11-29-10.53.58 using local time and stop
db2 connect to testdb
db2 "select * from demo.orders"
EOF
Last login: Sun Nov 29 11:37:43 CET 2026
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
DB20000I The DEACTIVATE DATABASE command completed successfully.
SQL2540W Restore is successful, however a warning "2539" was encountered
during Database Restore while processing in No Interrupt mode.
Rollforward Status
Input database alias = testdb
Number of members have returned status = 1
Member ID = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000001.LOG - S0000003.LOG
Last committed transaction = 2026-11-29-10.53.58.000000 Local
DB20000I The ROLLFORWARD command completed successfully.
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = DB2INST1
Local database alias = TESTDB
ID CUSTOMER AMOUNT CREATED
----------- -------------------------------------------------- ------------ --------------------------
1 Huber 120.50 2026-11-29-10.41.14.251979
2 Maier 75.00 2026-11-29-10.41.14.251979
21 Schmidt 300.00 2026-11-29-10.53.58.355026
3 record(s) selected.
[root@lin1 server_dec]#
The table is back and contains the row inserted after the backup. The required log files are read from the archive directory /db2/archlog.
The new row has the ID 21 instead of 3. By default Db2 caches 20 values of an identity column (CACHE 20), and the unused cached values are lost when the database is deactivated. This happened during the offline backup above, so gaps in identity columns are normal. If gaps are not acceptable, the identity column can be created with NO CACHE, at the cost of some insert performance.
4.3 Monitoring
db2pd reads the shared memory of the instance directly and works even if the database hangs. The MON_GET table functions and the SYSIBMADM views are the SQL interface for monitoring:
# run as root
su - db2inst1 << 'EOF'
db2 activate db testdb
# connected applications, transaction logs, buffer pools
db2pd -db testdb -applications
db2pd -db testdb -logs
db2pd -db testdb -bufferpools
db2 connect to testdb
db2 list applications
# CPUs and memory (MB) as seen by Db2
db2 "select varchar(os_name,10) os_name, varchar(host_name,30) host_name, total_cpus, total_memory from sysibmadm.env_sys_info"
# connections
db2 "select application_handle, varchar(application_name,20) application_name, varchar(system_auth_id,12) auth_id, varchar(client_hostname,30) client_hostname from table(mon_get_connection(null,-2))"
# buffer pool hit ratios
db2 "select varchar(bp_name,20) bp_name, data_hit_ratio_percent, index_hit_ratio_percent from sysibmadm.mon_bp_utilization"
# table space usage
db2 "select varchar(tbsp_name,20) tbsp_name, tbsp_used_pages*tbsp_page_size/1024 used_kb, tbsp_total_pages*tbsp_page_size/1024 total_kb from table(mon_get_tablespace(null,-2))"
# top 10 user tables by rows read
db2 "select varchar(tabschema,10) tabschema, varchar(tabname,30) tabname, rows_read, rows_inserted from table(mon_get_table('','',-2)) where tabschema not like 'SYS%' order by rows_read desc fetch first 10 rows only"
db2 connect reset
# errors and severe messages of the last day in db2diag.log
db2diag -level Error,Severe -H 1d
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2 activate db testdb
# connected applications, transaction logs, buffer pools
db2pd -db testdb -applications
db2pd -db testdb -logs
db2pd -db testdb -bufferpools
db2 connect to testdb
db2 list applications
# CPUs and memory (MB) as seen by Db2
db2 "select varchar(os_name,10) os_name, varchar(host_name,30) host_name, total_cpus, total_memory from sysibmadm.env_sys_info"
# connections
db2 "select application_handle, varchar(application_name,20) application_name, varchar(system_auth_id,12) auth_id, varchar(client_hostname,30) client_hostname from table(mon_get_connection(null,-2))"
# buffer pool hit ratios
db2 "select varchar(bp_name,20) bp_name, data_hit_ratio_percent, index_hit_ratio_percent from sysibmadm.mon_bp_utilization"
# table space usage
db2 "select varchar(tbsp_name,20) tbsp_name, tbsp_used_pages*tbsp_page_size/1024 used_kb, tbsp_total_pages*tbsp_page_size/1024 total_kb from table(mon_get_tablespace(null,-2))"
# top 10 user tables by rows read
db2 "select varchar(tabschema,10) tabschema, varchar(tabname,30) tabname, rows_read, rows_inserted from table(mon_get_table('','',-2)) where tabschema not like 'SYS%' order by rows_read desc fetch first 10 rows only"
db2 connect reset
# errors and severe messages of the last day in db2diag.log
db2diag -level Error,Severe -H 1d
EOF
Last login: Sun Nov 29 11:41:01 CET 2026
DB20000I The ACTIVATE DATABASE command completed successfully.
Database Member 0 -- Database TESTDB -- Active -- Up 0 days 00:00:01 -- Date 2026-11-29-11.42.31.312431
Applications:
Address AppHandl [nod-index] NumAgents CoorEDUID Status C-AnchID C-StmtUID L-AnchID L-StmtUID Appid WorkloadID WorkloadOccID CollectActData CollectActPartition CollectSectionActuals
0x0000000203AE0080 243 [000-00243] 1 267 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104232 0 0 N C N
0x00000002037847A0 256 [000-00256] 1 457 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104245 0 0 N C N
0x0000000203D20080 249 [000-00249] 1 450 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104238 0 0 N C N
0x00000002035F6960 242 [000-00242] 1 343 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104231 0 0 N C N
0x0000000203760080 255 [000-00255] 1 456 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104244 0 0 N C N
0x0000000203CF5180 248 [000-00248] 1 449 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104237 0 0 N C N
0x0000000203735180 254 [000-00254] 1 455 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104243 0 0 N C N
0x0000000203B847A0 247 [000-00247] 1 448 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104236 0 0 N C N
0x0000000203B60080 246 [000-00246] 1 447 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104235 0 0 N C N
0x00000002036A0080 252 [000-00252] 1 453 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104241 0 0 N C N
0x0000000203A75180 245 [000-00245] 1 446 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104234 0 0 N C N
0x0000000203675180 251 [000-00251] 1 452 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104240 0 0 N C N
0x0000000203B047A0 244 [000-00244] 1 445 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104233 0 0 N C N
0x0000000203D447A0 250 [000-00250] 1 451 ConnectCompleted 0 0 0 0 *LOCAL.DB2.261129104239 0 0 N C N
External Connection Attributes
Address AppHandl [nod-index] ClientIPAddress EncryptionLvl SystemAuthID
0x0000000203AE0080 243 [000-00243] n/a None DB2INST1
0x00000002037847A0 256 [000-00256] n/a None DB2INST1
0x0000000203D20080 249 [000-00249] n/a None DB2INST1
0x00000002035F6960 242 [000-00242] n/a None DB2INST1
0x0000000203760080 255 [000-00255] n/a None DB2INST1
0x0000000203CF5180 248 [000-00248] n/a None DB2INST1
0x0000000203735180 254 [000-00254] n/a None DB2INST1
0x0000000203B847A0 247 [000-00247] n/a None DB2INST1
0x0000000203B60080 246 [000-00246] n/a None DB2INST1
0x00000002036A0080 252 [000-00252] n/a None DB2INST1
0x0000000203A75180 245 [000-00245] n/a None DB2INST1
0x0000000203675180 251 [000-00251] n/a None DB2INST1
0x0000000203B047A0 244 [000-00244] n/a None DB2INST1
0x0000000203D447A0 250 [000-00250] n/a None DB2INST1
Trusted Connection Attributes
Address AppHandl [nod-index] TrustedContext ConnTrustType RoleInherited TLSVersion SSLCipherSpec SSLSrvCertLabel SSLSrvCertFingerprint
0x0000000203AE0080 243 [000-00243] n/a non trusted n/a n/a n/a n/a n/a
0x00000002037847A0 256 [000-00256] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203D20080 249 [000-00249] n/a non trusted n/a n/a n/a n/a n/a
0x00000002035F6960 242 [000-00242] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203760080 255 [000-00255] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203CF5180 248 [000-00248] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203735180 254 [000-00254] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203B847A0 247 [000-00247] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203B60080 246 [000-00246] n/a non trusted n/a n/a n/a n/a n/a
0x00000002036A0080 252 [000-00252] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203A75180 245 [000-00245] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203675180 251 [000-00251] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203B047A0 244 [000-00244] n/a non trusted n/a n/a n/a n/a n/a
0x0000000203D447A0 250 [000-00250] n/a non trusted n/a n/a n/a n/a n/a
Autonomous Routine Connections
Address AppHandl [nod-index] Status Autonomous Routine Handl [nod-index] Status
Anonymous Block Connections
Address AppHandl [nod-index] Status Anonymous Block Handl [nod-index] Status
Database Member 0 -- Database TESTDB -- Active -- Up 0 days 00:00:01 -- Date 2026-11-29-11.42.31.477734
Logs:
Current Log Number 0
Pages Written 0
Cur Commit Disk Log Reads 0
Cur Commit Total Log Reads 0
Method 1 Archive Status n/a
Method 1 Next Log to Archive 4
Method 1 First Failure n/a
Method 2 Archive Status n/a
Method 2 Next Log to Archive n/a
Method 2 First Failure n/a
Last Log Validation Error n/a
Extraction Status n/a (0)
Extraction Throttle Reason n/a
Current Log to Extract n/a
Log Chain ID 1
Current LSO 332438561
Current LSN 0x00000000000533DF
Address StartLSN StartLSO State Size Pages Filename
0x00007F7DD59629D0 0000000000000000 332438561 0x00000000 16384 16384 S0000004.LOG
0x00007F7DD5963B50 0000000000000000 399219745 0x00000000 16384 16384 S0000005.LOG
0x00007F7DD59644B0 0000000000000000 466000929 0x00000000 16384 16384 S0000006.LOG
0x00007F7DD5964E10 0000000000000000 532782113 0x00000000 16384 16384 S0000007.LOG
0x00007F7DD5965770 0000000000000000 599563297 0x00000000 16384 16384 S0000008.LOG
0x00007F7DD59660D0 0000000000000000 666344481 0x00000000 16384 16384 S0000009.LOG
0x00007F7DD5966A30 0000000000000000 733125665 0x00000000 16384 16384 S0000010.LOG
0x00007F7DD5967390 0000000000000000 799906849 0x00000000 16384 16384 S0000011.LOG
0x00007F7DD5967CF0 0000000000000000 866688033 0x00000000 16384 16384 S0000012.LOG
0x00007F7DD5968650 0000000000000000 933469217 0x00000000 16384 16384 S0000013.LOG
Database Member 0 -- Database TESTDB -- Active -- Up 0 days 00:00:01 -- Date 2026-11-29-11.42.31.638327
Bufferpools:
First Active Pool ID 1
Max Bufferpool ID 1
Max Bufferpool ID on Disk 1
Num Bufferpools 5
Address Id Name PageSz PA-NumPgs BA-NumPgs BlkSize NumTbsp PgsToRemov CurrentSz PostAlter SuspndTSCt Automatic
0x00007F7DD5A14620 1 IBMDEFAULTBP 32768 32433 0 0 4 0 32433 32433 0 True
0x00007F7DD59DFF20 4096 IBMSYSTEMBP4K 4096 16 0 0 0 0 16 16 0 False
0x00007F7DD59ED0E0 4097 IBMSYSTEMBP8K 8192 16 0 0 0 0 16 16 0 False
0x00007F7DD59FA2A0 4098 IBMSYSTEMBP16K 16384 16 0 0 0 0 16 16 0 False
0x00007F7DD5A07460 4099 IBMSYSTEMBP32K 32768 16 0 0 0 0 16 16 0 False
Bufferpool Statistics for all bufferpools (when BUFFERPOOL monitor switch is ON):
BPID DatLRds DatPRds HitRatio TmpDatLRds TmpDatPRds HitRatio IdxLRds IdxPRds HitRatio TmpIdxLRds TmpIdxPRds HitRatio
1 0 0 00.00% 0 0 00.00% 0 0 00.00% 0 0 00.00%
4096 0 0 00.00% 0 0 00.00% 0 0 00.00% 0 0 00.00%
4097 0 0 00.00% 0 0 00.00% 0 0 00.00% 0 0 00.00%
4098 0 0 00.00% 0 0 00.00% 0 0 00.00% 0 0 00.00%
4099 0 0 00.00% 0 0 00.00% 0 0 00.00% 0 0 00.00%
BPID DataWrts IdxWrts DirRds DirRdReqs DirRdTime DirWrts DirWrtReqs DirWrtTime
1 0 0 0 0 0 0 0 0
4096 0 0 0 0 0 0 0 0
4097 0 0 0 0 0 0 0 0
4098 0 0 0 0 0 0 0 0
4099 0 0 0 0 0 0 0 0
BPID AsDatRds AsDatRdReq AsIdxRds AsIdxRdReq AsRdTime AsDatWrts AsIdxWrts AsWrtTime
1 0 0 0 0 0 0 0 0
4096 0 0 0 0 0 0 0 0
4097 0 0 0 0 0 0 0 0
4098 0 0 0 0 0 0 0 0
4099 0 0 0 0 0 0 0 0
BPID TotRdTime TotWrtTime VectIORds VectIOReq BlockIORds BlockIOReq FilesClose NoVictAvl UnRdPFetch
1 0 0 0 0 0 0 0 0 0
4096 0 0 0 0 0 0 0 0 0
4097 0 0 0 0 0 0 0 0 0
4098 0 0 0 0 0 0 0 0 0
4099 0 0 0 0 0 0 0 0 0
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = DB2INST1
Local database alias = TESTDB
Auth Id Application Appl. Application Id DB # of
Name Handle Name Agents
-------- -------------- ---------- -------------------------------------------------------------- -------- -----
DB2INST1 db2bp 257 *LOCAL.db2inst1.261129104246 TESTDB 1
OS_NAME HOST_NAME TOTAL_CPUS TOTAL_MEMORY
---------- ------------------------------ -------------------- --------------------
Linux lin1.fritz.box 4 7661
1 record(s) selected.
APPLICATION_HANDLE APPLICATION_NAME AUTH_ID CLIENT_HOSTNAME
-------------------- -------------------- ------------ ------------------------------
257 db2bp DB2INST1 lin1.fritz.box
1 record(s) selected.
BP_NAME DATA_HIT_RATIO_PERCENT INDEX_HIT_RATIO_PERCENT
-------------------- ---------------------- -----------------------
IBMDEFAULTBP 90.09 79.08
IBMSYSTEMBP4K - -
IBMSYSTEMBP8K - -
IBMSYSTEMBP16K - -
IBMSYSTEMBP32K - -
5 record(s) selected.
TBSP_NAME USED_KB TOTAL_KB
-------------------- -------------------- --------------------
SYSCATSPACE 235520 262144
TEMPSPACE1 32 32
USERSPACE1 7168 32768
SYSTOOLSPACE 2560 32768
4 record(s) selected.
TABSCHEMA TABNAME ROWS_READ ROWS_INSERTED
---------- ------------------------------ -------------------- --------------------
0 record(s) selected.
DB20000I The SQL command completed successfully.
[root@lin1 server_dec]#
A hanging application can be disconnected with db2 "force application (<application handle>)".
4.4 Maintenance
Automatic maintenance (AUTO_MAINT, AUTO_RUNSTATS) is enabled by default, so statistics are collected in the background. After large data loads it is still useful to run the maintenance manually. db2look extracts the DDL of a database, e.g. to recreate the schema on another system:
# run as root
su - db2inst1 << 'EOF'
db2 connect to testdb
db2 "runstats on table demo.orders with distribution and detailed indexes all"
db2 "reorgchk current statistics on table demo.orders"
db2 "reorg table demo.orders"
db2 connect reset
# extract the DDL of the database
db2look -d testdb -e -o /tmp/testdb.ddl
EOF
Sample Output (click to expand):
[root@lin1 server_dec]# # run as root
su - db2inst1 << 'EOF'
db2 connect to testdb
db2 "runstats on table demo.orders with distribution and detailed indexes all"
db2 "reorgchk current statistics on table demo.orders"
db2 "reorg table demo.orders"
db2 connect reset
# extract the DDL of the database
db2look -d testdb -e -o /tmp/testdb.ddl
EOF
Last login: Sun Nov 29 11:42:29 CET 2026
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = DB2INST1
Local database alias = TESTDB
DB20000I The RUNSTATS command completed successfully.
Table statistics:
F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80
SCHEMA.NAME CARD OV NP FP ACTBLK TSIZE F1 F2 F3 REORG
----------------------------------------------------------------------------------------
Table: DEMO.ORDERS
3 0 1 1 - 126 0 - 100 ---
----------------------------------------------------------------------------------------
Index statistics:
F4: CLUSTERRATIO or normalized CLUSTERFACTOR > 80
F5: 100 * (Space used on leaf pages / Space available on non-empty leaf pages) > MIN(50, (100 - PCTFREE))
F6: (100 - PCTFREE) * (Amount of space available in an index with one less level / Amount of space required for all keys) < 100
F7: 100 * (Number of pseudo-deleted RIDs / Total number of RIDs) < 20
F8: 100 * (Number of pseudo-empty leaf pages / Total number of leaf pages) < 20
SCHEMA.NAME INDCARD LEAF ELEAF LVLS NDEL KEYS LEAF_RECSIZE NLEAF_RECSIZE LEAF_PAGE_OVERHEAD NLEAF_PAGE_OVERHEAD PCT_PAGES_SAVED F4 F5 F6 F7 F8 REORG
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Table: DEMO.ORDERS
Index: SYSIBM.SQL261129104114160
3 1 0 1 0 3 4 4 5122 5122 0 100 - - 0 0 -----
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CLUSTERRATIO or normalized CLUSTERFACTOR (F4) will indicate REORG is necessary
for indexes that are not in the same sequence as the base table. When multiple
indexes are defined on a table, one or more indexes may be flagged as needing
REORG. Specify the most important index for REORG sequencing.
Tables defined using the ORGANIZE BY clause and the corresponding dimension
indexes have a '*' suffix to their names. The cardinality of a dimension index
is equal to the Active blocks statistic of the table.
DB20000I The REORG command completed successfully.
DB20000I The SQL command completed successfully.
-- No userid was specified, db2look tries to use Environment variable USER
-- USER is: DB2INST1
-- Creating DDL for table(s)
-- Output is sent to file: /tmp/testdb.ddl
-- Binding package automatically ...
-- Bind is successful
-- Binding package automatically ...
-- Bind is successful
[root@lin1 server_dec]#
5. DevOps Tasks
5.1 Updating Db2 to a new mod pack
IBM releases a new Db2 mod pack every few months. Instead of updating the installed copy in place (with installFixPack), I prefer an out-of-place update: the new version is installed into a separate directory while the instance keeps running, and only the switch of the instance needs a short downtime. The example uses the next mod pack 12.1.7 and a new directory /opt/ibm/db2/V12.1.7:
# run as root: install the new version next to the old one
gzip -cd /sw/db2/v12.1.7_linuxx64_server_dec.tar.gz|tar -xC /tmp
cd /tmp/server_dec
./db2_install -n -b /opt/ibm/db2/V12.1.7 -y -p SERVER
# take a backup before the update
su - db2inst1 -c "db2 backup db testdb online to /db2/backup compress include logs"
# stop the instance and switch it to the new Db2 copy
systemctl stop db2inst1
/opt/ibm/db2/V12.1.7/instance/db2iupdt db2inst1
systemctl start db2inst1
# check the version and update the system catalog of each database
su - db2inst1 -c "db2level"
su - db2inst1 -c "db2updv121 -d testdb"
Sample Output (click to expand):
# 12.1.7 is not available yet
The old Db2 copy is removed with db2_deinstall when the new version has been tested. Before falling back to the old copy, check the fallback restrictions of the mod pack in the IBM documentation.
5.2 Automating the installation
All steps of chapters 1 and 2 can be put into one script and run on each new VM, e.g. right after the unattended RHEL installation. A minimal version:
#!/bin/bash
# db2_setup.sh - install Db2 12.1.6 and create the instance db2inst1 (run as root)
set -e
DB2_IMAGE=/sw/db2/v12.1.6_linuxx64_server_dec.tar.gz
DB2_DIR=/opt/ibm/db2/V12.1
dnf -y install ksh libaio libxcrypt-compat numactl-libs python3-dnf-plugin-versionlock
gzip -cd $DB2_IMAGE|tar -xC /tmp
/tmp/server_dec/db2_install -n -b $DB2_DIR -y -p SERVER
groupadd db2iadm1; groupadd db2fsdm1; groupadd db2share
useradd -g db2iadm1 -G db2share -m db2inst1; useradd -g db2fsdm1 -G db2share -m db2fenc1
echo 'db2inst1:changeme'|chpasswd; echo 'db2fenc1:changeme'|chpasswd
mkdir -p /db2/data /db2/backup /db2/archlog
chown -R db2inst1:db2iadm1 /db2
$DB2_DIR/instance/db2icrt -a server -p 50000 -sharedgroup db2share -u db2fenc1 db2inst1
su - db2inst1 -c "db2set DB2COMM=TCPIP; db2 update dbm cfg using SVCENAME 50000"
# create the systemd unit from chapter 2.4 here
rm -rf /tmp/server_dec
For larger setups IBM supports response files: ./db2setup -r <file> installs Db2 and creates the instance in one step. A commented sample response file is part of the installation image (server_dec/db2/linuxamd64/samples/db2server.rsp). Both the script and the response file can easily be called from Ansible or another configuration management tool.
5.3 Db2 in a container
For CI/CD pipelines or short-lived test databases, IBM also offers Db2 Community Edition as a container image. On RHEL 10 it can be started with Podman:
# run as root
mkdir -p /db2/container
podman run -d --name db2 --privileged=true -p 50001:50000 -e LICENSE=accept -e DB2INSTANCE=db2inst1 -e DB2INST1_PASSWORD=changeme -e DBNAME=testdb -v /db2/container:/database icr.io/db2_community/db2
# follow the setup of the container
podman logs -f db2
Sample Output (click to expand):
[root@lin1 ~]# # run as root
mkdir -p /db2/container
podman run -d --name db2 --privileged=true -p 50001:50000 -e LICENSE=accept -e DB2INSTANCE=db2inst1 -e DB2INST1_PASSWORD=changeme -e DBNAME=testdb -v /db2/container:/database icr.io/db2_community/db2
# follow the setup of the container
podman logs -f db2
Trying to pull icr.io/db2_community/db2:latest...
Getting image source signatures
Copying blob 94075ad87f95 done |
Copying blob 55a9035ae06d done |
Copying blob db98f125c76d done |
Copying blob b2dade618c62 done |
Copying blob d32d94fecd97 done |
Copying blob 71dbe6aa13a2 done |
Copying blob e20d4f58dc5a done |
Copying blob 5906ebf8e10b done |
Copying blob 2082722a471b done |
Copying blob b67a7f57f555 done |
Copying blob b7c1ccd8f23f done |
Copying blob 6475e4a625ba done |
Copying blob 072cb4cce7d8 done |
Copying config e8bbf47baf done |
Writing manifest to image destination
9a1859f8c0f7455bb22e895ca4970aa92eeedab246ccd359fad7edb494a8533a
(*) Effective configuration:
(*) DB2INSTANCE=db2inst1
(*) DBNAME=testdb
(*) DBPORT=50000
(*) SAMPLEDB=false
(*) REPODB=false
(*) BLU=false
(*) ENABLE_ORACLE_COMPATIBILITY=false
(*) TEXT_SEARCH=false
(*) ARCHIVE_LOGS=true
(*) AUTOCONFIG=true
(*) AUTOCONFIG_MEM_PERCENT=80
(*) DB_CODESET=UTF-8
(*) DB_TERRITORY=US
(*) DB_COLLATE=IDENTITY
(*) DB_PAGESIZE=
(*) PERSISTENT_HOME=true
(*) HADR_ENABLED=false
(*) ETCD_ENDPOINT=
(*) ETCD_USERNAME=
(*) IS_KUBE=false
(*) IS_OSXFS=false
(*) DB2DEVCE=false
(*) UPDATEAVAIL=NO
(*) DATA_DIR=/database/data
(*) DBLOG_DIR=/database/logs
(*) CONFIG_DIR=/database/config
(*) BACKUP_DIR=/database/backup
(*) DB2INST1_PASSWORD=******** (env)
(*) Previous setup has not been detected. Creating the users...
(*) Creating users ...
(*) Copying the pre-built db2inst1 instance into /database ...
(*) Fixing /etc/services file for DB2 ...
(*) Fixing db2nodes file configuration ...
(*) Renaming the pre-built database to TESTDB ...
Files and control structures were changed successfully.
Database was catalogued successfully.
DBT1000I The tool completed successfully.
(*) Instance already exists. Preparing the environment for restart ...
(*) Fixing /etc/services file for DB2 ...
(*) Instance is already at the installed Db2 level. Skipping db2icrt ...
(*) Fixing /etc/services file for DB2 ...
(*) Cataloging existing databases
(*) Database TESTDB is already cataloged
(*) Applying Db2 license ...
LIC1402I License added successfully.
LIC1426I This product is now licensed for use as outlined in your License Agreement. USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V12.1/license/en_US.iso88591"
(*) Saving the checksum of the current nodelock file ...
(*) Updating DBM CFG parameters ...
(*) No container memory limit detected. Leaving INSTANCE_MEMORY unchanged
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
(*) Remounting /database with suid...
(*) Installed Db2 level is unchanged. Skipping the database update/upgrade check.
DB2 State : Operable
DB2 has not been started
Starting DB2...
11/29/2026 10:51:55 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
(*) Using the pre-built database as testdb ...
Database Connection Information
Database server = DB2/LINUXX8664 12.1.6.0
SQL authorization ID = DB2INST1
Local database alias = TESTDB
Current and Recommended Values for Database Manager Configuration
Description Parameter Current Value Recommended Value
---------------------------------------------------------------------------------------------------
Application support layer heap size (4KB) (ASLHEAPSZ) = 15
Number of FCM buffers (FCM_NUM_BUFFERS) = AUTOMATIC (4096)
Enable intra-partition parallelism (INTRA_PARALLEL) = NO
Maximum query degree of parallelism (MAX_QUERYDEGREE) = ANY
Agent pool size (NUM_POOLAGENTS) = AUTOMATIC (100)
Initial number of agents in pool (NUM_INITAGENTS) = 0
Max requester I/O block size (bytes) (RQRIOBLK) = 65535
Sort heap threshold (4KB) (SHEAPTHRES) = 0
Global instance memory (% or 4KB) (INSTANCE_MEMORY) = AUTOMATIC (1625734)
FCM buffer size (FCM_BUFFER_SIZE) = 32768
FCM parallelism (FCM_PARALLELISM) = AUTOMATIC (4)
Former and Applied Values for Optimizer Parameters
Description Parameter Former Value Applied Value
---------------------------------------------------------------------------------------------------
BUFFPAGE size to be used by optimizer (OPT_BUFFPAGE) = AUTOMATIC (0) AUTOMATIC (0)
LOCKLIST size to be used by optimizer (OPT_LOCKLIST) = AUTOMATIC (0) AUTOMATIC (0)
SORTHEAP size to be used by optimizer (OPT_SORTHEAP) = AUTOMATIC (0) AUTOMATIC (0)
MAXLOCKS size to be used by optimizer (OPT_MAXLOCKS) = AUTOMATIC (0) AUTOMATIC (0)
Detailed Report for Member 0
Former and Applied Values for Database Configuration
Description Parameter Former Value Applied Value
---------------------------------------------------------------------------------------------------
Catalog cache size (4KB) (CATALOGCACHE_SZ) = ((MAXAPPLS+25)*10) 750
Changed pages threshold (CHNGPGS_THRESH) = 60 80
Database heap (4KB) (DBHEAP) = AUTOMATIC (1200) AUTOMATIC (4729)
Degree of parallelism (DFT_DEGREE) = 1 1
Default tablespace extentsize (pages) (DFT_EXTENT_SZ) = 32 32
Default prefetch size (pages) (DFT_PREFETCH_SZ) = AUTOMATIC AUTOMATIC
Default query optimization class (DFT_QUERYOPT) = 5 5
Max storage for lock list (4KB) (LOCKLIST) = 4096 AUTOMATIC (6200)
Log file size (4KB) (LOGFILSIZ) = 1000 1024
Number of primary log files (LOGPRIMARY) = 3 8
Number of secondary log files (LOGSECOND) = 10 11
Max number of active applications (MAXAPPLS) = AUTOMATIC (40) AUTOMATIC (40)
Percent. of lock lists per application (MAXLOCKS) = 10 AUTOMATIC (60)
Number of asynchronous page cleaners (NUM_IOCLEANERS) = AUTOMATIC (4) AUTOMATIC (4)
Number of I/O servers (NUM_IOSERVERS) = AUTOMATIC (4) AUTOMATIC (4)
Package cache size (4KB) (PCKCACHESZ) = (MAXAPPLS*8) AUTOMATIC (1533)
Sort list heap (4KB) (SORTHEAP) = 256 AUTOMATIC (1741)
SQL statement heap (4KB) (STMTHEAP) = AUTOMATIC (8192) AUTOMATIC (8192)
Statistics heap size (4KB) (STAT_HEAP_SZ) = AUTOMATIC (4384) AUTOMATIC (4384)
Utilities heap size (4KB) (UTIL_HEAP_SZ) = AUTOMATIC (5000) AUTOMATIC (30109)
Self tuning memory (SELF_TUNING_MEM) = OFF ON
Automatic maintenance (AUTO_MAINT) = ON ON
Automatic table maintenance (AUTO_TBL_MAINT) = ON ON
Automatic runstats (AUTO_RUNSTATS) = ON ON
Real-time statistics (AUTO_STMT_STATS) = ON ON
Automatic reorganization (AUTO_REORG) = OFF OFF
Sort heap thres for shared sorts (4KB) (SHEAPTHRES_SHR) = 5000 AUTOMATIC (34824)
Log buffer size (4KB) (LOGBUFSZ) = 256 2150
Default table organization (DFT_TABLE_ORG) = ROW ROW
Database memory threshold (DB_MEM_THRESH) = 100 100
Default application heap (4KB) (APPLHEAPSZ) = AUTOMATIC (256) AUTOMATIC (256)
WLM admission control enabled (WLM_ADMISSION_CTRL) = NO NO
Former and Applied Values for Bufferpool(s)
Description Parameter Former Value Applied Value
---------------------------------------------------------------------------------------------------
IBMDEFAULTBP Bufferpool size = AUTOMATIC (1000) AUTOMATIC (298763)
Summary Report
--------------
Number of configuration groups: 1
Members in group 1:
0
DB210203I AUTOCONFIGURE completed successfully. Database manager or database
configuration values may have been changed if you chose to apply changes. The
instance must be restarted before any such applied changes come into effect.
You may also want to rebind your packages after the new configuration
parameters take effect so that the new values will be used.
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.
DB20000I The SQL command completed successfully.
DB20000I The DEACTIVATE DATABASE command completed successfully.
(*) Applying configuration to testdb ...
(*) DB CFG LOGARCHMETH1: applied
(*) DB CFG LOGPRIMARY: applied
(*) DB CFG LOGSECOND: applied
### Making backup directory and performing backup
Backup successful. The timestamp for this backup image is : 20261129105206
(*) Skipping TEXT_SEARCH setup for database testdb because TEXT_SEARCH is not configured for the instance ...
ssh-keygen: generating new host keys: RSA ECDSA ED25519
(*) All databases are now active.
(*) Setup has completed.
Log Manager has been requested by database shutdown to stop for log stream 0.
2026-11-29-10.52.07.446171+000 E129426E525 LEVEL: Event
PID : 980 TID : 140041590400576 PROC : db2sysc 0
INSTANCE: db2inst1 NODE : 000 DB : TESTDB
APPHDL : 0-47 APPID: *LOCAL.db2inst1.261129105236
AUTHID : DB2INST1 HOSTNAME: 9a1859f8c0f7
EDUID : 89 EDUNAME: db2agent (idle) 0
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::FreeResourcesOnDBShutdown, probe:18035
STOP : DATABASE: TESTDB : DEACTIVATED: NO
^C[root@lin1 ~]#
We use port 50001 on the host, because port 50000 is already used by our instance. The first start takes a few minutes until the instance and the database are created.
Troubleshooting Common Issues
| Issue | Solution |
|---|---|
db2prereqcheck reports DBT3514W for libpam.so and libstdc++.so.6 | Only needed for 32-bit non-SQL routines. Ignore the warning or install pam.i686 and libstdc++.i686. |
db2icrt fails with DBI20196E (either -sharedgroup or -nosharedgroup parameter must be specified) | Since Db2 12.1.6 one of the two options is required. Create the group db2share and use -sharedgroup db2share (chapter 2.2). |
Unit db2fmcd.service could not be found. during the installation | The installation still completes. Use the systemd unit from chapter 2.4 to start the instance. |
systemctl start db2inst1 fails with SQL1026N | The instance is already running. Stop it with db2stop and start the unit again. |
| Remote client gets SQL30081N (communication error) | Check db2set -all (DB2COMM=TCPIP), db2 get dbm cfg | grep SVCENAME, ss -tlnp | grep 50000 and the firewall. |
| SQL1116N (BACKUP PENDING) after changing LOGARCHMETH1 | Take a full offline backup (chapter 4.2). |
| Instance or database does not start | Check db2diag -level Error,Severe -H 1d and the license limits with db2licm -l. |
Resources
- Download Db2 fix packs by version
- IBM Db2 12.1.4 announcement (RHEL 10 support)
- System requirements for IBM Db2 for Linux, UNIX, and Windows
- System requirements update for IBM Db2 12.1 releases
- Db2 12.1 product documentation
- Applying Db2 licenses
- Db2 Community Edition (get started)
Deinstallation
The instance, the Db2 software and the test data can be removed with these commands:
# run as root
systemctl disable --now db2inst1
rm -f /etc/systemd/system/db2inst1.service
systemctl daemon-reload
/opt/ibm/db2/V12.1/instance/db2idrop db2inst1
/opt/ibm/db2/V12.1/install/db2_deinstall -a
rm -rf /opt/ibm /db2 ~/server_dec
userdel -r db2inst1; userdel -r db2fenc1; userdel -r app1
groupdel db2iadm1; groupdel db2fsdm1; groupdel db2share
Conclusion
You have now installed IBM Db2 12.1.6 Community Edition on RHEL 10.1 and set up a test server with an instance, a database and an application user. Here is a quick recap:
- The Server Fix Pack image from Fix Central installs a complete Db2 server with the permanent Community Edition license.
- The instance runs as a systemd service and accepts remote connections on port 50000.
- With archive logging, online backups and point-in-time recovery are possible.
db2pd, theMON_GETfunctions anddb2diagare the main tools for monitoring and troubleshooting.- Out-of-place updates with
db2iupdtkeep the downtime for new mod packs short.
Next Steps:
- Set up high availability with Db2 HADR and the integrated Pacemaker cluster manager.
- Try the AI features introduced with Db2 12.1.5, e.g. vector indexes and the SQL functions for LLM integration.
- Monitor the instance with Db2 Genius Hub, the successor of the Db2 Data Management Console.
- Enable Db2 native encryption for the test database.

Leave a Reply