DB2 Insight Pack
A DB2® Insight Pack is provided with IBM® Operations Analytics - Log Analysis.
The Insight Pack includes support for ingesting and performing metadata searches against the DB2 version 9.7 and 10.1 db2diag.log files.
This document describes the version of the DB2 Insight Pack that is installed when you install IBM Operations Analytics - Log Analysis. An updated version of the DB2 Insight Pack may have been published after this version of IBM Operations Analytics - Log Analysis. To download the latest versions of this Insight Pack and updated documentation, see http://www.ibm.com/developerworks/servicemanagement/downloads.html.
Best practices for db2diag files
DB2 creates multiple db2diag.log files based on the database configuration. Follow these best practices to handle multiple db2diag logs for the rotating and multiple database partition scenarios.
- Scenario 1: Database spread across partitions and members
- If the database is spread across multiple partitions and members,
then a db2diag file is created in multiple directories
according to the DIAGPATH value. It can be difficult
to interpret the DIAGPATH and db2nodes.cfg to
find all the log files for each member and host. The best practice
recommendation is to use the db2diag tool, which
consolidates all the log records in to a single file. For databases spread among multiple partitions and members, consolidate the records from all db2diag log files on all your database partitions, run the following command:
Where filename.log is the name of the consolidated log file, such as db2diag_myglobalrecords.log.db2diag -global -output filename.log
- Scenario 2: Rotating log files
- If DB2 is configured for rotating log files, the files are named
dynamically as db2diag.<number>.log. The best
practice is to change the default log agent configuration files to
recognize the rotating logs.
If you choose to consolidate the rotating logs with the db2diag tool, follow the DB2 data loading best practice about loading the consolidated file.
Using the Data Collector client to load the consolidated rotating logs can improve data ingestion performance. However, you must filter the logs based on timestamps to avoid ingesting duplicate logs each time you consolidate the logs.
If you choose to consolidate the rotating logs with the db2diag tool, use the Data Collector as described in the DB2 data loading best practice about loading the consolidated file.
More information about the db2diag utility can be found at the DB2Information Center here:For version 10.1:
For version 9.7:
GET DATABASE MANAGER CONFIGURATION
INSTHOME/sqllib/db2dump,
DB2SET DB2INSTPROF
Configuration artifacts
The Insight Pack supports the DB2 timestamp format YYYY-MM-DD-hh.mm.ss Z. You can customize artifacts in the index configuration file.
Artifact | Name for the db2diag.log |
---|---|
Splitter rule set | DB2Diag-Split |
Annotator rule set | DB2Diag-Annotate |
Source type | DB2Diag |
Collection | DB2Diag-Collection1 |
Log File Agent configuration
- DB2InsightPack-lfadb2.conf: Configuration file for the DB2 log file agent.
- DB2InsightPack-lfadb2.fmt: Matches records for the db2diag log files.
Splitting and annotation AQL modules
AQL Module | Description |
---|---|
common | Common code module that is used across multiple log files (for example, to recognize timestamp formats). |
commonDB2 | Common annotations module that is used across splitter and annotator modules. |
annotatorDB2Diag | Annotator module for db2diag log files. |
splitterDB2Diag | Splitter module for db2diag log files. |