Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum Rss Feed

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Rss Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles


Posted Jun 29, 2004

The DB2 Configuration Files Revealed

By Marin Komadina

IBM has provided us with an automated installation process. As a result, many DBAs do not have any overview of where DB2 has stored important configuration information. The DB2 configuration files contain security setting parameters, system resource allocation, backup environment variables and DB2 instance configuration settings. In the event of even a small problem with configuration data, a full database recovery procedure is needed. For huge databases, this could be a time costly procedure and in some cases not acceptable. Just the ability to recognize a problem with a specific configuration file and the opportunity to rebuild a damaged file manually, in certain situations might save valuable time. This article will uncover important DB2 database configuration files and related SUN Solaris system files, walking through the directory hierarchy.

This article covers:

  • The Structure Tree
  • Sun Solaris Configuration Files
  • The DB2 Instance Configuration Files
  • Conclusion

The Structure Tree

The settings in the operating system configuration files and DB2 database instance (database manager) configuration files are prerequisites for proper DB2 instance functionality. An instance and the database information is stored in a directory structure. The hierarchical directory structure is created by the installation procedure at a customized location. A hard coded database instance directory-structure is created according following schema:


My demo DB2 database instance, used in this article, was running on the SUN Solaris operating system, under instance owner db2inst1, hosting only one DB2 database "ARTIST" and consisting of the three database partitions. The instance was created at the /db2/db2inst1/NODE0000/SQL00001 installation path, symbolically describing instance db2inst1, partition NODE0000 and the fist database directory SQL00001.

SUN Solaris Configuration Files

The most important operating system configuration files related to the DB2 installation and configuration are displayed in Picture 1.

Certain files need modification while others are automatically adjusted by the DB2 installation procedure.

passwd - user configuration file (UNIX)

File Name

Default Location



The UNIX administrator maintains the user configuration file "passwd". Before DB2 software installation, two new entries were entered identifying the instance owner (db2inst1) and the fenced user (db2fenc1).

$ ls -lrt /etc/passwd
-r--r--r--   1 root     sys         1095 Sep 12  2003 /etc/passwd

$ cat  /etc/passwd

lp:x:71:8:Line Printer Admin:/usr/spool/lp:
smtp:x:0:0:Mail Daemon User:/:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
Listing 1: passwd configuration file

Performing the installation with a GUI, using the appropriate root administrative right on the machine, automatically causes changes in the passwd file .

group - group configuration file (UNIX)

File Name

Default Location



Every system user belongs to a specific UNIX group. Similar to the passswd file, group file may be managed manually or automatically. The DB2 groups hold only DB2 accounts and they are placed at the end of the group configuration file.

$ ls -lrt /etc/group
-rw-r--r--   1 root     sys          399 Sep 12  2003 /etc/group

$ cat /etc/group

Listing 2: group UNIX configuration file

services - port reservation file (UNIX)

File Name

Default Location



Communication between an application process (remote client) and database coordinator agent are carried over the listener process (db2tcpcm). The TCP/IP, as the communication protocol, uses predefined ports reserved in the services configuration file. DB2 ESE installation, configured with several database partitions, requires additional port reservation, used by the fast communication manager (FCM). FCM is responsible for handling data transport between the database partitions.

$ ls -lrt /etc/services
lrwxrwxrwx   1 root     root          15 Feb 28  2002 /etc/services -> ./inet/services

$ cat /etc/services | grep db2
db2cdb2inst1    50000/tcp   # Connection port for DB2 instance db2inst1
db2idb2inst1    50001/tcp   # Interrupt  port for DB2 instance db2inst1
DB2_db2inst1    60000/tcp   # db2 fast communication manager start 
DB2_db2inst1_END  60004/tcp # db2 fast communication manager end 
Listing 3: services - UNIX port reservation file

.profile - user profile configuration file (UNIX)

File Name

Default Location



The instance owner, (db2inst1), has a specific configuration file (.profile) in the user home directory associated with it by default. That user profile executes every time that the user connects to the system. Profile holds default user environment settings.

$ ls -lrt .profile
-rw-r--r--   1 db2inst1 db2dba     331 Dec 12  2003 .profile

$ cat .profile
#       This is the default standard profile provided to a user.
#       They are expected to edit it to meet their own needs.
# The following three lines have been added by UDB DB2.
if [ -f sqllib/db2profile ]; then
    . sqllib/db2profile
Listing 4: .profile - the DB2 instance owner default profile

The DB2 installation procedure customizes UNIX profile execution, by redirecting logon execution to the db2profile environment file. Db2profile contains all of the necessary settings for executing DB2 database software. A user can change this default behavior, customizing entries according specific needs.

.rhosts - remote execution configuration file (UNIX)

File Name

Default Location



The .rhosts file contains a list of the remote hosts having permissions to invoke certain commands on the local host without supplying a password. The DB2 database uses this file for allowing remote command execution for the multi-partition configuration database system. Each DB2 ESE database partition must have authority to perform remote commands on all of the other database partitions.

$ ls -lrt .rhosts
-rw-------   1 db2inst1 db2dba      18 Feb  6  2003 .rhosts

$ cat .rhosts
ARTIST001 db2inst1
Listing 5: .rhosts - UNIX trusted remote hosts configuration file

In the displayed example, we had setup with one physical machine, hosting multiple DB2 ESE partitions in MDP configuration.

DB2 Archives