DB2 Version 9.7 for Linux, UNIX, and Windows

diagpath - Diagnostic data directory path configuration parameter

This parameter allows you to specify the fully qualified primary path for DB2 diagnostic information.

Configuration type
Database manager
Applies to
  • Database server with local and remote clients
  • Client
  • Database server with local clients
  • Partitioned database server with local and remote clients
Parameter type
Configurable online
Propagation class
Immediate
Default [range]
Null [any valid path name, '"$h"', '"$h/trailing-dir"', '"pathname $h"', '"pathname $h/trailing-dir"', '"$n"', '"$n/trailing-dir"', '"pathname $n"', '"pathname $n/trailing-dir"','"$h$n"', '"$h$n/trailing-dir"', '"pathname $h$n"', or '"pathname $h$n/trailing-dir"']
Symbols
pathname
A directory path to use instead of the default diagnostic data directory
$h
Resolves to HOST_hostname
$n
Resolves to NODEnumber
/trailing-dir
A single directory, or a directory and sub-directory to trail $h or $n
The following values are available in DB2® Version 9.7 Fix Pack 2 and later fix packs:
  • '"$h"'
  • '"$h/trailing-dir"'
  • '"pathname $h"'
  • '"pathname $h/trailing-dir"'
  • '"$n"'
  • '"$n/trailing-dir"'
  • '"pathname $n"'
  • '"pathname $n/trailing-dir"'
  • '"$h$n"'
  • '"$h$n/trailing-dir"'
  • '"pathname $h$n"'
  • '"pathname $h$n/trailing-dir"'

The primary diagnostic data directory path can contain dump files, trap files, an error log, a notification file, an alert log file, and first occurrence data collection (FODC) packages, depending on your platform.

If this parameter is null, the diagnostic information will be written to files in one of the following directories or folders:
  • In Windows environments:
    • The default location of user data files, for example, files under instance directories, varies from edition to edition of the Windows family of operating systems. Use the DB2SET DB2INSTPROF command to get the location of the instance directory. The file is in the instance subdirectory of the directory specified by the DB2INSTPROF registry variable.
  • In Linux and UNIX environments: Information is written to INSTHOME/sqllib/db2dump, where INSTHOME is the home directory of the instance.
To split the diagnostic data directory path to collect diagnostic information per physical host, set the parameter to one of the following values:
  • Split default diagnostic data directory path:
    db2 update dbm cfg using diagpath '"$h"'
    which creates a subdirectory under the default diagnostic data directory with the host name, as in the following:
    Default_diagpath/HOST_hostname
  • Split default diagnostic data directory path with a trailing directory:
    db2 update dbm cfg using diagpath '"$h/trailing-dir"'
    which creates a subdirectory under the default diagnostic data directory with the host name and a trailing directory, as in the following:
    Default_diagpath/HOST_hostname/trailing-dir
  • Split your own specified diagnostic data directory path (there is a blank space between pathname and $h):
    db2 update dbm cfg using diagpath '"pathname $h"'
    which creates a subdirectory under your own specified diagnostic data directory with the host name, as in the following:
    pathname/HOST_hostname
  • Split your own specified diagnostic data directory path (there is a blank space between pathname and $h) and with a trailing directory:
    db2 update dbm cfg using diagpath '"pathname $h/trailing-dir"'
    which creates a subdirectory under your own specified diagnostic data directory with the host name and a trailing directory, as in the following:
    pathname/HOST_hostname/trailing-dir
To split the diagnostic data directory path to collect diagnostic information per database partition per physical host, set the parameter to one of the following values:
  • Split default diagnostic data directory path:
    db2 update dbm cfg using diagpath '"$n"'
    which creates a subdirectory for each partition under the default diagnostic data directory with the partition number, as in the following:
    Default_diagpath/NODEnumber
  • Split default diagnostic data directory path with a trailing directory:
    db2 update dbm cfg using diagpath '"$n/trailing-dir"'
    which creates a subdirectory for each partition under the default diagnostic data directory with the partition number and trailing directory, as in the following:
    Default_diagpath/NODEnumber/trailing-dir
  • Split your own specified diagnostic data directory path (there is a blank space between pathname and $n):
    db2 update dbm cfg using diagpath '"pathname $n"'
    which creates a subdirectory for each partition under your own specified diagnostic data directory with the partition number, as in the following:
    pathname/NODEnumber
  • Split your own specified diagnostic data directory path (there is a blank space between pathname and $n) and with a trailing directory:
    db2 update dbm cfg using diagpath '"pathname $n/trailing-dir"'
    which creates a subdirectory for each partition under your own specified diagnostic data directory with the partition number and trailing directory, as in the following:
    pathname/NODEnumber/trailing-dir
To split the diagnostic data directory path to collect diagnostic information per physical host and per database partition per physical host, set the parameter to one of the following values:
  • Split default diagnostic data directory path:
    db2 update dbm cfg using diagpath '"$h$n"'
    which creates a subdirectory for each logical partition on the host under the default diagnostic data directory with the host name and the partition number, as in the following:
    Default_diagpath/HOST_hostname/NODEnumber
  • Split default diagnostic data directory path with a trailing directory:
    db2 update dbm cfg using diagpath '"$h$n/trailing-dir"'
    which creates a subdirectory for each logical partition on the host under the default diagnostic data directory with the host name, the partition number, and a trailing directory, as in the following:
    Default_diagpath/HOST_hostname/NODEnumber/trailing-dir
  • Split your own specified diagnostic data directory path (there is a blank space between pathname and $h$n):
    db2 update dbm cfg using diagpath '"pathname $h$n"'
    which creates a subdirectory for each logical partition on the host under your own specified diagnostic data directory with the host name and the partition number, as in the following:
    pathname/HOST_hostname/NODEnumber
    For example, an AIX® host, named boson, has 3 database partitions with node numbers 0, 1, and 2. An example of a list output for the directory is similar to the following:
    usr1@boson /home/user1/db2dump->ls -R *
    HOST_boson:
    
    HOST_boson:
    NODE0000 NODE0001 NODE0002
    
    HOST_boson/NODE0000:
    db2diag.log db2eventlog.000 db2resync.log db2sampl_Import.msg events usr1.nfy
    
    HOST_boson/NODE0000/events:
    db2optstats.0.log
    
    HOST_boson/NODE0001:
    db2diag.log db2eventlog.001 db2resync.log usr1.nfy stmmlog
    
    HOST_boson/NODE0001/stmmlog:
    stmm.0.log
    
    HOST_boson/NODE0002:
    db2diag.log db2eventlog.002 db2resync.log usr1.nfy
  • Split your own specified diagnostic data directory path (there is a blank space between pathname and $h$n) and with a trailing directory:
    db2 update dbm cfg using diagpath '"pathname $h$n/trailing-dir"'
    which creates a subdirectory for each logical partition on the host under your own specified diagnostic data directory with the host name, the partition number and a trailing directory, as in the following:
    pathname/HOST_hostname/NODEnumber/trailing-dir
Note:
  • To avoid the operating system shell interpreting the $ sign on some Linux and UNIX systems, a single quote must be placed outside of the double quote, as shown in the syntax.
  • In the CLP interactive mode, or if the command is read and executed from an input file, the double quote is not required.
  • $h and $n are case insensitive.
  • To check that the setting of the diagnostic data directory path was successfully split, execute the following command:
    db2 get dbm cfg | grep DIAGPATH
    A successfully split diagnostic data directory path returns the values $h, $n, or $h$n with a preceding blank space. For example, the output returned is similar to the following:
    Diagnostic data directory path            (DIAGPATH) = /home/usr1/db2dump/ $h$n 
  • The dynamic behaviour for diagpath does not extend to all processes.
  • The db2sysc DB2 server process can detect dynamic changes, for example, when you issue the UPDATE DATABASE MANAGER CONFIGURATION command over an instance attachment.
  • When DB2 client and application processes start, they use the diagpath configuration parameter setting and do not detect any dynamic changes.
  • To improve performance, you can use the default setting for the diagpath configuration parameter in a non-partitioned database environment. In a partitioned database environment, you can use local storage at the host for the diagpath configuration parameter.
In Version 9.5 and later, the default value of DB2INSTPROF at the global level is stored at the new location shown in the previous section. Other profile registry variables that specify the location of the runtime data files should query the value of DB2INSTPROF. The other variables include the following ones:
  • DB2CLIINIPATH
  • DIAGPATH
  • SPM_LOG_PATH
Note: In DB2 Version 9.7 Fix Pack 4 and later fix packs, diagnostic logging can be made more resilient by setting an alternate diagnostic path in conjunction with the diagpath parameter. When alt_diagpath is set and the path specified by diagpath becomes unavailable, diagnostic logging continues in the alternate diagnostic data directory path specified, then resumes when the primary diagnostic path becomes available again.