In a Tivoli Storage Manager server environment, what is the purpose of the DB2 instance directory, and the local and system database directories?
When the TSMDB1 database is created in a Tivoli Storage Manager server environment, information about the database is written to both the DB2 local and system database directories. Understanding the purpose and locations of these directories, and the DB2 instance directory, can be beneficial during problem determination.
DB2 instance directory
The DB2 instance directory contains all information that pertains to a specific database instance. The instance directory contains the following data:
the database manager configuration file
the system database directory
the node directory
the node configuration file (db2nodes.cfg)
other files that contain debugging information (eg. db2diag.log)
By default, the DB2 instance directory is created in the home directory for the DB2 instance owner. The DB2 instance directory can typically be identified by the presence of the sqllib directory. If necessary, the 'db2greg -dump' command can be issued, as the DB2 instance owner, to determine the appropriate instance directory. The output from the 'db2greg -dump' command will resemble the following:
I,DB2,188.8.131.52, tsminst1 , /home/tsminst1/sqllib ,,1,0,/opt/tivoli/tsm/db2,,
In the output above we are only concerned with the line that begins with "I" as this is the line that contains information about the instance. The value in the fourth comma-delimited field should be the name of the DB2 instance owner (tsminst1) and the value in the fifth field is the location where the sqllib directory was created. Being as the sqllib directory is only created in the instance directory, we are able to determine that /home/tsminst1 is the instance directory. Keep in mind that if multiple instances are defined on this host, information about each of these instances will be displayed in the 'db2greg -dump' output.
DB2 system database directory
The system database directory is where DB2 records information about all of the local and remote databases that are cataloged to this specific DB2 instance. In a Tivoli Storage Manager server environment, only information about the local TSMDB1 database is recorded in the system database directory. Entries for the TSMDB1 database are created in the system database directory when the database is cataloged; either implicitly via the CREATE DATABASE command (eg. dsmserv format) or explicitly via the CATALOG DATABASE command.
The system database directory is created in a subdirectory beneath the DB2 instance directory and can be identified by the following path:
DB2 local database directory
The local database directory is where DB2 records information about all of the databases that are defined on the local host. In a Tivoli Storage Manager server environment, the local database directory will only contain information about the TSMDB1 database that is defined on that host. Entries for the TSMDB1 database are created in the local database directory only when the database is defined.
The DB2 local database directory is also often defined in, or a subdirectory of, the DB2 instance directory. The local database directory is created in the location specified by the default database path (DFTDBPATH) configuration parameter at the time that the database is defined. The current value for the DFTDBPATH configuration parameter can be determined by issuing the 'db2 get dbm cfg' command, as seen below:
$ db2 get dbm cfg |grep -i dftdbpath
Default database path (DFTDBPATH) = /tsminst1
In the event that no value is defined for the DFTDBPATH parameter, then the local database directory is, by default, created in the home directory for the DB2 instance owner. The local database directory can also be identified by the following directory structure:
For example, assuming a DB2 instance name of 'tsminst1' and a local database directory of '/home/tsminst1', we would expect to see the existence of the following directory path: