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 3

By Marin Komadina



node_num.env - DB2 instance node level profile registry



File Name Default Location
"node_num".env $HOME/sqllib/nodes


An SDP configured database system, with the DB2 database divided across different physical database partitions, has a node_num.env registry file on every database partition. My demo DB2 database ARTIST was running on only one physical machine and did not have a node-level profile registry file.



db2profile - DB2 instance owner profile



File Name Default Location
db2profile /opt/IBM/db2/V7.1 (template)
/opt/IBM/db2/V8.1 ( template)
$HOME/sqllib

The dB2profile is the most important DB2 configuration file. It is created automatically by the DB2 installation, and has all of the needed settings to activate DB2 software properly.

$ ls -lrt $HOME/sqllib/db2profile
-rwxr-xr-x   1 db2inst1  db2dba      4906 May 26 15:39 
 
$ cat db2profile
DB2DIR="/opt/IBM/db2/V8.1"
AddtoString()
{
  var=$1
  addme=$2
  awkval='$1 != "'${addme?}'"{print $0}'
  newval=`eval /usr/bin/echo \\${$var} | /usr/bin/awk "${awkval?}" RS=:`
  eval ${var?}=`/usr/bin/echo $newval | /usr/bin/sed 's/ /:/g'`:${addme?}
  unset var addme awkval newval
}
DB2INSTANCE=instancename
export DB2INSTANCE
INSTHOME=instancehomedir
AddtoString PATH ${INSTHOME?}/sqllib/bin
AddtoString PATH ${INSTHOME?}/sqllib/adm
AddtoString PATH ${INSTHOME?}/sqllib/misc
export PATH
if [ -f ${INSTHOME}/dmb/dmbprofile ]; then
    . ${INSTHOME}/dmb/dmbprofile
fi
CLASSPATH=${CLASSPATH:-""}
if [ -f ${INSTHOME?}/sqllib/java/db2java.zip ]; then
    AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/db2java.zip
fi
if [ -f ${INSTHOME?}/sqllib/java/db2jcc.jar ]; then
    AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/db2jcc.jar
fi
if [ -f ${INSTHOME?}/sqllib/java/sqlj.zip ]; then
    AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/sqlj.zip
fi
if [ -d ${INSTHOME?}/sqllib/function ]; then
    AddtoString CLASSPATH ${INSTHOME?}/sqllib/function
fi
 
if [ -f ${INSTHOME?}/sqllib/java/db2jcc_license_cisuz.jar ]; then
    AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/db2jcc_license_cisuz.jar
fi
 
if [ -f ${INSTHOME?}/sqllib/java/db2jcc_license_cu.jar ]; then
    AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/db2jcc_license_cu.jar
fi
AddtoString CLASSPATH .
export CLASSPATH
if [ -d ${INSTHOME?}/sqllib/templates ]; then
    VWS_TEMPLATES=${INSTHOME?}/sqllib/templates
    export VWS_TEMPLATES
fi
if [ -d ${INSTHOME?}/sqllib/logging ]; then
    VWS_LOGGING=${INSTHOME?}/sqllib/logging
    export VWS_LOGGING
fi
VWSPATH=${INSTHOME?}/sqllib
export VWSPATH
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-""}
AddtoString LD_LIBRARY_PATH ${INSTHOME}/sqllib/lib
export LD_LIBRARY_PATH
THREADS_FLAG=native
export THREADS_FLAG
if [ -f ${INSTHOME?}/sqllib/userprofile ]
then
    . ${INSTHOME?}/sqllib/userprofile
fi
Listing 11: db2profile - DB2 instance owner profile

db2nodes.cfg - partition configuration file

File Name

Default Location

db2nodes.cfg

$HOME/sqllib/

db2nodes.cfg is the DB2 ESE database partition (node) definition file. A standard, non-partitioned database instance does not use this configuration file.

$ ls -lrt db2nodes.cfg
-r--r--r--   1 db2inst1  db2dba        39 Dec 17  2002 
 
$ cat db2nodes.cfg
0 ARTIST001 0
1 ARTIST001 1
2 ARTIST001 2
Listing 12: db2nodes.cfg - DB2 node instance configuration file

Beginning with DB2 version 8, db2nodes.cfg is enhanced with the resourcename column. This new column provides the opportunity to direct one logical node to use a particular set of system resources. The new db2nodes.cfg file format has the following structure:

      nodenum    hostname   logical port   netname   resourcename  

Only Sun Solaris, version 9 is appropriate to use this new enhancement. For example, a UNIX machine with 8 CPUs could employ 4 CPUs for DB2, leaving the other CPUs for any applications running on the same machine.

Conclusion

Writing this article, one question crossed my mind.

Has anyone attempted to install DB2 software packages into any other directory than default provided by IBM (/var/db2), or has anyone read specific DB2 documentation describing how to organize the DB2 database directories on the server for the most optimal handling?

What I am definitely missing in the DB2 documentation, is a standardized database file structure recommendation. IBM has not published anything, such Oracle has, (an OFA "The Optimal Flexible Architecture"). An OFA is a set of standards that defines how to set up "complex Oracle systems at sites demanding high performance with low maintenance under continually evolving requirements."

Oracle kept this standard for internal use only for some time, but later this came out as a public standard. Thus far, DB2 has not published a similar standard, and we are forced to accept installation procedure defaults along with their consequences.

» See All Articles by Columnist Marin Komadina



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