DB2 import报错:SQL0572N Package "NULLID.SQLUAK20" is inoperative. SQLSTATE=51028

博客围绕DB2使用应用用户import数据时出现SQL0572N报错展开。分析原因是db2updv105使部分package失效,且数据库参数AUTO_REVAL为DISABLED。给出临时和永久解决方法,还重现了问题,展示了不同用户操作下的结果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题描述:
--------
DB2, 使用应用用户import数据时报错:
SQL0572N  Package "NULLID.SQLUAK20" is inoperative.  SQLSTATE=51028


原因分析:
---------
db2updv105会使一些package失效,如果数据库参数AUTO_REVAL为DISABLED,那么就可能遇到这个问题(从旧版本9.5升级上来的库,默认是DISABLED).


解决方法:
---------
临时方法:   db2 connect to <dbname> && db2 rebind package NULLID.SQLUAK20
永久方法:   将数据库参数AUTO_REVAL修改为immediate(需要重新激活数据库生效)


问题重现:
---------
找了一个AUTO_REVAL为DISABLED数据库, 使用实例用户执行了db2updv105之后,应用用户就无法import了:

node01:/home/inst105$db2pd -d sample -dbcfg | grep AUTO_REVAL
AUTO_REVAL                     DISABLED             DISABLED   

使用应用用户appuser进行import操作没有问题:

node01:/home/inst105$db2 connect to sample user appuser       
Enter current password for appuser: 

   Database Connection Information

 Database server        = DB2/AIX64 10.5.5
 SQL authorization ID   = appuser
 Local database alias   = sample

node01:/home/inst105$db2 "create table t1(col1 char(10), col2 char(10))"
DB20000I  The SQL command completed successfully.

node01:/home/inst105$db2 "import from t1.del of del insert into t1"         
SQL3109N  The utility is beginning to load data from file "t1.del".

SQL3125W  The character data in row "1" and column "1" was truncated because 
the data is longer than the target database column.

SQL3125W  The character data in row "1" and column "2" was truncated because 
the data is longer than the target database column.

SQL3110N  The utility has completed processing.  "1" rows were read from the 
input file.

SQL3221W  ...Begin COMMIT WORK. Input Record Count = "1".

SQL3222W  ...COMMIT of any database changes was successful.

SQL3149N  "1" rows were processed from the input file.  "1" rows were 
successfully inserted into the table.  "0" rows were rejected.


Number of rows read         = 1
Number of rows skipped      = 0
Number of rows inserted     = 1
Number of rows updated      = 0
Number of rows rejected     = 0
Number of rows committed    = 1

node01:/home/inst105$db2 terminate
DB20000I  The TERMINATE command completed successfully.

使用实例用户inst105进行db2updv105了操作:

node01:/home/inst105$whoami
inst105
node01:/home/inst105$db2updv105 -d sample 


_________________________________________________________________________     
                                                                              
                    _____   DB2 Service Tools   _____                         
                                                                              
                            I      B      M                                   
                                                                              
                               db2updv105                                      
                                                                              
   This tool is a service utility designed to update a DB2 Version 10.5       
   database to the current fix pack level.                                    
                                                                              
_________________________________________________________________________     


DB2 Universal Database Version 10.5, 5622-044 (c) Copyright IBM Corp. 2012
Licensed Material - Program Property of IBM
IBM DATABASE 2 Database update to current fix pack tool

db2updv105 completed successfully for database 'sample'. 

node01:/home/inst105$db2rbind sample -l rbind.log

 Rebind done successfully for database 'sample'.

node01:/home/inst105$db2 +o connect to sample
node01:/home/inst105$db2 rebind NULLID.SQLC2K26
DB20000I  The REBIND PACKAGE command completed successfully.
node01:/home/inst105$db2 +o terminate

再次使用应用用户appuser进行import操作,报错:

node01:/home/inst105$db2 connect to sample user appuser       
Enter current password for appuser: 

   Database Connection Information

 Database server        = DB2/AIX64 10.5.5
 SQL authorization ID   = appuser
 Local database alias   = sample

node01:/home/inst105$db2 "import from t1.del of del insert into t1"        
SQL0572N  Package "NULLID.SQLUAK20" is inoperative.  SQLSTATE=51028

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值