Db2- SQL Error -805 Resolution

The following four SQL  queries will give an idea for resolution for -805 error:

Query 1: Display the DBRMs in the member list for the plan.

SELECT PLCREATOR, PLNAME, NAME, VERSIONFROM SYSIBM.SYSDBRMWHERE PLNAME = 'plan-name';

If no rows are returned, then the plan was bound without a member list.

Query 2: Display the entries in the package list for the plan.

SELECT LOCATION, COLLID, NAMEFROM SYSIBM.SYSPACKLISTWHERE PLANNAME = 'plan-name';

If no rows are returned, then the plan was bound without a package list.

SQL error code -805 solution
Image courtesy|Stockphotos.io

Query 3: Display the CURRENTSERVER value specified on the BIND subcommand for the plan.

SELECT NAME, CURRENTSERVERFROM SYSIBM.SYSPLANWHERE NAME = 'plan-name';

Query 4: Determine if there is a matching package in SYSPACKAGE

If the package is remote, put the location name in the FROM clause.

If the collection-id value in the message is blank, use this version of the query:

SELECT COLLID, NAME, HEX(CONTOKEN), VERSIONFROM location-name.SYSIBM.SYSPACKAGE
WHERE NAME = 'dbrm-name'AND HEX(CONTOKEN) = 'consistency-token';
Oracle to db2
Oracle to db2

If the collection-id value in the message is not blank, use this version of the query:

SELECT COLLID, NAME, HEX(CONTOKEN), VERSIONFROM location-name.SYSIBM.SYSPACKAGE
WHERE NAME = 'dbrm-name'AND HEX(CONTOKEN) = 'consistency-token';AND COLLID = 'collection-id';

If no rows are returned, the correct version of the package was not bound.

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.