Inaccurate query results for Db2 z/OS remote data sources in Data Virtualization

If you run queries with scalar functions against Db2 z/OS remote data sources that use the Db2 connection type, these queries might return inaccurate results.

Symptoms

You run some queries with scalar functions against Db2 z/OS remote data sources that use the Db2 connection type. You get results of 0 records for these queries.

Causes

Optimized pushdown is not working properly for queries against Db2 z/OS remote data sources that use the Db2 connection type.

Resolving the problem

To solve this issue, run the following commands to set the Db2 registry variable. A Platform administrator must run these commands from the c-dv2u-cv-db2u-0 pod.

These commands get the current setting of the DB2_DV_OVERRIDES variable, then add the NO_SSPD(DB2) setting to the variable, and then ensure SQL statements are flushed from the package cache.

  1. Log in to the Data Virtualization head pod.
    oc rsh c-db2u-dv-db2u-0 bash
  2. Switch to the Data Virtualization database instance owner db2inst1.
    su - db2inst1
  3. Obtain the current settings of the DB2_DV_OVERRIDES variable.
    db2set | grep DB2_DV_OVERRIDES

    The output of the previous command might be similar to the following example.

    DB2_DV_OVERRIDES=EN_OJMQT,EN_JOINFILTER,EN_GAIANQUERY_JOINFILTER
  4. Using the value from step 3, update the variable setting. The new value for the variable is formed by taking the prior value and appending `,NO_SSPD(DB2)`. In the previous example, the new value would be as follows.
    EN_OJMQT,EN_JOINFILTER,EN_GAIANQUERY_JOINFILTER,NO_SSPD(DB2)
  5. In the following command, use the value from step 4 to provide new_variable_value.

    db2set | grep DB2_DV_OVERRIDES; 
    db2set -im DB2_DV_OVERRIDES="new_variable_value";
    db2 flush package cache dynamic; 
    • To update the variable only for a single query, append the following directive to the query text.
      /*<OPTGUIDELINES><REGISTRY> <OPTION NAME='DB2_DV_OVERRIDES' VALUE='new variable value'/></REGISTRY></OPTGUIDELINES>*/

      For more information, see Optimization profiles and guidelines.

    • To update the variable globally, use the following method.
      db2set -im DB2_DV_OVERRIDES="new variable value";db2 flush package cache dynamic;
Note: This problem does not apply to IBM Db2 Database data sources.