Skip to content

DB2

Adding and configuring a DB2 connection within Qualytics empowers the platform to build a symbolic link with your schema to perform operations like data discovery, visualization, reporting, syncing, profiling, scanning, anomaly surveillance, and more.

This documentation provides a step-by-step guide on how to add DB2 as a source datastore in Qualytics. It covers the entire process, from initial connection setup to testing and finalizing the configuration. A DB2 datastore can also be the place Qualytics writes to; see Use as an Enrichment Datastore.

By following these instructions, enterprises can ensure their DB2 environment is properly connected with Qualytics, unlocking the platform's potential to help you proactively manage your full data quality lifecycle.

db2-connection-form

Let’s get started 🚀

DB2 Setup Guide

Qualytics connects to DB2 through the IBM DB2 JDBC driver. It queries DB2 system catalogs (SYSCAT.SCHEMATA, SYSCAT.TABLES) to discover schemas and uses standard JDBC metadata APIs for tables, columns, and primary keys.

Minimum DB2 Permissions (Source Datastore)

Permission Purpose
CONNECT ON DATABASE Allow the user to connect to the database
USAGE ON SCHEMA <schema_name> Access objects within the target schema
SELECT ON ALL TABLES IN SCHEMA Read data from all tables for profiling and scanning
SELECT ON SYSCAT.SCHEMATA Discover available schemas in the database
SELECT ON SYSCAT.TABLES Discover available tables and filter empty schemas

Additional Permissions for an Enrichment Datastore

When DB2 is used as an enrichment datastore, the following additional permissions are required so Qualytics can write its outputs, which are named from the linked source's prefix (for example _tpch_failed_checks):

Permission Purpose
CREATETAB ON DATABASE Create enrichment outputs
CREATEIN ON SCHEMA <schema_name> Create new objects within the schema
ALTERIN ON SCHEMA <schema_name> Modify enrichment table schemas during version migrations
INSERT ON ALL TABLES IN SCHEMA Write anomaly records, scan results, and check metrics
UPDATE ON ALL TABLES IN SCHEMA Update enrichment records during rescans
DELETE ON ALL TABLES IN SCHEMA Replace records when a run overwrites an output
DROPIN ON SCHEMA <schema_name> Replace an output when a run overwrites it (Overwrite remediation, Materialize, Export) or when a schema change requires recreating it. Unlinking never removes written data

Example: Source Datastore User (Read-Only)

Replace <schema_name> with your actual value.

-- Grant connection and schema access
GRANT CONNECT ON DATABASE TO USER qualytics_read;
GRANT USAGE ON SCHEMA <schema_name> TO USER qualytics_read;

-- Grant read access to all tables in the schema
GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO USER qualytics_read;

Example: Enrichment Datastore User (Read-Write)

-- Grant connection and schema access
GRANT CONNECT ON DATABASE TO USER qualytics_readwrite;
GRANT USAGE ON SCHEMA <schema_name> TO USER qualytics_readwrite;

-- Grant full data manipulation on all tables
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA <schema_name> TO USER qualytics_readwrite;

-- Grant table creation and schema modification
GRANT CREATETAB ON DATABASE TO USER qualytics_readwrite;
GRANT CREATEIN ON SCHEMA <schema_name> TO USER qualytics_readwrite;
GRANT ALTERIN ON SCHEMA <schema_name> TO USER qualytics_readwrite;

Note

Qualytics queries DB2 system catalogs (SYSCAT.SCHEMATA, SYSCAT.TABLES) during schema discovery. Ensure the Qualytics user has SELECT access to these system catalog views.

Info

If your DB2 server requires encrypted connections, enable the SSL Connection toggle in the connection form. This establishes a TLS-encrypted connection between Qualytics and the DB2 instance.

If the server presents a certificate Qualytics does not already trust, paste its signing chain into TLS Certificate Chain, in the collapsed Advanced section of the same form. Supplying a chain encrypts the connection on its own, so you do not need to turn on SSL Connection as well.

Troubleshooting Common Errors

Error Likely Cause Fix
SQL30082N: Security processing failed Incorrect username or password Verify the credentials and ensure the user exists in the DB2 instance
SQL1060N: User does not have the CONNECT privilege The user lacks CONNECT on the database Run GRANT CONNECT ON DATABASE TO USER <user>
SQL0551N: User does not have the required authorization The user lacks SELECT or other required permissions on a table Grant the missing permission on the specific table or schema
SQL0204N: Name is an undefined name The schema or table does not exist, or the user cannot see it Verify the schema name matches exactly (DB2 stores unquoted schema names in uppercase by default)
SQL0552N: User is not authorized to perform the requested command The enrichment user lacks CREATETAB or CREATEIN Run GRANT CREATETAB ON DATABASE TO USER <user> and GRANT CREATEIN ON SCHEMA <schema_name> TO USER <user>

Detailed Troubleshooting Notes

Authentication Errors

The error SQL30082N: Security processing failed indicates that the credentials are incorrect.

Common causes:

  • Incorrect password: the password does not match the one set for the user.
  • User does not exist: the username was misspelled or does not exist in the DB2 instance.
  • Authentication plugin mismatch: the DB2 server uses a different authentication mechanism than expected (e.g., Kerberos, LDAP).

Note

DB2 authentication is handled at the operating system or LDAP level, not within the database itself. Ensure the credentials match the OS or LDAP user account.

Permission Errors

The error SQL0551N: User does not have the required authorization means the user authenticated successfully but lacks the necessary grants.

Common causes:

  • Missing SELECT on tables: the user does not have SELECT on the target tables in the schema.
  • Missing CONNECT on database: the user cannot connect to the database.
  • Missing USAGE on schema: the user cannot access objects within the schema.
  • System catalog access: the user lacks SELECT access to SYSCAT.SCHEMATA or SYSCAT.TABLES needed for schema discovery.

Connection Errors

The error SQL1060N: User does not have the CONNECT privilege means the user lacks the CONNECT privilege on the database.

Common causes:

  • Missing CONNECT grant: GRANT CONNECT ON DATABASE TO USER <user> was not executed.
  • Database not cataloged: the target database is not cataloged on the DB2 client.
  • Network issues: a firewall is blocking connections on the DB2 port (default 50000).

Certificate and TLS Errors

A connection that fails while negotiating TLS, rather than at sign-in, usually means Qualytics does not trust the certificate the DB2 server presents. This can happen after a platform upgrade stops trusting a root certificate your server's chain depends on, even though nothing changed on the DB2 side.

Paste the server's signing chain into TLS Certificate Chain, in the collapsed Advanced section of the connection form, and check the following:

  • The whole chain: include the server certificate and every intermediate, each as its own -----BEGIN CERTIFICATE----- block. A missing intermediate leaves the chain incomplete and the connection still fails.
  • The format: the field takes PEM text only, up to 256 KiB. A larger value is rejected.
  • The scope: the chain applies to that one connection. Datastores reached through other connections are unaffected, and each connection that needs a chain gets its own.

Tip

Start by confirming credentials are valid (authentication errors), then verify schema/table permissions (permission errors), and finally check database connectivity (connection errors).

Add a Source Datastore

A source datastore is a storage location Qualytics connects to so it can profile, scan, and monitor data. Adding DB2 as a source lets Qualytics query your database through the DB2 JDBC driver and run quality operations on the tables it discovers.

Before you start, review the Minimum DB2 Permissions the connecting user needs.

Field reference

The Add Datastore page shows the sections below when DB2 is selected. When reusing an existing connection, the Connection Properties and Secrets Management sections come already filled in and read-only: Qualytics has already validated those credentials, so you fill in only the Location and the General fields. To change a saved connection's credentials, edit the connection through the Manage Connections page; edits there apply to every datastore that reuses the connection.

Connection Properties

These fields define the DB2 server Qualytics connects to and the account it connects with. They belong to the connection: when reusing an existing connection, they come already filled in and read-only.

Field Required Type Description
Connection Name Text A label for the saved connection (e.g., acme_db2_warehouse), so other datastores can reuse it later.
Host Text The hostname or address of the DB2 server.
Port Number The port the DB2 instance listens on. Defaults to 50000.
User Text The DB2 user Qualytics connects as. See Minimum DB2 Permissions for the privileges it needs.
Password Text The password for that user.
SSL Connection Checkbox Encrypts the connection between Qualytics and the DB2 server. Turn it on when your instance requires or supports TLS.
TLS Certificate Chain Text The PEM-encoded signing chain for the DB2 server's certificate, for when its issuer is not one of the certificates Qualytics already trusts. Paste the server certificate and every intermediate, each as its own -----BEGIN CERTIFICATE----- block, up to 256 KiB in total. It applies to this connection only, and supplying it encrypts the connection on its own. Sits in the collapsed Advanced section of the form.
Max Parallelization Number Caps how many queries Qualytics runs at the same time against a datastore reached through this connection, from 1 to 100. Leave it empty for no explicit limit. The cap applies per datastore, so datastores sharing this connection each get their own allowance. Sits in the collapsed Advanced section of the form, alongside TLS Certificate Chain. See Max Parallelization.

Secrets Management

This group is optional: use it only if you want Qualytics to pull credentials from a secrets manager instead of typing them into the form. Turn on HashiCorp Vault to show the fields below. Despite the label, any secrets manager that exposes a compatible REST API works, not only HashiCorp Vault; see Secrets Management. It also belongs to the connection: read-only when reusing an existing connection.

Field Required Type Description
Login URL Text The Vault endpoint Qualytics uses to authenticate (e.g., https://vault.example.com/v1/auth/approle/login).
Credentials Payload Text A JSON body containing the credentials Vault expects (e.g., {"role_id":"...","secret_id":"..."}).
Token JSONPath Text The JSONPath that extracts the client token from Vault's response. Defaults to $.auth.client_token.
Secret URL Text The Vault path where the secret is stored (e.g., https://vault.example.com/v1/secret/data/db2).
Token Header Name Text The HTTP header name used to send the token. Defaults to X-Vault-Token.
Data JSONPath Text The JSONPath that extracts the secret payload from Vault's response. Defaults to $.data.

Note

Once the secrets manager is configured, reference any secret value in the Connection Properties using ${key} (e.g., ${db2_password}). Qualytics resolves the secret at the moment the connection is opened, so changed keys take effect on the next connection.

Location

Pick the database and schema(s) Qualytics should read from. You fill these in on both flows.

Field Required Type Description
Database Text The database name (e.g., DB2). Typed in rather than picked from a list.
Schema Option One or more schemas inside that database (e.g., DB2INST1). Each schema you pick becomes its own Qualytics datastore. Click the refresh icon to load the available schemas.

Names are stored in upper case

Qualytics converts the Database and Schema names to upper case, matching how DB2 stores unquoted identifiers. Typing mydb and myschema records them as MYDB and MYSCHEMA. A value written as a Vault reference is left exactly as you typed it.

Multiple schemas

Selecting more than one schema creates one source datastore per schema, named from the Name Template. See Multi-Schema Source Datastore Creation for details.

General

Common fields for every source datastore, shown below the Location section. You fill these in on both flows.

Field Required Type Description
Name Template Text Defines the naming pattern for each source datastore being created. Use {{schema}} as a placeholder that gets replaced with the actual schema name (e.g., db2_{{schema}} becomes db2_db2inst1). Left empty, the datastore is named from the connection name and the schema.
Group Option Organizes your datastores under a shared group in the navigation tree. Select an existing group or create a new one with the Add New Group toggle.
Teams Option Select one or more teams to associate with this source datastore.
Initiate Sync Checkbox Automatically sync the datastore to detect containers and fields after creation.

Below the form, an information banner lists the Public addresses and Private addresses your datastore connections originate from. Allow the ones that match your network setup through your security groups or firewall rules; see How Connections Work for where the addresses come from.

Steps

There are two ways to set up the connection: reuse a connection you already saved (Existing Connection) or create a new one from scratch (New Connection). The tabs below walk through each option; pick the one you want to follow. Each field is described in the Field reference above.

Step 1: Navigate to the Datastores page.

Step 2: Click the Add button at the top-right corner and choose Source .

Step 3: The Add Datastore page opens.

Step 4: Select New Connection next to the Search field.

Step 5: Select DB2 from the connector grid. Use the search field to filter connectors by name.

Step 6: Fill in the Connection Properties: the Connection Name, Host, Port, User, and Password, and turn on SSL Connection if your instance requires it. If the server's certificate is not one Qualytics already trusts, expand Advanced and paste its signing chain into TLS Certificate Chain.

Step 7: Optionally, expand Secrets Management to retrieve credentials from a secrets manager.

Step 8: Fill in the Location fields (Database and Schema) and the General fields.

Step 9: Click Test connection. A success message confirms that the connection has been verified.

Info

The Finish and Next buttons stay disabled until the connection test passes on the current values. If you change a connection field after a successful test, test again. If the test fails, see Troubleshooting Common Errors.

Step 10: Click Finish to create the datastore.

Tip

To link a destination so Qualytics can write anomalies and metadata from the first operation, click Next instead of Finish. See Use as an Enrichment Datastore below.

Step 11: A success dialog confirms that your datastore has been added. Click Go to your datastore to open its page.

Step 1: Navigate to the Datastores page.

Step 2: Click the Add button at the top-right corner and choose Source .

Step 3: The Add Datastore page opens.

Step 4: Select Existing Connection next to the Search field.

Step 5: Select the saved DB2 connection from the grid. Use the search field to filter connections by name. The Connection Properties and Secrets Management sections come already filled in and read-only.

Start a new connection from this one

To use the selected connection as a starting point for a brand-new connection instead, click the Duplicate as a new connection button on the selected connection. The form switches to New Connection mode with the connection's settings already filled in for you to adjust.

Step 6: Fill in the Location fields (Database and Schema) and the General fields. These are the only fields left to fill in: Database, Schema, and Teams are the required ones, while Name Template, Group, and Initiate Sync are optional.

Step 7: Click Test connection. A success message confirms that the connection has been verified.

Info

The Finish and Next buttons stay disabled until the connection test passes on the current values. If the test fails, see Troubleshooting Common Errors.

Step 8: Click Finish to create the datastore.

Tip

To link a destination so Qualytics can write anomalies and metadata from the first operation, click Next instead of Finish. See Use as an Enrichment Datastore below.

Step 9: A success dialog confirms that your datastore has been added. Click Go to your datastore to open its page.

Use as an Enrichment Datastore

An enrichment datastore is where Qualytics writes its findings: scan results, source record examples, remediation snapshots, materialized copies, and exports. Keep it on a dedicated schema or storage path, separate from the source data you govern. When a source datastore is linked to it, that source's writes land there. The destination can share the source's connection when those credentials have the required write access.

To use a DB2 datastore as a destination, its connection user needs the write grants listed under Additional Permissions for an Enrichment Datastore. Then link it from the datastore that will write to it: open its Settings menu, click Enrichment , and either pick the DB2 datastore under Use existing or create it there under Add new. The same choice is offered in the second step of the Add Datastore page. The flow is the same for every connector and is documented once, in Link an Enrichment Destination and Link Enrichment on Datastore Creation.

The rest of this section covers only what is specific to DB2: the fields you fill in when creating the destination on DB2 from inside that dialog. For what Qualytics writes and how the outputs are named, see Enrichment Outputs.

Field reference

The Enrichment Destination step shows the sections below when DB2 is selected. When reusing an existing connection, the Connection Properties and Secrets Management sections come already filled in and read-only.

Connection Properties

These fields define the DB2 server Qualytics writes to and the account it connects with. They are the same fields as on the source datastore flow, repeated here so this section stands on its own.

Field Required Type Description
Connection Name Text A label for the saved connection (e.g., acme_db2_enrichment), so other datastores can reuse it later.
Host Text The hostname or address of the DB2 server.
Port Number The port the DB2 instance listens on. Defaults to 50000.
User Text The DB2 user Qualytics connects as. It needs write access, not just read. See Additional Permissions for an Enrichment Datastore.
Password Text The password for that user.
SSL Connection Checkbox Encrypts the connection between Qualytics and the DB2 server. Turn it on when your instance requires or supports TLS.
TLS Certificate Chain Text The PEM-encoded signing chain for the DB2 server's certificate, for when its issuer is not one of the certificates Qualytics already trusts. Paste the server certificate and every intermediate, each as its own -----BEGIN CERTIFICATE----- block, up to 256 KiB in total. It applies to this connection only, and supplying it encrypts the connection on its own. Sits in the collapsed Advanced section of the form.
Max Parallelization Number Caps how many queries Qualytics runs at the same time against a datastore reached through this connection, from 1 to 100. Leave it empty for no explicit limit. The cap applies per datastore, so datastores sharing this connection each get their own allowance. Sits in the collapsed Advanced section of the form, alongside TLS Certificate Chain. See Max Parallelization.

Secrets Management

This group is optional: use it only if you want Qualytics to pull credentials from a secrets manager instead of typing them into the form. Turn on HashiCorp Vault to show the fields below. Despite the label, any secrets manager that exposes a compatible REST API works, not only HashiCorp Vault; see Secrets Management.

Field Required Type Description
Login URL Text The Vault endpoint Qualytics uses to authenticate (e.g., https://vault.example.com/v1/auth/approle/login).
Credentials Payload Text A JSON body containing the credentials Vault expects (e.g., {"role_id":"...","secret_id":"..."}).
Token JSONPath Text The JSONPath that extracts the client token from Vault's response. Defaults to $.auth.client_token.
Secret URL Text The Vault path where the secret is stored (e.g., https://vault.example.com/v1/secret/data/db2).
Token Header Name Text The HTTP header name used to send the token. Defaults to X-Vault-Token.
Data JSONPath Text The JSONPath that extracts the secret payload from Vault's response. Defaults to $.data.

Location

Where Qualytics writes the enrichment tables inside the instance.

Field Required Type Description
Database Text The database that holds the target schema.
Schema Option The schema Qualytics writes the enrichment tables into. Pick exactly one, and make sure the user has write access to it.

Warning

The user used by an enrichment datastore needs read and write access, while a source datastore needs only read access. See Additional Permissions for an Enrichment Datastore above.

General

Field Required Type Description
Name Text The name of the new datastore.
Teams Option Select one or more teams to associate with the datastore.

Table prefix

Qualytics generates a Prefix from the source datastore's name for Scan, Remediation, and Materialize outputs. Each source sharing a destination needs a unique prefix. Export tables instead use the normalized datastore name. To change the prefix before creating the datastore, click Edit prefixes in the Prefix section of this step.

Write Behavior

Whether a Scan also writes a snapshot of the anomalous records, and whether Qualytics syncs and profiles the destination after each write.

Field Required Type Description
Remediation Strategy Choice Controls whether and how anomalous source records are written to the enrichment destination. None does not write them and is the default, Append adds the anomalous records after each scan, and Overwrite keeps only the records from the latest scan.
Sync and profile the enrichment destination Toggle On by default. After this datastore writes to the destination, Qualytics syncs the destination and profiles the new outputs so they are ready to use without a manual step.

Steps

Fill in these fields under Add new, either in the Enrichment Destination dialog of the datastore that will write here or in the second step of the Add Datastore page, then click Test connection and save. The steps are the same for every connector: see Link an Enrichment Destination or Link Enrichment on Datastore Creation.

API Payload Examples

This section provides detailed examples of API payloads to guide you through the process of creating and managing datastores using Qualytics API. Each example includes endpoint details, sample payloads, and instructions on how to replace placeholder values with actual data relevant to your setup.

Permissions

Creating a datastore requires the Manager role.

Names are stored in upper case

Qualytics converts database and schema to upper case, matching how DB2 stores unquoted identifiers. Sending mydb records it as MYDB. A value written as a Vault reference is left exactly as you sent it.

Creating a Source Datastore

This section provides sample payloads for creating a DB2 datastore. Replace the placeholder values with actual data relevant to your setup.

Endpoint: /api/datastores (post)

{
    "name": "your_datastore_name",
    "teams": ["Public"],
    "database": "db2_database",
    "schema": "db2_schema",
    "enrichment_only": false,
    "trigger_sync": true,
    "connection": {
        "name": "your_connection_name",
        "type": "db2",
        "host": "db2_host",
        "port": 50000,
        "username": "db2_username",
        "password": "db2_password",
        "max_parallelization": 10,
        "parameters": {
            "ssl": true,
            "tls_certificate": "-----BEGIN CERTIFICATE-----\n<server certificate>\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n<intermediate certificate>\n-----END CERTIFICATE-----"
        }
    }
}
{
    "name": "your_datastore_name",
    "teams": ["Public"],
    "database": "db2_database",
    "schema": "db2_schema",
    "enrichment_only": false,
    "trigger_sync": true,
    "connection_id": 123
}
# Step 1: Create a Connection
qualytics connections create \
    --type db2 \
    --name "your_connection_name" \
    --host ${DB2_HOST} \
    --port 50000 \
    --username ${DB2_USER} \
    --password ${DB2_PASSWORD}

# Step 2: Create a Source Datastore
qualytics datastores create \
    --name "your_datastore_name" \
    --connection-name "your_connection_name" \
    --database DB2 \
    --schema DB2INST1

Create an Enrichment Datastore

This section provides sample payloads for creating an enrichment datastore. Replace the placeholder values with actual data relevant to your setup.

Endpoint: /api/datastores (post)

{
    "name": "your_datastore_name",
    "teams": ["Public"],
    "database": "db2_database",
    "schema": "db2_enrichment_schema",
    "enrichment_only": true,
    "connection": {
        "name": "your_connection_name",
        "type": "db2",
        "host": "db2_host",
        "port": 50000,
        "username": "db2_username",
        "password": "db2_password",
        "max_parallelization": 10,
        "parameters": {
            "ssl": true,
            "tls_certificate": "-----BEGIN CERTIFICATE-----\n<server certificate>\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n<intermediate certificate>\n-----END CERTIFICATE-----"
        }
    }
}
{
    "name": "your_datastore_name",
    "teams": ["Public"],
    "database": "db2_database",
    "schema": "db2_enrichment_schema",
    "enrichment_only": true,
    "connection_id": 123
}
# Step 1: Create a Connection
qualytics connections create \
    --type db2 \
    --name "your_connection_name" \
    --host ${DB2_HOST} \
    --port 50000 \
    --username ${DB2_USER} \
    --password ${DB2_PASSWORD}

# Step 2: Create an Enrichment Datastore
qualytics datastores create \
    --name "your_datastore_name" \
    --connection-name "your_connection_name" \
    --database DB2 \
    --schema your_enrichment_schema \
    --enrichment-only

Use the provided endpoint to link a datastore to its enrichment destination:

Endpoint Details: /api/datastores/{datastore-id}/enrichment/{enrichment-id} (patch)