相关链接

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.

【DB2】How to resolve SQL20249N the statement was not processed with error的更多相关文章

  1. 【DB2】SQL0437W Performance for this complex query may be sub-optimal

    参考链接 Technote (troubleshooting) Problem(Abstract) Error [IBM][CLI Driver][DB2/6000] SQL0437W Perform ...

  2. 【DB2】表空间相关详细说明

    -.创建表空间 1.创建用户表空间 声明:在指定表空间创建路径的时候,需要指定空文件夹,非空文件夹会导致创建报错!!!如果文件夹不存在,那么在创建表空间的时候会自动创建文件夹! 1.1 创建SMS表空 ...

  3. 【DB2】国标行业分类存储,通过SQL查询出层级关系

    新建表 DROP TABLE Industry; CREATE TABLE Industry( IndustryCode VARCHAR(40),IndustryName VARCHAR(100),P ...

  4. 【DB2】SQL1585N 由于没有具有兼容页面大小的可用系统临时表空间,因此无法创建临时表。SQLSTATE=54048

    自己写了一段SQL,SQL中包含ORDER BY 字句,但是在执行的时候报错如下: 经过查询发现是由于临时表空间的PAGESIZE不够大,可考虑建16k或者32k PAGESIZE的表空间 示例如下: ...

  5. 【DB2】Event monitor for locking

    Customer said, they got the following Errors in applications logs Caused by: financing.tools.hub.sha ...

  6. 【DB2】慎用nickname,可能会引起效率较低

    在使用db2的时候,在A库建立了nickname,指向B库的物理表(数据量800多万),现在使用程序(JDBC)连接数据库,并计算指标,但是发现效率很低. 解决办法: 删除A库中的nickname,在 ...

  7. 【DB2】性能管理视图

    1.性能管理部分视图列表 可以使用命令db2 list tables for schema sysibmadm获取所有的性能管理视图 视图名称              模式名            ...

  8. 【DB2】表函数监控数据库

    1.快照表函数 在DB2 V9中能够使用SQL表函数捕获快照,以下是部分表函数列表: 快照表函数                           返回的信息 SNAPSHOT_DBM        ...

  9. 【DB2】delete大表不记录日志的正确操作

    一.原始方法 在删除大表的时候,经常会由于数据量太大,造成日志文件满了,接着无法删除数据. 以下是删除大表不记录日志的具体步骤: 1.临时设置自动提交关闭 (使用命令db2 list command ...

随机推荐

  1. hdu-1142(记忆化搜索+dij)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1142 思路:1.不是求最短路径,而是求如果两个点A,B直接相连,且A到终点的距离大于B到终点的距离,求 ...

  2. ansible-playbook api 2.0 运行项目

    上篇 api 的文章 <ansible-playbook api 2.0 直接运行> 介绍的是直接将 tasks 直接写在 代码中的,本文介绍 api 运行整个项目 [root@10_1_ ...

  3. MySQL性能调优与架构设计——第 14 章 可扩展性设计之数据切分

    第 14 章 可扩展性设计之数据切分 前言 通过 MySQL Replication 功能所实现的扩展总是会受到数据库大小的限制,一旦数据库过于庞大,尤其是当写入过于频繁,很难由一台主机支撑的时候,我 ...

  4. 反爬虫破解系列-汽车之家利用css样式替换文字破解方法

    网站: 汽车之家:http://club.autohome.com.cn/ 以论坛为例 反爬虫措施: 在论坛发布的贴子正文中随机抽取某几个字使用span标签代替,标签内容位空,但css样式显示为所代替 ...

  5. (线段树 区间合并更新)Tunnel Warfare --hdu --1540

    链接: http://acm.hdu.edu.cn/showproblem.php?pid=1540 http://acm.hust.edu.cn/vjudge/contest/view.action ...

  6. hdu1158 Employment Planning 2016-09-11 15:14 33人阅读 评论(0) 收藏

    Employment Planning Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  7. win7系统窗口背景颜色设置为护眼色的方法---打开的任意窗口显示为护眼色,程序眼必备

    win7系统窗口背景颜色设置为护眼色的方法 1. 打开"窗口颜色与外观"对话框 方法1:从控制面板开始 控制面板\外观和个性化\个性化\窗口颜色和外观 方法2:桌面上鼠标右键,个性 ...

  8. 使用WinSCP在Windows和Linux系统之间传输文件

    小梅哥编写,未经许可,严禁用于任何商业用途 2018年6月30日 在日常SoC开发中,我们经常需要在Windows和Linux系统之间传输文件,例如在Windows系统上的DS-5集成开发环境中编写好 ...

  9. Python3中map函数的问题

    在Python2中map函数会返回一个list列表,如代码: >>> def f(x, y): return (x, y) >>> l1 = [ 0, 1, 2, ...

  10. 企业计划体系的变迁:从ERP到APS再到SCP

    规划是供应链运作的大脑.几十年来,规划从MRP发展到到ERP到APS再到SCP,经历了从部分到全局,从静态到动态,从企业到供应链的发展历程.供应链的效率取决于规划.规划不到位,任何执行都是事后挽救. ...