How to install IBM DB2 on Red Hat 6 Linux
I have never had direct contact with DB2 database or I know something more about it. I got the task to install this DB for some testing – which I did. I do a Google search how to install, of course – I looked at the official instruction in which I usually almost always missed something and installed it as I guess it’s appropriate, and I put this manual here if someone needs it.
You can download the trial version from this link. Installation is done on Red Hat 6 Minimal Install. I tried installation on CentOS 6 – but without success – some kernel-sources stuff missing.
# Update everything. If kernel is updated - do a restart yum update -y cd /home # Copy here downloaded installation archive (v11.1_linuxx64_server_t.tar.gz) # Extract tar zxvf v11.1_linuxx64_server_t.tar.gz rm -f v11.1_linuxx64_server_t.tar.gz # Needed packages yum install gcc gcc-c++ libstdc++*.i686 numactl sg3_utils kernel-devel compat-libstdc++-33.i686 compat-libstdc++-33.x86_64 pam-devel.i686 pam-devel.x86_64 # Add IP and hostname in hosts file echo "`ip addr | grep 'state UP' -A2 | grep 'inet ' | tail -n1 | awk '{print $2}' | cut -f1 -d'/'` `hostname`" >> /etc/hosts cat /etc/hosts # Provera # GUI installation yum groupinstall "Desktop" "X Window System" "Fonts" # Disable firstboot chkconfig firstboot off # Disable selinux sed -i s/"SELINUX=enforcing"/"SELINUX=disabled"/g /etc/selinux/config reboot # Chech everything about DB2 needs with bellow command # DBT3533I The db2prereqcheck utility has confirmed that all installation prerequisites were met. /home/server_t/db2prereqcheck
# Install VNC and run installation with db2setup yum install tigervnc-server vncserver # Put a VNC password /home/server_t/db2setup
It remains to complete the installation through the GUI and through the VNC or direct access to the machine. Steps attached.
After the installation, it remains to install the database – which in this case will be boosted with the BLU Accelerator that is supposedly revolutionary when it comes to performance – and to place such a base rising automatically with the system
# Create database su - db2inst1 db2set DB2_WORKLOAD=ANALYTICS # BLU db2set db2 create database KOMP_DB2 db2 activate db KOMP_DB2 db2 connect to KOMP_DB2 # Add to crontab with next script echo \ '#!/bin/sh source /home/db2inst1/.bashrc sleep 5 db2set DB2_WORKLOAD=ANALYTICS db2set db2start db2 connect to KOMP_DB2' > /home/db2inst1/.start_db.sh chmod +x /home/db2inst1/.start_db.sh (crontab -l 2>/dev/null; echo "@reboot /home/db2inst1/.start_db.sh > /tmp/DB2start.log 2>&1") | crontab -
It’s still up to you to try logging in to the database and seeing ‘does it work’. I used the Oracle SQL Developer for testing (I was also surprised) but I added db2jcc.jar through tools > preferences > database > third party JDBC drivers
If everything is OK with the concession, the installation is completed and you can start working for the next 90 days during the trial period.