Configuring Db2 for watsonx.data integration

The integration between Db2 and watsonx.data must be configured in 2 steps: first, the storage, and second, the metastores. Db2 and watsonx.data must be connected to the same storage and they must have access to each other’s table metadata to integrate.

Configuring storage access for watsonx.data integration

An access alias to access the object storage container (bucket) used by watsonx.data must be created in Db2. If watsonx.data uses multiple containers, one storage access alias must be created for each accessed container.

The following information must be available to create the storage alias:
  • The name of the container used by watsonx.data
  • The API endpoint used to access the container used by watsonx.data
  • The credentials (HMAC keys) to access the container used by watsonx.data

Complete the procedure in Remote storage connectivity for Datalake tables to create the storage access alias.

Note: Considerations when creating the storage alias:
  • When importing table from watsonx.data, the user running the import procedure must have access to the storage alias (as set by the "grantee" parameter when creating the storage alias) for the import operation to be successful.
  • When importing table from watsonx.data, the imported table location must be in a child path of the path specified when creating the storage alias (using the "object" parameter) for the import operation to be successful. It is recommended to leave the "object" parameter empty, unless there is a specific requirement not to leave it empty.

Configuring metastore access for watsonx.data integration

Table metadata is stored in dedicated servers called metastore. To enable data sharing between Db2 and watsonx.data, connectivity between Db2 and the watsonx.data metastore must be established, by registering the watsonx.data metastore in Db2.

To register the watsonx.data metastore in Db2, run the following command:
CALL REGISTER_EXT_METASTORE('metastore-name', 'property-list', ?, ?)
with the following parameters:
metastore-name
A provided unique name to identify the metastore server being registered.
property-list

A comma-separated list of configuration properties to enable connections to the watsonx.data metastore.

The following properties are supported:
Table 1. Supported properties
Name Required Description
type Yes The type of metastore to which you are connecting. Supported values are:
  • watsonx-data
uri Yes The URI of the metastore
use.SSL No "true" if the metastore requires an SSL connection
ssl.cert No The certificate to use to validate the SSL connection. Can be a PEM file path on the Db2 coordinator node or a string representing the cert in the PEM format. It is not necessary to pass a certificate if the SSL connection is established using a certificate issued by a well-known CA such as DigiCert or VeriSign.
auth.mode No If the metastore requires authentication, indicates the mode of authentication to use. The only supported value for now is "PLAIN".
auth.plain.credentials No If the metastore requires PLAIN authentication, provides the credentials as a string in the form "username:password". The password is stored securely in a software keystore.
It is possible to set / update / unset configuration properties after the metastore has been registered using the SET_EXT_METASTORE_PROPERTY stored procedure.

Connecting watsonx.data on IBM Cloud, AWS, or OpenShift

The exact set of configuration properties that must be provided depends on the type of watsonx.data deployment you are connecting to. In addition, some configuration on the watsonx.data side may be required to enable the connection.

Consult the page below that matches your watsonx.data deployment to learn how to configure watsonx.data for for the connection , what properties are needed and how to obtain their values.

Example

The following is an example showing how to register the metastore of a watsonx.data Saas deployment in Db2, which establishes an SSL connection by using a certificate issued by a well-known CA and PLAIN authentication:
CALL REGISTER_EXT_METASTORE('watsonxdata', 'type=watsonx-data,uri=thrift://hmsauth1.fyre.ibm.com:9083', ?, ?)
CALL SET_EXT_METASTORE_PROPERTY('watsonxdata', 'use.SSL', 'true', ?, ?)
CALL SET_EXT_METASTORE_PROPERTY('watsonxdata', 'auth.mode', 'PLAIN', ?, ?)
CALL SET_EXT_METASTORE_PROPERTY('watsonxdata', 'auth.plain.credentials', 'ibmlhapikey:<password>', ?, ?)