Install and configure DB2 on UNIX to support change and configuration management

Enhanced database support for IBM Rational ClearQuest

You can use several relational database management system (RDBMS) with IBM® Rational® ClearQuest® versions 7.1.2 and higher, including Oracle, Microsoft SQL Server, Microsoft Access, and IBM® DB2®. Unlike the other systems, DB2 is bundled with Rational ClearQuest. The benefit to using DB2 as a backend database can be realized in the costs you save, but installing and configuring it can be challenging especially if you are not familiar with DB2. In this article, we provide instructions to help you install and configure DB2 on UNIX operating systems to use as a backend database with Rational ClearQuest.


Vivek K Pandey (, IT Specialist – Rational change and configuration management, IBM

author photoVivek Pandey is a certified Rational Software specialist who works at IBM Rational Lab services in India. He has over 7 years of experience in software configuration management; standards and procedures development; software builds and release management; and training and implementation for large projects in banking, financial, and telecommunications industries.

15 November 2011

Also available in Vietnamese Spanish

By following these procedures, you will have the information you need to get started with IBM® Rational® ClearQuest®. The information does not cover technicalities and nuances of using IBM® DB2® as a database management system other than to tell you how to install and configure it with two empty databases.

If you have experience installing DB2 on Microsoft® Windows® based servers, you might find that installing and configuring it on UNIX® operating systems is somewhat challenging. After you use these steps to install DB2 on UNIX, you might also use what you learn in this scenario as a supplement for installing other tools for the first time on UNIX operating systems.

Prepare the operating system for installation

In Rational ClearQuest versions 7.1.2 and higher, DB2 (Restricted Enterprise Edition) is included, which means if you want to use DB2 as the backend database for your change and configuration environment, you do not have to purchase separate licenses. For more information about support and prerequisites for both tools, see the resources section of this article.

To install DB2, you need three unique user IDs and corresponding groups to administer the DB2 instance and set up the application. Create these IDs on the operating system of the machine that is your database server. To choose ID names, consider the following example: Use "db2inst" for the instance owner ID, "db2fenc" for the fenced user ID, "dasusr" for the DB2 Administration Server (DAS) user ID.

You must also create 3 different groups to correspond to each ID. To create the groups, log in as root and run the following commands. Note that the IDs and groups in these commands are examples. You can use naming conventions that appropriate for your project or organization.

> groupadd -g 500 db2grp
> groupadd -g 501 db2fgrp
> groupadd -g 502 dasadm
> useradd -u 100 -g db2grp -d /home/db2inst1 -s /bin/sh -p db2inst db2inst

> useradd -u 101 -g db2fgrp -d /home/db2fenc1 -s /bin/sh -p db2fenc db2fenc
> useradd -u 102 -g dasadm -d /home/dasusr1 -s /bin/sh -p dasusr dasus

After you create the user IDs and groups, you must set the passwords for each ID and create their respective home directories. You might need help from your system administration team to make these changes.

To reset the passwords, you must run the "passwd" command. To change the password for the db2inst ID:

  1. Log on as the root user.
  2. Enter the following command:
    passwd db2inst
  3. Repeat these steps to set up the passwords for the remaining two user accounts, "db2fenc" and "dasusr".

To create home directories:

  1. Log on as the root user.
  2. Enter the following commands:
    • > mkdir –p /home/db2inst
    • > chmod 755 /home/db2inst
    • chown db2inst:db2grp /home/db2inst
  3. Repeat these steps to create directories for the "db2fenc" and "dasusr" IDs.

Since the default installation location for DB2 is the /opt directory, make sure you have enough space to install DB2. Start by allocating 5 GB of space for the /opt directory on your database server.

Install and configure DB2

To install DB2 on UNIX operating systems, you must be logged in as the root user. Copy the DB2 installer to the machine that is your database server.

Run the db2_install script to start the DB2 installation. The utility are available in the /root/desktop/mnt directory. This directory might be different according to your environment.

Figure 1. Start the DB2 installation
Start DB2 installation by running the db2_install utility

The script pauses for you to enter the installation location. If you want to use the default installation location, /opt/ibm/db2/V9.5, you can choose "no" as shown in the following figure.

Figure 2. Enter the installation location for DB2
Choose the DB2 product you want to install

In figure 2, we chose WSE as the installation type since those are the files that we used for installation. If you use the Enterprise Installation CD to install DB2, ESE will be available as one of the options.

After you complete the installation successfully, the following output is displayed:

Figure 3. Completed DB2 installation
Summary of tasks performed during the DB2 installation

Now you must create the DB2 instance and set some necessary parameters.

Because it is a relational database management system, you must set certain kernel parameters to work with the operating system. To see the kernel parameters requirements run the db2osconf command as the root user to show the current value of required kernel parameters and their expected value.

The output is similar to what you see in figure 4.

Figure 4. Output from the db2osconf command
kernel parameters requirements as shown by db2osconf utility

Create the DB2 instance

After you install DB2 successfully and set the kernel parameters, you must create the DB2 instance for the databases in your change and configuration management tool. Use the utility db2icrt to create the instance. Log on with the instance user ID that you previously created.

The db2icrt utility is available in the installation directory. If you used the default installation directory, then the path is /opt/ibm/db2/V9.5/instance

Figure 5. Creating the DB2 instance
Run the db2icrt utility to create db2 instance

After you create the instance, log in as the owner (For example "db2inst"), and then perform following tasks:

  • Set the "SVCENAME" parameter, which determines the port used for the DB2 database manager service.

In figure 6, we used port 40000 for the database manager service which is the default port. If you want to use another port, change it here.

Figure 6. Updating the port information
running db2 update to enter the port number used for service
  • Set the default communication to TCP/IP.
Figure 7. Setting up the DB2 communication protocol
Setting up TCP/IP as communication protocol for DB2
  • Restart the database manager.

NOTE: The database manager must be restarted while being logged on as the instance owner. If you are logged on as the root user, you will not be able to restart the database manager instance.

Figure 8. Restarting DB2
Restarting DB2 database manager service

Create empty databases

In the change and configuration management tool, you must create two repositories, a schema repository and a user database; therefore, you must create two empty databases in your DB2 instance.

Figure 9. Creating an empty database in DB2
Creating empty database in DB2 for use with Rational ClearQuest

Log on as the instance owner to the database server where DB2 is installed, and run the following commands:

  1. Connect to the database by running the connect command.
    Figure 10. Connecting to the databases
    Connecting to empty databases
  2. Create the buffer pool and tablespace for the database.
    Figure 11. Creating the buffer pool
    Creating bufferpool in the empty DB2 database created above
    Figure 12. Creating the tablespace
    Creating tablespace in the empty DB2 database created above

Repeat these steps to create a second empty database.

When you have your two empty databases in DB2, you can then create the schema repository and user databases in Rational ClearQuest.

Test the connection between the database and the client

Before you create the schema repository, validate the connection to the database instance by using the pdsql utility available in Rational ClearQuest.

> pdsql -v db2 –s <database server ip / hostname> -db <database-name> -u db2inst –p db2inst

If this command runs successfully, it means the database is accessible from the change and configuration management client where you are creating the schema repository.

When you create the schema repository, choose "DB2" as the database vendor and "db2inst" as the instance owner. For information about how to create the schema repository and user database, see the resources section of this article.


In this article, you learned how to install DB2 through the command line. You also learned how to create a DB2 instance with empty databases and configure them to use with Rational ClearQuest. Finally, you learned how to test the connection between the database and the client machine by using the pdsql utility.



Get products and technologies

  • Download a free trial version of Rational software.
  • Evaluate other IBM software in the way that suits you best: Download it for a trial, try it online, use it in a cloud environment, or spend a few hours in the SOA Sandbox learning how to implement service-oriented architecture efficiently.



developerWorks: Sign in

Required fields are indicated with an asterisk (*).

Need an IBM ID?
Forgot your IBM ID?

Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.


All information submitted is secure.

Dig deeper into Rational software on developerWorks

Zone=Rational, Information Management
ArticleTitle=Install and configure DB2 on UNIX to support change and configuration management