Create SAMPLE database in DB2

In this blog we will go though steps to create sample database. You might need SAMPLE database with tables, views, index, function, procedure and dummy data to conduct POC or for testing, learning purpose. You will need a DB2 instance to create SAMPLE database. Check blog How to create DB2 Instance on Linux for instructions to create DB2 instance and start it.

Prerequisite :

To create SAMPLE database you need a DB2 instance, also you should have SYSADM or SYSCTRL authorities for that instance.

db2_deinstall error : DBI20081E The installer detected that there is not enough free disk space

During DB2 client uninstall you can encounter error DBI20081E  The installer detected that there is not enough free disk space in "/tmp". Free space detected in "/tmp" is: "1811268" (measured in kilobytes). Space needed is: "2000000" (measured in kilobytes).  If free size in /tmp is less than 2000000 KB you will hit this error even though /tmp space requirement is only 512 MB for non pureScale environment as per IBM Knowledge Center. I successfully reproduced this issue with DB2 11.1 FP 2b and 11.5.4 client.

DB2 installation issue : The hostname is invalid

During DB2 installation you might get error The hostname is invalid. We get this error if your hostname is not properly configured and mapped to an IP Address which is reachable.

While performing DB2 installation using db2setup command you might get below error screen.

Same solution is valid for error during installation with db2_install command.

DB2 11.1 GUI Installation on Linux

DB2 11.1 can be install using GUI on Linux server. In this blog we will see how to install DB2 11.1 using GUI on linux server. For DB2 system requirement, prerequisite and pre-installation steps check blog DB2 11.1 Installation on Linux

Check blog Setup X11 Forwarding to access GUI in Linux to configure X11 forwarding to access GUI.

Once you have configured X11 forwarding and pre-installation steps completed for DB2 installation then change your working directory to directory where you have extracted DB2 product.

Uninstall DB2 on Linux

 As part of server decommissioning, cleanup of old DB2 product,  you might need to uninstall DB2. In this blog we will go through steps to uninstall DB2 on Linux.

Step 1: Verify DB2 instance association with DB2 product

You can use db2ilist command and execute it from <DB2 Installation Path>/instance with root privilege to get DB2 instance associated with that DB2 installation

./db2ilist 

db2ilist

If there is no DB2 instance associated with it then skip next step

db2idrop issue : The specified instance does not exist

You might come across scenario where db2ilist return DB2 instance name but that instance does not exist. Such situation might arise due to failed db2idrop, sqllib directory missing in DB2 instance user home directory or someone messed up with your instance home directory.

db2ilist

How to create DB2 Instance on Linux

DB2 Instance:

DB2 Instance is a run time environment under which database runs. Instance is used to configure run time environment using Database Manager Configuration (DBM) parameters and registry variables. You can have multiple instance on same server depending upon your server resource configuration. Databases are unique within the instance. You cannot have 2 database with same name in one instance but you can have 2 database with same name in different instance on same server. E.g. You cannot have 2 database with same name i.e. TESTDB in one instance i.e. db2i1 but you can have 2 database with same name i.e. TESTDB in two instance on server i.e. db2i1 and db2i2. In this blog we will see step by step procedure to create DB2 Instance on Linux server. This same steps can be followed for not only Linux environment but it is applicable for any unix environment which is supported by DB2.

DB2 11.1 Installation on Linux

In this post we will go through steps of DB2 11.1 installation on Linux. Before installing any DB2 LUW product, you should ensure your system meets operating system, hardware, software, storage and memory requirement.

Update: Below steps are valid for DB2 11.5 installation on Linux as well.

Step 1: Check below link for most up to date installation requirement



Step 2: Download DB2 LUW product image from below link