IBM Db2 lineage configuration
To import lineage metadata from IBM Db2, create a connection, data source definition and metadata import job.
IBM Db2 is a database that contains relational data.
Supported IBM Db2 versions
- IBM Db2 10.1, 11.5 and 12.1
Processed metadata
The following IBM Db2 metadata is processed and displayed in lineage:
- Data dictionaries
- Scripts
- Stored procedures
- SQL
- Modules
- Functions
- Triggers
- Views
- Packages
- Aliases / Synonyms
- Oracle’s compatibility mode
Limitations
The following data is not processed:
-
Assets that use dynamically executed code through the
EXECUTE IMMEDIATEstatement. -
Lineage through XML functions, including:
xmlelementxmlaggxmltable
-
If aliases and synonyms aren't referenced in the SQL queries, procedures, or functions, they don't appear in the flow viewer nor the object list.
Prerequisite configuration
Before you import lineage metadata, ensure that the following prerequisites are met:
- You have the following rights:
- CONNECT ON DATABASE
- USAGE ON WORKLOAD
SYSDEFAULTUSERWORKLOAD - EXECUTE ON PROCEDURE
SYSPROC.DB2LK_GENERATE_DDL - EXECUTE ON PROCEDURE
SYSPROC.DB2LK_CLEAN_TABLE - USAGE ON SEQUENCE
SYSTOOLS.DB2LOOK_TOKEN - INSERT, UPDATE, DELETE, SELECT ON TABLE
SYSTOOLS.DB2LOOK_INFO - SELECT ON
SYSTOOLS.DB2LOOK_INFO_V - SELECT on the following system tables and views Unless the database was created in the Restrict mode, these are granted to every user by default:
SYSCAT.ATTRIBUTESSYSCAT.AUDITPOLICIESSYSCAT.COLUMNSSYSCAT.CONDITIONSSYSCAT.CONTEXTSSYSCAT.CONTROLSSYSCAT.DATATYPEDEPSYSCAT.DATATYPESSYSCAT.FUNCTIONSSYSCAT.HIERARCHIESSYSCAT.CHECKSSYSCAT.INDEXESSYSCAT.INDEXEXTENSIONSSYSCAT.INDEXXMLPATTERNSSYSCAT.KEYCOLUSESYSCAT.MODULEOBJECTSSYSCAT.MODULESSYSCAT.NICKNAMESSYSCAT.PACKAGESSYSCAT.PERIODSSYSCAT.PROCEDURESSYSCAT.REFERENCESSYSCAT.ROLESSYSCAT.ROUTINEDEPSYSCAT.ROUTINEPARMSSYSCAT.ROUTINESSYSCAT.ROWFIELDSSYSCAT.SECURITYLABELCOMPONENTSSYSCAT.SECURITYLABELSSYSCAT.SECURITYPOLICIESSYSCAT.SEQUENCESSYSCAT.SERVEROPTIONSSYSCAT.SERVERSSYSCAT.SCHEMATASYSCAT.STATEMENTSSYSCAT.TABCONSTSYSCAT.TABLESSYSCAT.TABOPTIONSSYSCAT.TRIGGERSSYSCAT.VARIABLEDEPSYSCAT.VARIABLESSYSCAT.VIEWDEPSYSCAT.VIEWSSYSIBM.ROUTINESSYSIBM.SYSDATATYPESSYSIBM.SYSDEPENDENCIESSYSIBM.SYSDUMMY1SYSIBM.SYSFUNCMAPPINGSSYSIBM.SYSFUNCTIONSSYSIBM.SYSINDEXESSYSIBM.SYSINDEXOPTIONSSYSIBM.SYSMODULESSYSIBM.SYSROUTINEOPTIONSSYSIBM.SYSROUTINEPARMSSYSIBM.SYSROUTINESSYSIBM.SYSSERVERSSYSIBM.SYSSCHEMATASYSIBM.SYSTABLESSYSIBM.SYSTABOPTIONSSYSIBM.SYSTYPEMAPPINGSSYSIBM.SYSUSEROPTIONSSYSIBM.SYSVARIABLESSYSIBM.SYSWRAPPERSSYSIBMADM.ENV_INST_INFOSYSIBMADM.ENV_SYS_INFOSYSIBM.SYSKEYCOLUSESYSIBM.SYSTABCONST
Creating a metadata import asset
Data source connection
To connect to the data source from which you want to import lineage metadata, you need to select a data source definition and a connection. You can create them before you start creating the metadata import, or you can create them when you create and configure the metadata import asset.
Data source definition
Select IBM Db2 as the data source type.
Connection
For connection details, see IBM Db2 connection.
Include and exclude lists
You can include or exclude assets up to the schema level. Each value is evaluated as a regular expression. Assets which are added later in the data source will also be included or excluded if they match the conditions specified in the lists. Example values:
mySchema:mySchemaschema.mySchema[1-5]: any schema with a name that starts withmySchemaand ends with a digit between 1 and 5.
External inputs
If you use external Db2 PL/SQL scripts, you can add them in a .zip file as an external input. You can organize the structure of a .zip file as subfolders that represent schemas. After the scripts are scanned, they are added under respective schemas in the selected catalog or project. The .zip file can have the following structure:
<schema_name>
<script_name.sql>
<script_name.sql>
replace.csv
The replace.csv file contains placeholder replacements for the scripts that are added in the .zip file. For more information about the format, see Placeholder replacements.
Advanced import options
- Extract extended attributes
- You can extract extended attributes like primary key, unique and referential integrity constraints of columns. By default these attributes are not extracted.