The DB2 Configuration Files Revealed
June 29, 2004
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
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)
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).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)
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.Listing 2: group UNIX configuration file
services - port reservation file (UNIX)
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.Listing 3: services - UNIX port reservation file
.profile - user profile configuration file (UNIX)
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.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)
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.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.