DB2 Database installation on Linux


In this blog I am going to install DB2 V7 and Web sphere application server 4+.  On windows platform obviously it is very easy to install because we get the wizards for the same and it automatically creates the instances. But on linux it is bit tricky specially taking care when we create the instances.

DB2 Database:

We will install the below component on Linux environment.

  • DB2 Database Admin Client
  • UDB (Universal DataBase) Enterprise Edition
  • Application Development Client (for writing your own applications)

In addition to the above we will install the sample database.


  1. Check configuration using commands:
    • Default language: echo $LANG
      On my machine it is en_US
    • Check if reguired packages are installed: rpm -e pdksh compat-libs ncurses4
      • The package pdksh ensures shell compatability with commercial ATT based Unix sytems.
      • The package compat-libs is for Red Hat 7.x+ systems to have Red Hat 6.x compatability.
      • Package ncurses4 provides terminal drivers and cursor control mechanism.
  2. Mount the CD (Disk 1 of 2): mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom

  3. Install DB2: (as root)
    • cd /mnt/cdrom/db72pf5u/
    • ./db2setup
+—————————– DB2 Setup Utility ——————————+|   Select Install to select products and their components to install, or

|   select Create to create the DB2 services.

|   To select products and their components, select           [ Install… ]

|   Install.

|   To create a DB2 Instance, an Administration Server,        [ Create… ]

|   or a Data Links Manager Administrator select Create.

|   [  Close  ]                                                   [  Help  ]


  • First select the “Install…” option to select the products to install. Next select the ”  Create…” option to create a DB2 Instance.
  • After selecting the “Install…” option you will get the following screen:
 +——————————- Install DB2 V7 ——————————-+Select the products you are licensed to install.  Your Proof of

|   Entitlement and License Information booklet identify the products for

|   which you are licensed.

|   To see the preselected components or customize the selection, select

|   Customize for the product.

|   :*: DB2 Administration Client                           [ Customize… ]

|   :*: DB2 UDB Enterprise Edition                          [ Customize… ]

|   [ ] DB2 Connect Enterprise Edition                      : Customize… :

|   :*: DB2 Application Development Client                  [ Customize… ]

|   To choose a language for the following components, select Customize for

|   the product.

|       DB2 Product Messages                                [ Customize… ]

|       DB2 Product Library                                 [ Customize… ]

|   [   OK   ]                     [ Cancel ]                     [  Help  ]



Use the space bar to toggle selection between [ ] and add features.

    • DB2 Administration Client
      • :*: Java Support
      • :*: Control Center
    • DB2 UDB Enterprise Edition
      • :*: Java Support
      • :*: Replication
      • :*: Local Warehouse Control Database
      • :*: Distributed Join for DB2 Data Sources
      • :*: Getting Started
    • DB2 Application Development Client
      • :*: Java Support
      • :*: Control Center
      • :*: DB2 Sample Applications
      • :*: Create Links for DB2 Libraries
    • DB2 Product Library (by default no language is selected. Select one!)
      • Optional: DB2 Product Library (HTML):
        :*: en_US [ ] fr_FR [ ] de_DE

Approve it by selecting OK.

Next create a DB2 instance. The default will be db2inst1. A Linux user and home directory of the same name will be generated. You will be prompted for a password. I would suggest select “[Properties…]” to “Create a sample Database for the DB2 Instance”.

 +—————————– DB2 Setup Utility ——————————++– Status Report —————————————————–+

|   |  The log file can be found in /tmp/db2setup.log.

|   |  Installation

|   |  DB2 Client                                                 SUCCESS


The DB2 installation is complete.

The installation created and started IBM DB2 database. The process will be running at this point. The following changes are made:

  • Three users (and home directories) are created:
    • db2as
    • db2fenc1
    • db2inst1
  • Additions to the file: /etc/services

db2cdb2inst1    50000/tcp   # Connection port for DB2 instance db2inst1
db2idb2inst1    50001/tcp   # Interrupt  port for DB2 instance db2inst1

Test the database:

  • Log in as user db2inst1
    su – db2inst1)
  • Issue the command: db2
  • This will put you into the db2 environment and at the db2 command prompt.

db2 => connect to sample
db2 => select * from employee
db2 => quit

Manage the database:

Commands used to manage the database: (login as user db2as)

  • Start DB2: db2start
    By default the installation will start the database and configure the system to start DB2 each time the system boots.
  • List database instances: db2ilist
  • List database release levels: db2level
  • Stop DB2: db2stop

As user db2inst1:

  • List Database Manager Configuration: db2 get dbm cfg
  • List System Database Directory: db2 list db directory
  • Generate sample database: db2sampl


  • The DB2 database will use TCP port 523.
  • DB2 License manager (execute as root): /usr/IBMdb2/V7.1/adm/db2licm
    Functionality available in Control Center (

Happy Coding……

Total Page Visits: 3535 - Today Page Visits: 1

One Response to “DB2 Database installation on Linux

Leave a Reply

Your email address will not be published. Required fields are marked *