Diagnostic support in the IBM Data Server Driver for ODBC and CLI

You can install and configure the IBM Data Server Driver for ODBC and CLI product to obtain only the CLI driver and the CLI related features. You can use the tracing, logging, and diagnostic utilities to help troubleshoot a problem with the IBM Data Server Driver for ODBC and CLI installation.

The following tracing, logging, and diagnostic utilities are provided with the IBM Data Server Driver for ODBC and CLI product:

CLI trace
The method for using CLI trace with the IBM Data Server Driver for ODBC and CLI product is the same as the method for using the CLI trace with an IBM data server client product.
Db2® trace
To turn on the Db2 trace from the IBM Data Server Driver for ODBC and CLI product installation, you must issue the db2trc command from the following directory:
  • On Windows operating systems, issue the db2trc command from the bin subdirectory.
  • On UNIX and Linux® operating systems, issue the db2trc command from the adm subdirectory.

For example, if you installed the IBM Data Server Driver for ODBC and CLI product at $HOME/ibm_data_server_driver_for_odbc_cli, you must be in the $HOME/ibm_data_server_driver_for_odbc_cli/adm directory when you issue the db2trc command.

The trace output path must have the write permission for trace files to be generated.
db2diag.log file
When you are using the IBM Data Server Driver for ODBC and CLI product, the db2diag.log file can be found in the following location:
  • On Windows operating systems: The db2diag.log file is found in the Drive:\ProgramData\IBM\Db2\%UNZIPPED PATH% directory. For example, if the IBM Data Server Driver for ODBC and CLI product was extracted to the D:\Program Files\IBM\clidriver directory, the %UNZIPPED PATH% value is D_Program Files_IBM_clidriver.
  • On UNIX and Linux operating systems: The db2diag.log file is in the db2dump subdirectory of the driver installation directory.
Note: On Windows operating systems, the sample configuration file is created when you run the db2cli install -setup command with the administrator authority:

The DB2_DIAG system environment variable and the DIAGPATH db2cli.ini keyword can be used to alter the location of the db2diag.log file.

db2support.zip file

TheDb2 command line processor is not available with the IBM Data Server Driver for ODBC and CLI product, so the CLP utility is not available. However, an executable version of the db2support command is provided in the IBM Data Server Driver for ODBC and CLI product installation.

The db2support command collects the following information:
  • The db2level command output.
  • Environment variables.
  • A listing of the contents of the IBM Data Server Driver for ODBC and CLI product installation directory.

You must issue the db2support command from the bin subdirectory of the installation directory.

For example, if you installed the driver at $HOME/ibm_data_server_driver_for_odbc_cli, you must be in the $HOME/ibm_data_server_driver_for_odbc_cli/bin directory when you issue the db2support command.

Setting diagnostic options

The IBM Data Server Driver for ODBC and CLI product does not support the command line processor (CLP). Therefore, you cannot use the db2set command to set Db2 registry variables. The registry variables that are related to diagnostics gathering are supported through the following db2cli.ini keywords:
You can also set and get following environment attributes with the SQLSetEnvAttr() function and the SQSGetEnvAttr function:
  • SQL_ATTR_DIAGLEVEL
  • SQL_ATTR_NOTIFYLEVEL
  • SQL_ATTR_DIAGPATH
See Environment attributes (CLI) list.
You can also set the path of the db2diag.log file with the following system environment variable:
  • DB2_DIAGPATH
See Environment variables supported by the IBM Data Server Driver for ODBC and CLI.
The following list of keywords and attribute can be used to specify an alternative location for the diagnostic output:
  • The DiagPath db2cli.ini keyword.
  • The DB2_DIAGPATH system environment variable.
  • The SQL_ATTR_DIAGPATH environment attribute.
If you installed the IBM Data Server Driver for ODBC and CLI product on a read-only network file system (NFS), the DB2_DIAGPATH system environment variable must be set to a directory with the write permission.