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]
$INSTHOME/sqllib/db2dump/ $m [ any valid path name (see the following section for resolution variables options) ]
$INSTHOME/sqllib/db2dump for instance configuration in a single member environment
Symbols
pathname
A directory path to use instead of the default diagnostic data directory
$h
Resolves to HOST_hostname.
Note: Starting in Version 10, in Db2 pureScale® environments, $h refers to the member's home host.
$n
Resolves to NODEnumber
$m
Resolves to DIAGnumber.
Note: DIAGnumber is used regardless of whether it refers to a database partition, a CF, or a member.
/trailing-dir
A single directory, or a directory and sub-directory to trail $h or $n
The following values are available:
  • '"$h"'
  • '"$h/trailing-dir"'
  • '"pathname $h"'
  • '"pathname $h/trailing-dir"'
  • '"$n"'1
  • '"$n/trailing-dir"'
  • '"pathname $n"'
  • '"pathname $n/trailing-dir"'
  • '"$m"'
  • '"$m/trailing-dir"'
  • '"pathname $m"'
  • '"pathname $m/trailing-dir"'
  • '"$h$n"'2
  • '"$h$n/trailing-dir"'
  • '"pathname $h$n"'
  • '"pathname $h$n/trailing-dir"'
  • '"$h$m"'
  • '"$h$m/trailing-dir"'
  • '"pathname $h$m"'
  • '"pathname $h$m/trailing-dir"'

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

If this parameter is null, the diagnostic information will be written to a default diagnostic path directory string 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/ $m, where INSTHOME is the home directory of the instance.

Starting in version 11.5.6 and while in a Db2 pureScale environment, the diagnostic data directory path used must contain at least one split token ($h, $n, or $m) to ensure a private db2diag log file for each member and CF.

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 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, $n, and $m are case insensitive.
  • The dynamic behavior 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.
  • When the diagpath configuration parameter is set to a new directory, it is recommended that this new diagpath directory has the same permission as the default diagpath directory.
    For Linux and UNIX environment, the preferred permission value on the new directory is 1777. To set the permission on the new directory, run the following command:
    chmod 1777 <directory>
In Version 9.5 and later, the default value of DB2INSTPROF at the global level is stored at the new location shown previously. 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.
1 $n is deprecated and might be removed in a future release.
2 $h$n is deprecated and might be removed in a future release.