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 both a source and enrichment datastore in Qualytics. It covers the entire process, from initial connection setup to testing and finalizing the configuration.

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 Enrichment Datastore

When using DB2 as an enrichment datastore, the following additional permissions are required for Qualytics to write metadata tables (e.g., _qualytics_*):

Permission Purpose
CREATETAB ON DATABASE Create enrichment tables (_qualytics_*)
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 Remove stale enrichment records
DROPIN ON SCHEMA <schema_name> Remove enrichment tables during cleanup or when the datastore is unlinked

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 toggle in the connection form. This establishes a TLS-encrypted connection between Qualytics and the DB2 instance.

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).

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 Datastores Extraction and the Datastore Properties. 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.

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.

Datastores Extraction

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.

Datastore Properties

Common fields for every source datastore, shown below the Datastores Extraction 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.

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 Source Datastores page.

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

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.

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

Step 8: Fill in the Datastores Extraction fields (Database and Schema) and the Datastore Properties.

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 an enrichment datastore so Qualytics can store anomalies and metadata from the first operation, click Next instead of Finish. See Add 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 Source Datastores page.

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

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 Datastores Extraction fields (Database and Schema) and the Datastore Properties. 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 an enrichment datastore so Qualytics can store anomalies and metadata from the first operation, click Next instead of Finish. See Add Enrichment Datastore below.

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

Add Enrichment Datastore

An enrichment datastore is where Qualytics writes what it finds: anomalies, remediation tables, and record enrichment. DB2 is supported for this role, so the same instance can hold both the data you monitor and the results.

Linking one during datastore creation is recommended, because scan results are then persisted from the very first operation. The flow itself is the same for every connector and is documented once, in Link Enrichment on Datastore Creation: reach it by clicking Next instead of Finish on the source datastore you just configured. To link one to a datastore that already exists, see Link Enrichment Datastore instead.

The rest of this section covers only what is specific to DB2: the fields you fill in when the enrichment datastore is a DB2 one.

Field reference

The Enrichment Datastore 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 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.

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.

Enrichment Extraction

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 for an enrichment datastore needs read and write access, while a source datastore needs only read access. See Additional Permissions for Enrichment Datastore above.

Enrichment Properties

FIELD REQUIRED TYPE DESCRIPTION
Name Text The name of the new enrichment datastore.
Teams Option Select one or more teams to associate with the enrichment datastore.

Table prefix

Qualytics generates a Prefix from the source datastore's name and adds it to every table it writes, so several source datastores can share one enrichment schema without colliding. An information banner at the bottom of the step previews the resulting table names.

Advanced Options

Collapsed by default. Expand it to change how anomalous source records are replicated.

FIELD REQUIRED TYPE DESCRIPTION
Remediation Strategy Choice Controls whether and how anomalous source tables are replicated to the enrichment datastore. None does not replicate them and is the default, Append adds the anomalous records after each scan, and Overwrite keeps only the records from the latest scan.

Steps

A DB2 enrichment datastore can be created from two places: as the second step of creating a source datastore, or on its own from the Enrichment Datastores page. Either way you choose between reusing a saved connection (Existing Connection) or creating one from scratch (New Connection). The tabs below cover both entry points for each option; each field is described in the Field reference above.

Linking one that already exists

Both entry points also let you pick an enrichment datastore you created earlier instead of creating one. Nothing there is specific to DB2, since you only select it from a list, so see Link Enrichment on Datastore Creation or Link Enrichment Datastore for those flows.

Step 1: Open the Enrichment Datastore form, from either entry point:

  • While creating a source datastore: click Next at the bottom of the Add Datastore page once the source connection test has passed. The Enrichment Datastore step opens.
  • On its own: navigate to the Enrichment Datastores page and click the Add Enrichment Datastore button at the top-right corner. The Enrichment Datastore page opens.

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

Step 3: Select DB2 from the connector grid. Only connectors that can host an enrichment datastore are listed. Use the search field to filter connectors by name.

Same connector as the source

When you arrive from a DB2 source datastore, DB2 comes already selected, with the connection fields already filled in from the source connection. Click the selected card to change it.

Step 4: Fill in the Connection Properties: the Connection Name, Host, Port, User, and Password, and turn on SSL Connection if your instance requires it.

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

Step 6: Fill in the Enrichment Extraction fields (Database and Schema) and the Enrichment Properties (Name and Teams).

Step 7: When you arrived from a source datastore, review the Prefix preview at the bottom of the step and, if needed, change the Remediation Strategy under Advanced Options. Both relate to the source datastore being linked, so they do not apply when creating the enrichment datastore on its own.

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

Info

The button that completes the step stays disabled until the required fields are filled in and the connection test passes on the current values. If the test fails, see Troubleshooting Common Errors.

Step 9: Complete the step: click Finish when you arrived from a source datastore, which creates both datastores and links them, or Create when creating the enrichment datastore on its own.

Step 10: A success dialog confirms the result. Click Go to your datastore to open the source datastore, or Go to your enrichment datastore when you created it on its own.

This option appears only when at least one saved connection can host an enrichment datastore.

Step 1: Open the Enrichment Datastore form, from either entry point:

  • While creating a source datastore: click Next at the bottom of the Add Datastore page once the source connection test has passed. The Enrichment Datastore step opens.
  • On its own: navigate to the Enrichment Datastores page and click the Add Enrichment Datastore button at the top-right corner. The Enrichment Datastore page opens.

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

Step 3: 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 4: Fill in the Enrichment Extraction fields (Database and Schema) and the Enrichment Properties (Name and Teams).

Step 5: When you arrived from a source datastore, review the Prefix preview at the bottom of the step and, if needed, change the Remediation Strategy under Advanced Options. Both relate to the source datastore being linked, so they do not apply when creating the enrichment datastore on its own.

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

Info

The button that completes the step stays disabled until the required fields are filled in and the connection test passes on the current values. If the test fails, see Troubleshooting Common Errors.

Step 7: Complete the step: click Finish when you arrived from a source datastore, which creates both datastores and links them, or Create when creating the enrichment datastore on its own.

Step 8: A success dialog confirms the result. Click Go to your datastore to open the source datastore, or Go to your enrichment datastore when you created it on its own.

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",
        "parameters": {
            "ssl": true
        }
    }
}
{
    "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

Creating 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",
        "parameters": {
            "ssl": true
        }
    }
}
{
    "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 an enrichment datastore to a source datastore:

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