Skip to main content
Version: NG-2.16

IBM DB2 Database

Introduction

IBM DB2 O11ySource enables monitoring of IBM DB2 databases by collecting key database health, performance, resource utilization, tablespace, transaction log, HADR replication, session, and connection metrics. It helps teams track database availability, performance bottlenecks, capacity usage, replication health, and operational issues from a centralized vuSmartMaps dashboard, supporting faster issue detection, troubleshooting, and improved observability for business-critical IBM DB2 database environments.

Getting Started

Compatibility

The IBM DB2 Database O11ySource is compatible with version v12.1.4.0

Data Collection Method

vuSmartMaps collects health and performance data for IBM DB2 Database by using an internal data collector. This data collector collects data based on the source configuration.

Prerequisites

Dependent Configuration

To configure this O11ySource, create a 'credential' of type 'user' under the 'Definition' tab.

Inputs for Configuring Data Source

  • Instance Name: Please enter a unique name for this IBM DB2 instance.
  • DB Details: Please provide the connection details for the IBM DB2 database.
  • IP Address: IP address or hostname of the IBM DB2 server.
  • Port: Port number on which IBM DB2 is listening (default: 50000).
  • Credential: Access credentials for the IBM DB2 database. Define credentials on the 'Definitions' page.
  • DB Name: Name of the IBM DB2 database to be monitored.
  • Metrics Collection Queries: SQL queries used to collect IBM DB2 metrics.
  • Query: Write the SQL query to be executed against the IBM DB2 database.
  • Polling Interval [seconds]: How frequently this custom query is executed. Interval must be between 180 and 86400 seconds.
  • Collection Offset [in seconds]: Delay in seconds from the periodic execution time to stagger query execution.
  • Custom Queries: Add custom SQL queries here to retrieve additional metrics and data from the IBM DB2 database.
  • Query Name: A unique name for the custom query. Used as the query_name tag in the collected metrics.
  • Query Topic: Assign a Kafka topic to route this query's data to a specific destination. Ensure the topic is created before configuring.

Firewall Requirement

To collect data from this O11ySource, ensure the following ports are opened:

Source IPDestination IPDestination PortProtocolDirection
vuSmartMaps IPIP address of the IBM DB2 server50000* (or configured DB2 port)TCPOutbound
IP address of the IBM DB2 servervuSmartMaps Kafka Broker IP9092 (Non SSL) / 9094 (SSL)*TCPInbound

*Before providing the firewall requirements, please update the port based on the customer environment.

Configuring the Target

Configure Metrics Collection from IBM DB2 Server Metrics from IBM DB2 LUW are gathered by establishing a connection using the DB2 CLI driver via db2exec.

  • To get started, create a read-only monitoring user with the required privileges on your IBM DB2 server.
  • Connect to your DB2 instance and execute the following commands:
db2 "CREATE USER vunet USING <PASSWORD>"
db2 "GRANT CONNECT ON DATABASE TO USER vunet"
db2 "GRANT SELECT ON SYSIBMADM.MON_CURRENT_SQL TO USER vunet"
db2 "GRANT SELECT ON SYSIBMADM.MON_LOCKWAITS TO USER vunet"
db2 "GRANT SELECT ON SYSIBMADM.ENV_INST_INFO TO USER vunet"
db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_DATABASE TO USER vunet"
db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TABLESPACE TO USER vunet"
db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TRANSACTION_LOG TO USER vunet"
db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_CONNECTION TO USER vunet"
db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_HADR TO USER vunet"
db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_BUFFERPOOL TO USER vunet"
db2 "GRANT EXECUTE ON FUNCTION SYSPROC.ENV_GET_SYSTEM_RESOURCES TO USER vunet"

Configuration Steps

  • Enable the IBM DB2 O11ySource.
  • Select the Sources tab and press the + button to add an IBM DB2 instance to monitor.
  • Provide the DB connection details: IP address, port, database name, and credentials.
  • Select the metrics collection queries to enable and configure polling intervals.
  • Click Save to deploy the collector.

Metrics Collected

NameDescriptionData Type
TimestampPrecise timestamp of the event with millisecond precision.DateTime64(3)
NameName of the monitoring event or measurement.LowCardinality(String)
TypeThe query type identifier (e.g., database-information, tablespace-details).LowCardinality(String)
HostHostname or IP of the IBM DB2 server.LowCardinality(String)
Source IDUnique identifier of the monitored IBM DB2 source.LowCardinality(String)
TargetThe target IBM DB2 instance being monitored.LowCardinality(String)
DB NameName of the IBM DB2 database being monitored.LowCardinality(String)
DB PortPort number of the IBM DB2 database server.UInt64
DB EngineDatabase engine type (ibm_db2_luw).LowCardinality(String)
Kafka TopicKafka topic used for routing IBM DB2 metrics.LowCardinality(String)
Message KeyUnique Kafka message routing key (IP:DBName).String
Query NameName of the SQL query that produced this metric row.LowCardinality(String)
MemberDB2 member number in a partitioned database environment.UInt64
Coord MemberCoordinating member for the current SQL activity.Int16
Database StatusCurrent status of the database (e.g., ACTIVE, INACTIVE).String
DB Activation StateActivation state of the database (e.g., ACTIVATED, NOT_ACTIVATED).String
DB Connection TimeTimestamp when the database connection was established.String
Time Since Last BackupElapsed time since the last successful database backup.String
Total BackupsTotal number of backups performed on the database.UInt64
Peak ConnectionsPeak number of concurrent database connections recorded.UInt64
Total ConnectionsTotal number of connections established to the database.UInt64
Total Secondary ConnectionsTotal number of secondary connections established.UInt64
Current Application ConnectionsNumber of applications currently connected to the database.UInt64
Applications in DB2Number of applications currently active inside DB2.UInt64
Active SortsNumber of sort operations currently active.UInt64
Total SortsTotal number of sort operations executed.UInt64
Internal RollbacksNumber of internal rollback operations performed by DB2.UInt64
Dynamic SQL StatementsTotal number of dynamic SQL statements executed.UInt64
Internal CommitsNumber of commit operations initiated internally by DB2.UInt64
Active Hash JoinsNumber of hash join operations currently active.UInt64
Lock TimeoutsTotal number of lock timeout events that have occurred.UInt64
Lock Wait TimeTotal time (ms) spent waiting for locks.UInt64
DeadlocksTotal number of deadlock events detected.UInt64
Lock WaitsTotal number of times an application waited for a lock.UInt64
Failed SQL StatementsTotal number of SQL statements that failed execution.UInt64
Total Commit TimeTotal elapsed time (ms) for all commit operations.UInt64
Total Application CommitsTotal number of commit operations initiated by applications.UInt64
Total Rollback TimeTotal elapsed time (ms) for all rollback operations.UInt64
Total Application RollbacksTotal number of rollback operations initiated by applications.UInt64
Rows DeletedTotal number of rows deleted from the database.UInt64
Rows InsertedTotal number of rows inserted into the database.UInt64
Rows UpdatedTotal number of rows updated in the database.UInt64
Rows ModifiedTotal number of rows modified (inserted, updated, or deleted).UInt64
Rows ReadTotal number of rows read from the database.UInt64
Rows ReturnedTotal number of rows returned to applications.UInt64
Total CPU TimeTotal CPU time (microseconds) consumed by the database.UInt64
Total Wait TimeTotal time (microseconds) spent waiting across all activities.UInt64
Total Request TimeTotal elapsed time (microseconds) for all database requests.UInt64
Total Hash JoinsTotal number of hash join operations executed.UInt64
Total Hash LoopsTotal number of hash loop iterations performed.UInt64
Hash Join OverflowsNumber of hash join operations that overflowed to disk.UInt64
Buffer Pool Data Logical ReadsLogical reads of data pages from the buffer pool.UInt64
Buffer Pool Temp Data Logical ReadsLogical reads of temporary data pages from the buffer pool.UInt64
Buffer Pool Index Logical ReadsLogical reads of index pages from the buffer pool.UInt64
Buffer Pool Temp Index Logical ReadsLogical reads of temporary index pages from the buffer pool.UInt64
Buffer Pool XDA Logical ReadsLogical reads of XML data pages from the buffer pool.UInt64
Buffer Pool Temp XDA Logical ReadsLogical reads of temporary XML data pages from the buffer pool.UInt64
Buffer Pool Column Logical ReadsLogical reads of column-organized pages from the buffer pool.UInt64
Buffer Pool Temp Column Logical ReadsLogical reads of temporary column-organized pages from the buffer pool.UInt64
Buffer Pool Data Physical ReadsPhysical reads of data pages from disk into the buffer pool.UInt64
Buffer Pool Temp Data Physical ReadsPhysical reads of temporary data pages from disk.UInt64
Buffer Pool Index Physical ReadsPhysical reads of index pages from disk into the buffer pool.UInt64
Buffer Pool Temp Index Physical ReadsPhysical reads of temporary index pages from disk.UInt64
Buffer Pool XDA Physical ReadsPhysical reads of XML data pages from disk.UInt64
Buffer Pool Temp XDA Physical ReadsPhysical reads of temporary XML data pages from disk.UInt64
Buffer Pool Column Physical ReadsPhysical reads of column-organized pages from disk.UInt64
Buffer Pool Temp Column Physical ReadsPhysical reads of temporary column-organized pages from disk.UInt64
Total Logical ReadsTotal logical read operations across all buffer pools.Float64
Total Physical ReadsTotal physical read operations across all buffer pools.Float64
Cache Hit RatioPercentage of logical reads served from the buffer pool cache.Float64
Tablespace NameName of the DB2 tablespace.String
Tablespace IDUnique numeric identifier of the tablespace.UInt64
Tablespace TypeType of tablespace (e.g., DMS, SMS, AUTOMATIC STORAGE).String
Tablespace Content TypeContent type of the tablespace (e.g., ANY, LARGE, SYSTEMP).String
Tablespace StateCurrent state of the tablespace (e.g., NORMAL, QUIESCED).String
Tablespace Used PagesNumber of pages currently used in the tablespace.UInt64
Tablespace Free PagesNumber of free pages available in the tablespace.UInt64
Tablespace Usable PagesTotal number of usable pages in the tablespace.UInt64
Tablespace Total PagesTotal number of pages allocated to the tablespace.UInt64
Tablespace Last Resize FailedIndicates whether the last tablespace resize operation failed.UInt8
Tablespace Pending Free PagesNumber of pages pending deallocation in the tablespace.UInt64
Tablespace Page TopHighest page number ever used in the tablespace.UInt64
Tablespace Max Page TopMaximum page number the tablespace has ever reached.UInt64
Tablespace Number of ContainersNumber of containers assigned to the tablespace.UInt64
Tablespace Auto Resize EnabledIndicates if automatic resizing is enabled for the tablespace.UInt8
Tablespace Initial SizeInitial size allocated to the tablespace (bytes).UInt64
Tablespace Max SizeMaximum size the tablespace can grow to (bytes).UInt64
Tablespace Increase SizeAmount by which the tablespace grows on each resize (bytes).UInt64
Tablespace Increase Size PercentPercentage growth applied during each tablespace resize.Int32
Tablespace Last Resize TimeTimestamp of the most recent tablespace resize operation.String
Tablespace Page SizeSize of each page in the tablespace (bytes).UInt64
Tablespace Track Modification StateState of modification tracking for backup purposes.String
Tablespace Paths DroppedNumber of storage paths dropped from the tablespace.Int32
Tablespace Using Auto StorageIndicates if the tablespace uses DB2 automatic storage.UInt8
Tablespace Extent SizeExtent size of the tablespace (pages).UInt64
Tablespace Prefetch SizePrefetch size configured for the tablespace (pages).UInt64
Tablespace Rebalancer ModeCurrent rebalancing mode for the tablespace.String
Tablespace Used PercentagePercentage of tablespace capacity currently in use.Float64
Current Active LogNumber of the current active transaction log file.UInt64
Current Archive LogNumber of the current archive log file.UInt64
First Active LogNumber of the first active transaction log file.UInt64
Last Active LogNumber of the last active transaction log file.UInt64
Total Log UsedTotal amount of transaction log space used (bytes).UInt64
Total Log AvailableTotal transaction log space available (bytes).UInt64
Log ReadsTotal number of log read operations performed.UInt64
Log Read TimeTotal time (ms) spent reading log records.UInt64
Log WritesTotal number of log write operations performed.UInt64
Log Write TimeTotal time (ms) spent writing log records.UInt64
Number of Log Write I/OTotal number of physical I/O requests for log writes.UInt64
Number of Log Read I/OTotal number of physical I/O requests for log reads.UInt64
Secondary Log Used TopPeak number of secondary log files used simultaneously.UInt64
Total Log Used TopPeak total transaction log space used (bytes).UInt64
Log HADR Wait TimeTotal time (ms) the primary waited for HADR log acknowledgement.UInt64
Log HADR Waits TotalTotal number of times the primary waited for HADR log acknowledgement.UInt64
Secondary Logs AllocatedNumber of secondary log files currently allocated.UInt64
Log Held by Dirty PagesLog space held due to dirty buffer pool pages not yet written.UInt64
Application ID Holding Oldest TransactionApplication ID holding the oldest active transaction.UInt64
Oldest Transaction LSNLog sequence number of the oldest active transaction.UInt64
Log to Redo for RecoveryAmount of log that must be redone in a crash recovery scenario.UInt64
Number of Log Buffer FullNumber of times the log buffer was completely full.UInt64
Transaction Log Utilization PercentagePercentage of total transaction log space currently in use.Float64
OS NameOperating system name of the DB2 host server.String
Host NameFully qualified hostname of the DB2 server.String
OS VersionVersion number of the operating system.String
OS ReleaseRelease identifier of the operating system.String
Machine IdentificationUnique identifier of the physical or virtual machine.String
OS LevelOS maintenance level or patch level.String
Total CPUsTotal number of CPUs available on the host.UInt64
Online CPUsNumber of CPUs currently online and active.UInt64
Configured CPUsNumber of CPUs configured for use by the OS.UInt64
CPU SpeedCPU clock speed in MHz.UInt64
CPU TimebaseCPU timebase frequency in Hz.UInt64
CPU HMT DegreeSimultaneous multi-threading degree per CPU.UInt64
CPU Cores Per SocketNumber of physical cores per CPU socket.UInt64
Total MemoryTotal physical memory available on the host (bytes).UInt64
Free MemoryAmount of physical memory currently free (bytes).UInt64
Total Swap MemoryTotal swap space configured on the host (bytes).UInt64
Free Swap MemoryAmount of swap space currently free (bytes).UInt64
Total Virtual MemoryTotal virtual memory (physical + swap) available (bytes).UInt64
Reserved Virtual MemoryAmount of virtual memory reserved by the OS (bytes).UInt64
Free Virtual MemoryAmount of virtual memory currently free (bytes).UInt64
CPU Load (Short Term)1-minute CPU load average on the host.Float64
CPU Load (Medium Term)5-minute CPU load average on the host.Float64
CPU Load (Long Term)15-minute CPU load average on the host.Float64
CPU Usage TotalTotal CPU utilization percentage across all cores.Int32
CPU User TimePercentage of CPU time spent in user mode.UInt64
CPU Idle TimePercentage of CPU time spent idle.UInt64
CPU I/O Wait TimePercentage of CPU time spent waiting for I/O operations.UInt64
CPU System TimePercentage of CPU time spent in kernel/system mode.UInt64
Swap Page SizeSize of a swap page on the host (bytes).UInt64
Swap Pages InTotal number of pages swapped into memory.UInt64
Swap Pages OutTotal number of pages swapped out of memory.UInt64
OS Full VersionComplete version string of the operating system.String
OS Kernel VersionKernel version of the operating system.String
OS Architecture TypeCPU architecture type (e.g., x86_64, ppc64le).String
Memory Used PercentagePercentage of total physical memory currently in use.Float64
Virtual Memory Used PercentagePercentage of total virtual memory currently in use.Float64
Instance NameName of the IBM DB2 instance.String
Is Instance PartitionableIndicates whether the instance supports database partitioning.UInt8
Number of DB PartitionsNumber of database partitions in the instance.Int32
Instance Pointer SizePointer size of the instance (32-bit or 64-bit).Int32
Release NumberDB2 product release number.UInt64
Service LevelDB2 service level identifier (e.g., DB2 v11.5.7.0).String
Build LevelDB2 build level string.String
PTFProgram Temporary Fix identifier applied to the instance.String
Fix Pack NumberFix Pack number currently installed on the DB2 instance.Int32
Number of MembersNumber of members in the DB2 pureScale or DPF environment.Int32
Application HandleUnique handle identifying an application connection to DB2.UInt64
Application IDUnique application identifier assigned by DB2.String
Application NameName of the application connected to the database.String
Session Auth IDAuthorization ID used for the current session.String
Client Application NameName of the client application making the connection.String
Elapsed Time (Seconds)Elapsed execution time of the current SQL activity in seconds.Int32
Activity StateCurrent state of the SQL activity (e.g., EXECUTING, IDLE).String
Activity TypeType of SQL activity (e.g., READ_DML, WRITE_DML, DDL).String
Direct ReadsNumber of read operations that bypassed the buffer pool.UInt64
Direct WritesNumber of write operations that bypassed the buffer pool.UInt64
Query Cost EstimateOptimizer estimated cost for executing the SQL statement.UInt64
Unit of Work IDIdentifier for the current unit of work (transaction).Int32
Activity IDIdentifier for the current activity within a unit of work.Int32
Statement TextFirst 500 characters of the SQL statement being executed.String
Client IP AddressIP address of the client making the connection.String
Client Workstation NameWorkstation name of the connecting client.String
Workload Occurrence StateCurrent state of the workload occurrence.String
Execution IDUnique identifier for the current execution context.String
Last Request TypeType of the last request made by the application.String
Client HostnameHostname of the client machine making the connection.String
Connection Start TimeTimestamp when the application connection was established.String
System Auth IDSystem-level authorization ID for the connection.String
Client ProtocolNetwork protocol used by the client (e.g., TCPIP).String
Client PlatformOperating system platform of the connecting client.String
Client Product IDDB2 product identifier of the connecting client.String
Client Process IDProcess ID of the client application on the client machine.UInt64
Client User IDUser ID provided by the client application.String
Client AccountingAccounting string provided by the client application.String
Total Connect RequestsTotal number of connection requests received.UInt64
Total Connect AuthenticationsTotal number of successful connection authentications.UInt64
Total Connect Authentication TimeTotal time (ms) spent authenticating connections.UInt64
Total Connect Request TimeTotal time (ms) spent processing connection requests.UInt64
Unit of Work Start TimeTimestamp when the current unit of work started.String
Unit of Work Stop TimeTimestamp when the current unit of work ended.String
Unit of Work Completion StatusCompletion status of the most recently completed unit of work.String
Number of Associated AgentsNumber of agents associated with the application.UInt64
Associated Agents TopPeak number of agents associated with the application.UInt64
Workload State Change TimeTimestamp when the workload occurrence state last changed.String
Application Idle TimeTime (seconds) the application has been idle.UInt64
Total TLS ConnectionsTotal number of TLS-encrypted connections established.UInt64
Lock NameInternal name identifying the lock resource being waited on.String
Lock Object TypeType of database object the lock is held on (e.g., TABLE, ROW).String
Lock Wait Elapsed TimeElapsed time (seconds) the request has been waiting for the lock.Int32
Table SchemaSchema name of the table involved in the lock wait.String
Table NameName of the table involved in the lock wait.String
Data Partition IDPartition ID of the data involved in the lock wait.Int32
Lock Mode RequestedLock mode being requested by the waiting application.String
Requesting Application HandleApplication handle of the connection waiting for the lock.UInt64
Requesting Statement TextSQL statement text of the application waiting for the lock.String
Holding Current Statement TextCurrent SQL statement text of the application holding the lock.String
Lock ModeCurrent lock mode held on the resource.String
Lock Current ModeCurrent granted lock mode for the waiting application.String
Requesting Agent Thread IDThread ID of the agent waiting for the lock.Int32
Requesting MemberDB2 member number of the requesting application.UInt64
Requesting Application NameName of the application waiting for the lock.String
Requesting User IDUser ID of the application waiting for the lock.String
Holding Application HandleApplication handle of the connection holding the lock.UInt64
Holding MemberDB2 member number of the application holding the lock.Int16
Holding Application NameName of the application holding the lock.String
Holding User IDUser ID of the application holding the lock.String
HADR StateCurrent state of the HADR pair (e.g., PEER, DISCONNECTED).String
Replay TypeType of log replay used by the HADR standby.String
Standby IDNumeric identifier of the HADR standby database.Int32
Log Stream IDLog stream identifier for the HADR pair.Int32
HADR RoleRole of the database in HADR (PRIMARY or STANDBY).String
HADR Connect StatusConnection status between primary and standby (e.g., CONNECTED).String
HADR Connect Status TimeTimestamp when the HADR connection status last changed.String
Heartbeat IntervalInterval (seconds) between HADR heartbeat messages.UInt64
HADR TimeoutHADR timeout value configured for the pair (seconds).UInt64
Heartbeat ExpectedNumber of heartbeats expected since the connection was established.Int32
Time Since Last ReceiveTime (seconds) since the last log record was received by standby.UInt64
HADR Sync ModeSynchronization mode of the HADR pair (e.g., SYNC, ASYNC, NEARSYNC).String
HADR Log GapAmount of log data (bytes) not yet received by the standby.UInt64
Standby Receive Replay GapDifference (bytes) between log received and log replayed on standby.UInt64
Standby Replay DelayConfigured delay (seconds) for log replay on the standby.UInt64
Heartbeat MissedNumber of consecutive heartbeats missed by the standby.Int32
Log HADR Wait CurrentCurrent wait time (ms) for HADR log acknowledgement.UInt64
Standby Receive Buffer PercentPercentage of the standby receive buffer currently used.Float64
Standby Spool PercentPercentage of the standby spool space currently used.Float64
Takeover App Remaining PrimaryNumber of applications remaining on primary during takeover.UInt64
Takeover App Remaining StandbyNumber of applications remaining on standby during takeover.UInt64
Primary Member HostHostname of the HADR primary member.String
Standby Member HostHostname of the HADR standby member.String
Primary MemberDB2 member number of the HADR primary.Int32
Primary InstanceInstance name of the HADR primary database.String
Primary Log FileCurrent log file on the HADR primary.String
Primary Log PageCurrent log page number on the HADR primary.UInt64
Primary Log PositionByte offset within the current log file on the HADR primary.UInt64
Primary Log TimeTimestamp of the current log record on the HADR primary.String
Standby Log FileMost recently replayed log file on the HADR standby.String
Standby Log PageMost recently replayed log page on the HADR standby.UInt64
Standby Log PositionByte offset of the most recently replayed log record on standby.UInt64
Standby Log TimeTimestamp of the most recently replayed log record on standby.String
Standby InstanceInstance name of the HADR standby database.String
Standby MemberDB2 member number of the HADR standby.Int32
HADR FlagsBitmask of HADR status flags for the pair.String
Raw MessageRaw Telegraf influx line protocol message before parsing.String
ErrorError information captured during data collection or parsing.String