db2iupgrade / db2ckupgrade failure due to SQL0551N
db2iupgrade / db2ckupgrade failure due to SQL0551N
Troubleshooting
Problem
Symptom
Version of DB2CKUPGRADE being run: VERSION "11.1"
Database: "SAMPLE1"
DBT5542I The db2ckupgrade utility has successfully put the database in upgrade pending state.
DBT5537I The db2ckupgrade utility has completed processing for database "SAMPLE1".
[IBM][CLI Driver][DB2/AIX64] SQL0551N The statement failed because the authorization ID does not have the required authorization or privilege to perform the operation. Authorization ID: "DB2INST2". Operation: "EXECUTE". Object: "SYSPROC.ENV_GET_REG_VARIABLES". SQLSTATE=42501
Cause
Resolving The Problem
In this example we grant DBADM to instance owner since there may be other routines (stored procedures / user defined functions) which require EXECUTE or DBADM authority. The alternative is to issue "GRANT EXECUTE ON ... TO USER DB2INST2" from a user with DBADM authority then re-issue db2iupgrade or db2ckupgrade to see if SQL0551 is returned for a different routine.
db2 "connect to SAMPLE2"
db2 "select grantor, grantee, dbadmauth from syscat.dbauth"
db2 "connect reset"
This will show the user id which has DBADM authority in the GRANTEE column.
Then login as user id with dbadm authority to grant instance id "DB2INST2"
db2 "connect to SAMPLE2 user <DBADM userid>"
db2 "grant dbadm on database to user DB2INST2"
db2 "connect reset"
Then see if SQL0551 has been resolved.
<New version being upgraded to>/bin/db2ckupgrade SAMPLE2
Notes- Always run db2ckupgrade from the version to be upgraded to. For example when upgrading from v10.5 to v11.5, run db2ckupgrade from v11.5 installation directory.
- Ensure root account running db2iupgrade is not sourcing environment variables like $PATH, $LIBPATH (AIX), $LD_LIBRARY_PATH (Linux) from <DB2 instance>/sqllib/db2profile. In some cases, users do this so that root user can start, stop DB2 instance. But this will cause problems with db2iupgrade, since the environment variables will point to old version of DB2 instead of new version.
-
------------------------------------------------------------------------------------------
如果你觉得文章有用,欢迎打赏
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
2022-02-23 每天一条DB2命令-035