zoukankan      html  css  js  c++  java
  • 【DB2】How to resolve SQL20249N the statement was not processed with error

    相关链接

    https://vinaysdb2blog.blogspot.com/2017/11/how-to-resolve-sql20249n-statement-was-not-processed-error.html

    转载

    https://www-01.ibm.com/support/docview.wss?uid=swg22002381

    Technote (troubleshooting)

    Problem(Abstract)

    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 rebind <package name> RESOLVE CONSERVATIVE

    or

    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.

  • 相关阅读:
    零基础学python-2.15 回到我们的游戏 加入for以及列表
    零基础学python-2.14 for循环语句
    零基础学python-在3.x版本之后的print()不换行
    零基础学python-2.13 回到我们的游戏 加入循环
    CSV文件读取
    jmeter 测试webservice协议soap接口
    jmeter-plugins-manager.jar插件安装
    JDBC协议(jmeter链接mysql)
    xftp连接centos7
    xshell连接centos7
  • 原文地址:https://www.cnblogs.com/DBA-Ivan/p/10073432.html
Copyright © 2011-2022 走看看