问题描述:
--------
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