IBM DB2 Express-C 10.5 is a lightweight, no-cost DB2 edition commonly found in legacy enterprise systems. While EOL, it’s still required for:
1.1 OS Compatibility
- Supporting older applications
- Migration source databases
- Lab and proof-of-concept systems
1.1 OS Compatibility
| Requirement | Minimum |
|---|---|
| Architecture | x86_64 |
| Kernel | 2.6.32+ |
| glibc | 2.12+ |
| RAM | 2 GB (4 GB recommended) |
| Disk | 4 GB minimum |
Verify:
uname -m
uname -r
ldd --version
free -m
df -h
uname -m
uname -r
ldd --version
free -m
df -h
1.2 Disable SELinux (Legacy Requirement)
DB2 10.5 is not SELinux-aware
setenforce 0
vi /etc/selinux/config
SELINUX=permissive
Verify:
getenforce
DB2 10.5 is not SELinux-aware
setenforce 0
vi /etc/selinux/config
SELINUX=permissive
Verify:
getenforce
2. OS User & Group Preparation
2.1 Create Installation & Instance User
sudo useradd -m -G wheel,bin build
sudo passwd build
This user will:
Own the DB2 instance
Run DB2 processes
Manage databases
Verify:
id build
2.1 Create Installation & Instance User
sudo useradd -m -G wheel,bin build
sudo passwd build
This user will:
Own the DB2 instance
Run DB2 processes
Manage databases
Verify:
id build
3.2 Required OS Packages
sudo yum install -y \
compat-libstdc++-33 \
compat-libstdc++-296 \
gcc gcc-c++ \
ksh libaio compat-db
Verify:
rpm -qa | grep compat
sudo yum install -y \
compat-libstdc++-33 \
compat-libstdc++-296 \
gcc gcc-c++ \
ksh libaio compat-db
Verify:
rpm -qa | grep compat
3. Kernel & Resource Tuning
3.1 Shared Memory & File Limits
Edit:
sudo vi /etc/sysctl.conf
Add:
kernel.shmmax = 1073741824
kernel.shmmin = 1
kernel.shmmni = 4096
kernel.shmseg = 32
kernel.shmall = 1179648
fs.file-max = 65536
Apply:
sudo sysctl -p
Optional but recommended:
sudo reboot
3.1 Shared Memory & File Limits
Edit:
sudo vi /etc/sysctl.conf
Add:
kernel.shmmax = 1073741824
kernel.shmmin = 1
kernel.shmmni = 4096
kernel.shmseg = 32
kernel.shmall = 1179648
fs.file-max = 65536
Apply:
sudo sysctl -p
Optional but recommended:
sudo reboot
3.2 User Limits
Edit:
sudo vi /etc/security/limits.conf
Add:
build soft nofile 65536
build hard nofile 65536
build soft nproc 2048
build hard nproc 4096
Verify:
su - build
ulimit -a
Edit:
sudo vi /etc/security/limits.conf
Add:
build soft nofile 65536
build hard nofile 65536
build soft nproc 2048
build hard nproc 4096
Verify:
su - build
ulimit -a
4. Download & Extract DB2 Express-C
4.1 Download
ssh build@p62
wget https://www6.software.ibm.com/sdfdl/v2/regs2/db2pmopn/db2_v105/expc/v10.5fp1_linuxx64_expc.tar.gz
Verify:
ls -lh v10.5fp1_linuxx64_expc.tar.gz
4.1 Download
ssh build@p62
wget https://www6.software.ibm.com/sdfdl/v2/regs2/db2pmopn/db2_v105/expc/v10.5fp1_linuxx64_expc.tar.gz
Verify:
ls -lh v10.5fp1_linuxx64_expc.tar.gz
4.2 Extract
tar -xvzf v10.5fp1_linuxx64_expc.tar.gz
This creates:
server_expc/
├── db2_install
└── response/
tar -xvzf v10.5fp1_linuxx64_expc.tar.gz
This creates:
server_expc/
├── db2_install
└── response/
5. Install DB2 Software silent Installation
cd expc
sudo ./db2_install \
-b /opt/ibm/db2/V10.5 \
-p server \
-l /tmp/db2_install.log
Options explained:
-b → Base installation directory
-p server → DB2 server components only
-l → Installation log file
Verify:
grep -i error /tmp/db2_install.log
Cleanup:
cd ..
rm -rf expc
cd expc
sudo ./db2_install \
-b /opt/ibm/db2/V10.5 \
-p server \
-l /tmp/db2_install.log
Options explained:
-b → Base installation directory
-p server → DB2 server components only
-l → Installation log file
Verify:
grep -i error /tmp/db2_install.log
Cleanup:
cd ..
rm -rf expc
6. Create DB2 Instance instance Creation
cd /opt/ibm/db2/V10.5/instance/
sudo ./db2icrt -u build:fenced build -k 50000
What this does:
Creates instance build
Uses fenced user build
Assigns port 50000
Creates /home/build/sqllib
Verify:
ls /home/build/sqllib
cd /opt/ibm/db2/V10.5/instance/
sudo ./db2icrt -u build:fenced build -k 50000
What this does:
Creates instance build
Uses fenced user build
Assigns port 50000
Creates /home/build/sqllib
Verify:
ls /home/build/sqllib
7. Configure TCP/IP & Services Set Environment
su - build
cd ~/sqllib
./adm/db2set DB2COMM=TCPIP
Verify:
bin/db2 get dbm cfg | grep TCPIP
8.2 Set Service Port
bin/db2 update dbm cfg using SVCENAME 50000
Restart DB2:
bin/db2stop
./adm/db2start
Verify listener:
netstat -tlnp | grep 50000
su - build
cd ~/sqllib
./adm/db2set DB2COMM=TCPIP
Verify:
bin/db2 get dbm cfg | grep TCPIP
8.2 Set Service Port
bin/db2 update dbm cfg using SVCENAME 50000
Restart DB2:
bin/db2stop
./adm/db2start
Verify listener:
netstat -tlnp | grep 50000
8. Create Sample Database
bin/db2sampl
This creates:
Database: SAMPLE
Tables, views, indexes
Test data
Verify:
bin/db2 connect to SAMPLE
bin/db2 "select count(*) from sysibm.sysdummy1"
bin/db2sampl
This creates:
Database: SAMPLE
Tables, views, indexes
Test data
Verify:
bin/db2 connect to SAMPLE
bin/db2 "select count(*) from sysibm.sysdummy1"
9. Firewall & Security Hardening
9.1 Open DB2 Port
sudo firewall-cmd --permanent --add-port=50000/tcp
sudo firewall-cmd --reload
Verify:
firewall-cmd --list-ports
9.1 Open DB2 Port
sudo firewall-cmd --permanent --add-port=50000/tcp
sudo firewall-cmd --reload
Verify:
firewall-cmd --list-ports
9.2 Authentication Configuration
bin/db2 update dbm cfg using AUTHENTICATION SERVER
bin/db2set DB2AUTH=LOCAL
Restart:
bin/db2stop
./adm/db2start
10. JDBC Driver Configuration
JDBC drivers are located at:
/home/build/sqllib/java/db2jcc.jar
/home/build/sqllib/java/db2jcc_license_cu.jar
Add both to application classpath:
export CLASSPATH=$CLASSPATH:/home/build/sqllib/java/*
11. Performance Tuning
11.1 Database Manager Tuning
bin/db2 update dbm cfg using DFT_DEGREE 8
bin/db2 update dbm cfg using SHEAPTHRES 16384
11.2 Instance Parameters
bin/db2 update instance cfg using NUM_INITAGENTS 5
Restart:
bin/db2stop
./adm/db2start
Monitor:
db2pd -db SAMPLE -applications
11.1 Database Manager Tuning
bin/db2 update dbm cfg using DFT_DEGREE 8
bin/db2 update dbm cfg using SHEAPTHRES 16384
11.2 Instance Parameters
bin/db2 update instance cfg using NUM_INITAGENTS 5
Restart:
bin/db2stop
./adm/db2start
Monitor:
db2pd -db SAMPLE -applications
12. Backup & Recovery Basics offline Backup
mkdir ~/db2backup
bin/db2 backup db SAMPLE to ~/db2backup
Verify:
ls ~/db2backup
mkdir ~/db2backup
bin/db2 backup db SAMPLE to ~/db2backup
Verify:
ls ~/db2backup
13. Verification Checklist
bin/db2level
bin/db2 connect to SAMPLE
bin/db2 "select current timestamp from sysibm.sysdummy1"
db2stop
./adm/db2start
Expected:
DB2 10.5 FP1 displayed
Successful connection
Clean restart
14. Migration & Upgrade Note
DB2 10.5 is End of Life
Recommended target:
IBM Db2 11.5 LTS
Migration tools:
db2move
db2look
IBM Data Server Migration Toolkit
NuoDB / Oracle / PostgreSQL migration utilities
Recommended target:
IBM Db2 11.5 LTS
Migration tools:
db2move
db2look
IBM Data Server Migration Toolkit
NuoDB / Oracle / PostgreSQL migration utilities
15. Final Thoughts
This installation is best suited for:
This installation is best suited for:
- Legacy app support
- Data migration staging
- Test & lab environments
No comments:
Post a Comment