Db2

What is Db2?

IBM Db2 is a relational database that provides high-performance, scalability and reliability for storing and managing structured data.

Why Connect Db2 to Monte Carlo?

Integrating Monte Carlo with Db2 allows you to monitor your data assets through custom SQL monitors, metrics, validations and comparisons, which can be created in either the UI wizard and/or programmatically via monitors as code (API/SDK too). These monitors can be used to generate notifications (incidents) to relevant stakeholders and circuit break pipelines.

Monitor & Lineage Support

Below are the monitors & lineage for the Db2 integration today. Please reach out to your Monte Carlo representative if you have requirements for additional monitors.

CategoryMonitor / Lineage CapabilitiesSupport
Table MonitorFreshness✅ (via opt-in row count*)
Table MonitorVolume✅ (via opt-in row count*)
Table MonitorSchema Changes
Metric MonitorMetricRow count only
Metric MonitorComparisonRow count only
Validation MonitorSQL Custom
Validation MonitorValidation
Job MonitorQuery performance
LineageLineage

*freshness and volume monitors are available via user opt-in for each table. These monitors would run count(*) queries for each table to detect freshness and volume anomalies.

Connecting to Db2

Now that we know the value connecting Db2 to Monte Carlo can bring, here are the necessary steps to set up the integration.

📘

Prerequisites

To create a service account, you will need admin credentials to your Db2 database.

This guide explains how to create a read-only service account for Monte Carlo in your Db2 database.

To review all steps necessary to integrate your SQL database with Monte Carlo, please see here.

Create a read-only service account

The recommended way to grant Monte Carlo access to your Db2 database, is to create a dedicated, read-only role and assign it to a dedicated Monte Carlo user. Db2 users are managed outside of the database, typically via the operating system. Create a user named monte_carlo . To create a role, connect to the database as a user with SECADM authority, and run the following query:

CREATE ROLE MONTE_CARLO_ROLE;
GRANT ROLE MONTE_CARLO_ROLE TO USER monte_carlo

In order to collect metadata, Monte Carlo requires access to the SYSCAT and SYSIBM schemas. Monte Carlo also requires access to any schemas that include tables to be monitored. To grant the required permissions, run the following queries:

GRANT CONNECT ON DATABASE TO ROLE MONTE_CARLO_ROLE;
GRANT SELECTIN ON SCHEMA SYSCAT TO ROLE MONTE_CARLO_ROLE;
GRANT SELECTIN ON SCHEMA SYSIBM TO ROLE MONTE_CARLO_ROLE;
GRANT SELECTIN ON SCHEMA <schema_to_monitor> TO ROLE MONTE_CARLO_ROLE;

How can I validate Monte Carlo has access to my assets?

After completing the Db2 integration setup, your Db2 assets should appear in the Monte Carlo Assets page between a few minutes and one hour. If you don't see your assets after this time period, you can run a validation test to troubleshoot the connection:

  1. Navigate to Settings → Integrations
  2. Find your Db2 integration and click on it
  3. Select the specific connection you want to test
  4. Click the Test button from the connection menu

This validation test will help identify any configuration issues that might be preventing your assets from appearing.

When running the validation test, you should see all green checkmarks. If any errors are encountered, the system will provide specific steps to resolve them.

Excluded Schemas

The following system created schemas are excluded from our metadata collection:

  • SYSIBM
  • SYSCAT
  • SYSFUN
  • SYSSTAT
  • SYSPROC
  • SYSIBMADM
  • SYSIBMINTERNAL
  • SYSIBMTS
  • SYSPUBLIC
  • NULLID
  • SQLJ
  • SYSTOOLS