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

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

DB2

Posted Jun 29, 2004

The DB2 Configuration Files Revealed - Page 2

By Marin Komadina

The DB2 Instance Configuration Files

In contrast to the operating system configuration files, a DB2 database instance has numerous configuration points. Under normal conditions, a DBA does not need to intervene and update any of them manually. The next picture displays the DB2 instance configuration files related to a single machine running different DB2 database software installations, (DB2 version 7.1 and version 8.1), simultaneously.

Each configuration file has a relationship to the previous one in the tree. All files do not necessarily exist on every installed DB2 system. Search order over configuration files follows a strict order:

  • session environment variables
  • global DB2 profile registry (global.reg)
  • DB2 software version profile registry (profiles.reg)
  • global instance profile registry (default.env)
  • local instance profile registry (profile.env)
  • node level profile registry (node_num.env)
  • instance owner profile (db2profile)
  • custom configuration profile (userprofile)
  • partition configuration file (db2nodes.cfg)

global.reg - global DB2 profile registry

File Name

Default Location

global.reg

/var/db2

A global.reg configuration file, acts as a root configuration file for all DB2 installations on the machine. A UNIX system with only one database version installed does not have this file. My demonstration installation has installed DB2 versions 7 and 8, where the global.reg was located on the highest directory structure position. It is used as a general, system DB2 configuration file.

$ ls -lrt
total 6
drwxr-xr-x   2 root     other        512 Oct 16  2002 v71
drwxr-xr-x   2 root     other        512 May 25 13:37 v81
-rw-r--r--   1 root     other        251 May 26 15:39 global.reg

$ file global.reg
global.reg:     data

$ strings global.reg
/opt/IBM/db2/V8.1
db2inst1
/home/db2inst1/sqllib
/opt/IBM/db2/V8.1
/opt/IBM/db2/V8.1
Listing 6: global.reg - global DB2 profile registry

profiles.reg - DB2 software version profile registry

File Name

Default Location

profiles.reg

/var/db2/v71

/var/db2/v81

The profiles.reg configuration file holds a list of all instance profiles running under the same DB2 software version. In the other words, a list of DB2 instances running the same code version. On a UNIX machine having only one DB2 software version installed, profiles.reg is used as the global profile registry file. The profiles.reg file becomes the second configuration file in the hierarchy on a machine with several installed DB2 versions, and is read accordingly--after the global.reg configuration file.

$ ls -lrt profiles.reg
-rw-r--r--   1 root     other          8 Jul 26  2002 profiles.reg
 
$ cat profiles.reg
db2inst1
 
$ db2set -l
db2inst1
Listing 7: profiles.reg - DB2 version profile registry

IBM has provided the db2set system command for displaying and changing the profiles.reg file content.

default.env - global instance profile registry

File Name

Default Location

default.env

/var/db2/v71

/var/db2/v81

The local instance profile holds certain important information related to the local instance settings, such as license information or default host name. Profile content is normally managed using the DB2 system command 'db2set -g'.

$ ls -lrt default.env
-rw-rw-r--   1 dbinst1  db2dba         44 Feb  6  2003 default.env
 
$ cat default.env
DB2_EEE_LICENSE_POLICY='34512834284444'
DB2SYSTEM='ARTIST001'
 
>> db2set -g
DB2_EEE_LICENSE_POLICY='34512834284444'
DB2SYSTEM='ARTIST001'
Listing 8: default.env - local instance profile registry

This profile is also called global, generating a misunderstanding to the overall perception of the IBM configuration. Even though the content handling is managed with db2set global command switch "-g", this setting represents real, local instance registry settings.

profile.env - local instance profile registry

File Name

Default Location

UNIX default

profile.env

$HOME/sqllib

Yes

This is a central DB2 configuration file. According to IBM, it is strongly recommended that all DB2-specific registry variables be defined through this registry file. The explanation lays in the remote administration of these variables over Control Center, which would not be possible if registry variables were defined elsewhere. Only the PATH and DB2INSTANCE variables should be defined outside of the DB2 local instance profile.

$ ls -lrt profile.env
-rw-rw-r--   1 db2inst1  db2dba       318 Oct 22  2002 profile.env
 
$ cat profile.env
DB2AUTOSTART='TRUE'
DB2_EXTENDED_OPTIMIZATION='ON'
DB2_DISABLE_FLUSH_LOG='ON'
DB2_STRIPED_CONTAINERS='ON'
DB2_HASH_JOIN='YES'
DB2DBDFT='artist'
DB2COMM='TCPIP'
DB2_PARALLEL_IO='*'
 
$ db2set -i
DB2AUTOSTART='TRUE'
DB2_EXTENDED_OPTIMIZATION='ON'
DB2_DISABLE_FLUSH_LOG='ON'
DB2_STRIPED_CONTAINERS='ON'
DB2_HASH_JOIN='YES'
DB2DBDFT='artist'
DB2COMM='TCPIP'
DB2_PARALLEL_IO='*'
Listing 9: profile.env - local instance profile

userprofile - custom configuration profile

File Name

Default Location

userprofile

$HOME/sqllib

Userprofile is a custom configuration file that is supposed to hold all non-standard db2profile variables. This file is of high importance during fix pack installations, because of the possibility that every new fix pack might clear all non-standard settings from db2profile. The db2profile file, by default, calls the userprofile after the DB2 environment is initialized.

$ ls -lrt userprofile
-rwxr-xr-x   1 db2inst1 db2dba       123 Feb  6  2003 
 
$ cat /export/home/db2inst1/sqllib/userprofile
export DSMI_CONFIG=/opt/tivoli/tsm/client/api/bin/dsm.opt
export DSMI_DIR=/opt/tivoli/tsm/client/api/bin
export DSMI_LOG=/home/db2inst1 
 
$ tail -f db2profile
 
if [ -f ${INSTHOME?}/sqllib/userprofile ]
then
    . ${INSTHOME?}/sqllib/userprofile
fi
Listing 10: userprofile - custom configuration profile


DB2 Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 



















Thanks for your registration, follow us on our social networks to keep up-to-date