IBM Support

Error SQL20249N The statement was not processed because the package named "NULLID.SQLC2K26" needs to be explicitly rebound.

Troubleshooting


Problem

In this scenario you perform a restore of a database from a backup image. When the restore completes you receive the error SQL20249N running commands on the database.

Symptom

You are restoring from a database backup image with a higher Fix Pack number than the instance it is being restored to, as shown by the example db2diag.log below.


2017-04-21-12.50.46.077587-240 I235453E572           LEVEL: Severe


PID     : 15273                TID : 46914280089920  PROC : db2sysc
INSTANCE: db2inst1             NODE : 000            DB   : SAMPLE
APPHDL  : 0-10                 APPID: *LOCAL.db2inst1.170421085044
AUTHID  : DB2INST1             HOSTNAME: testserver
EDUID   : 582                  EDUNAME: db2agent (SAMPLE)
FUNCTION: DB2 UDB, catalog services, sqlrlGetVersionTimes, probe:180
MESSAGE : Database release: 10050700 ==> Database is now moved back to the
          current DB2 release level of 10050600

When running the query below...

db2 "select varchar(pkgschema,16),varchar(pkgname,16),valid from syscat.packages where pkgschema='NULLID' and pkgname='SQLUAK20'"

You receive the error below...

SQL20249N  The statement was not processed because the package named "NULLID.SQLC2K26" needs to be explicitly rebound.

Cause

Downgrade of database to a lower Fix Pack through a restore causes packages to become invalid. Packages in a later Fix Pack may have certain differences from those in a previous Fix Pack, so if a database is downgraded, the packages are initially set as invalid, forcing the need for those invalid packages to go through the "rebind" action.

Diagnosing The Problem

Check the db2diag.log after the restore to see there is an entry like the one above shown in the Symptom.

After a restore you would see error SQL20249N when trying to run commands on the database.

(See example in Symptom).

Resolving The Problem

Explicitly rebind packages by performing the below commands.


db2 connect to SAMPLE

db2 -x "select 'REBIND PACKAGE ' || rtrim(pkgschema) || '.' || rtrim(pkgname) || ';' as command from syscat.packages" > rebind.sql

db2 -tvf rebind.sql


And then try the command.

db2 " select pkgschema,pkgname,valid from syscat.packages where pkgschema='NULLID' and pkgname='SQLUAK20' "

The query should work without error SQL20249N.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Recovery - Restore","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.8;9.7;10.1;10.5;11.1","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server;Express;Express-C;Personal;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg22002381