IBM Support

An error message (SQLCODE: -4498; SQLSTATE: 08506) is shown for plan hints that use materialized query tables. (DB2 Version 8 new-function mode)

Troubleshooting


Problem

For queries that run in DB2 for z/OS Version 8, the following errors are encountered when creating a plan hint that uses materialized query tables. 1) SQLCODE: -4498; SQLSTATE: 08506. Resolve this error by performing the actions that are specified for the SQLCODE in the reference information about SQL codes. 2) A dump is generated.

Symptom

This problem occurs in the following situation:

1. Create a project in Query Tuner 2.2.
2. Issue a query that can be rewritten to use materialized query tables. For example:

SELECT * FROM (SELECT L_ORDERKEY, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) FROM LINEITEM GROUP BY L_ORDERKEY) AS Z,ORDER WHERE Z.L_ORDERKEY = O_ORDERKEY

The optimizer rewrites the query to use materialized query tables:

SELECT *
FROM SYSADM.LITEM_M2, SYSADM.ORDER
WHERE SYSADM.LITEM_M2.M_ORDERKEY = SYSADM.ORDER.O_ORDERKEY

3. Run EXPLAIN for the query with CURRENT REFRESH AGE ANY and CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION ALL.
4. Create a hint based on the generated access plan for the rewritten query from step 3.
5. Validate the hint without any hint customization. The following errors are encountered during the hint validation:

1) SQLCODE: -4498; SQLSTATE: 08506. Resolve this error by performing the actions that are specified for the SQLCODE in the reference information about SQL codes.
2) A dump is produced.

Cause

This is a DB2 for z/OS bug.

Resolving The Problem

Waiting for engine side fix.

[{"Product":{"code":"SSNL9G","label":"Optim Query Tuner Client"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"2.2.0","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
16 June 2018

UID

swg21389544