Before you create a Db2 for LUW workspace

Installing the Db2 drivers

Before you can use the data connector, you must make the Db2 drivers available to Tonic Structural:

  1. From https://www.nuget.org/packages/Net.IBM.Data.Db2, download the correct version of the Net.IBM.Data.Db2 driver for your operating system. The correct version as of March 19, 2023 is 7.0.0.400.

  2. Create a directory: <my-directory>

  3. From the driver zip file:

    1. Extract lib/net6.0/IBM.Data.Db2.dll into <my-directory>/IBM.Data.Db2.dll.

    2. Extract buildTransitive/clidriver/ into <my-directory>/clidriver/.

  4. Mount the created directory into the Tonic Web Server and Tonic Worker. You must map the directory you created to /data/db2 on the containers.

    1. For Docker, you place the driver files on the host machine, then share it to the containers as a volume. You must map the drivers to /data/db2 on the containers.

      To map the drivers, add the following entry into the Docker Compose file:

      volumes:
              ...
              - /my-host-path:/data/db2
    2. For Kubernetes, you can use any volume type that is allowed within your environment. It must provide at least ReadOnlyMany access. You must map the drivers to /data/db2 on the containers. In your web server and worker deployment YAML files, the entry should be similar to the following:

          volumeMounts:
          - name: <my-volume-name>
            mountPath: /data/db2

Required permissions (source database user)

The source database user must have the following permissions:

  • On the database, DBADMAUTH and DATAACCESSAUTH

  • If user is not authorized with DBADMAUTH or DATAACCESSAUTH, then Structural at minimum requires:

    • SELECT privilege on all tables

    • SELECT privilege on the following system catalog tables:

      • SYSCAT.TABLES

      • SYSCAT.COLUMNS

      • SYSCAT.KEYCOLUSE

      • SYSCAT.INDEXCOLUSE

      • SYSCAT.INDEXES

      • SYSCAT.TABCONST

      • SYSCAT.TABLESPACES

      • SYSCAT.SCHEMATA

Required permissions (destination database user)

The destination database user must have the following permissions:

  • On the database, DBADMAUTH and DATAACCESSAUTH

  • If user is not authorized with DBADMAUTH or DATAACCESSAUTH, then Structural at minimum requires:

    • SYSADM or SYSCTRL authority

    • SELECT, INSERT, ALTER, DELETE, INDEX, REFERENCES privilege on all tables

    • SELECT privilege on the following system catalog tables:

      • SYSCAT.TABLES

      • SYSCAT.COLUMNS

      • SYSCAT.KEYCOLUSE

      • SYSCAT.INDEXCOLUSE

      • SYSCAT.INDEXES

      • SYSCAT.TABCONST

      • SYSCAT.TABLESPACES

      • SYSCAT.SCHEMATA

    • EXECUTE privilege on the following routines:

      • SYS_PROC.DB2LK_GENERATE_DDL

      • AUTH_LIST_AUTHORITIES_FOR_AUTHID

Creating the destination databases

For Db2 for LUW, Structural does not create the destination database during data generation.

The destination database with the full schema must already be in place.

When you run the data generation, Structural removes the data from the database and populuates it with the transformed source data.

Last updated