db2iupgrade / db2ckupgrade failure due to SQL0551N

Troubleshooting

Problem

db2iupgrade or db2ckupgrade fail due to SQL0551 database authorization error.
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

Symptom

When db2iupgrade is executed, it will run db2ckupgrade to ensure each of the databases belonging to the DB2 instance can be upgraded. The example log is from v10.5 to v11.1 upgrade and confirms SAMPLE1 can be upgraded successfully, but it fails for SAMPLE2 so db2iupgrade fails.
db2iupgrade log
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".
Database: "SAMPLE2"
[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

The instance owner does not have EXECUTE authority. Normally instance owner does not have DBADM authority if it was not the original creator of the database. This often occurs when restoring database to another system with a different instance user id.
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

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.
  • ------------------------------------------------------------------------------------------
    如果你觉得文章有用,欢迎打赏

db2iupgrade / db2ckupgrade failure due to SQL0551N的更多相关文章

  1. 解决MySQL连接超时Communications link failure due to underlying exception

    最近在用一个MySQL的Java连接池的过程中,连接一晚上不释放,第二天就会造成超时的错误,查了一下原因,原来是因为MySQL默认的空闲等待时间是8个小时,一旦空闲超过8个小时,就会抛出异常.异常文本 ...

  2. SSH项目过一段时间之后再访问会报一次Could not open Hibernate session for transaction 异常,Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlyi,再重新方法即可访问成功(通常出现在过了一晚之后再去访问系统)

    前端时间到客户那去进行项目的上线测试,将项目部署好之后,运行都是正常的,可是每到了第二天早上访问的时候,就会报一个Could not open Hibernate session for transa ...

  3. Communications link failure due to underlying exception异常处理(转)

    最近的一个项目在Hibernate使用C3P0的连接池,数据库为Mysql.开发测试没有问题,在运行中每个一段长的空闲时间就出现异常: java 代码 org.hibernate.exception. ...

  4. 解决mysql连接异常—-com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception

    DBCP连接池连接MySql数据库时,一奇葩数据库设置为30秒内无请求自动断开.超时后链接无法关闭,活动链接数飞奔,最后挂掉. 网上找了一圈,一般是这三种,方法一pass,方法二测试无效可能设置错了吧 ...

  5. Communications link failure due to underlying exception: ** BEGIN NESTED EXC

    一是将 wait_timeout=31536000 interactive_timeout=31536000 将过期时间修改为1年. 二是在连接URL上添加参数:&autoReconnect= ...

  6. Communications link failure报错的处理

    一.报错的问题: 测试环境在做压力测试的时候爆出错误 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications l ...

  7. mysql交互式连接&非交互式连接

    交互式操作:通俗的说,就是你在你的本机上打开mysql的客户端,就是那个黑窗口,在黑窗口下进行各种sql操作,当然走的肯定是tcp协议. 非交互式操作:就是你在你的项目中进行程序调用.比如一边是tom ...

  8. Intel VT入门

    前言     传说中的VT貌似很神秘的样子,关于VT入门的资料又很少,于是研究了一番 由于资源有限,自身水平亦有限,并且是闭门造车之作,如有错误的地方请指正,不胜感激! 关于VT可以先参考海风月影写的 ...

  9. 【转载】Tomcat崩溃事件

    转载地址:http://www.blogjava.net/tedeyang/archive/2008/06/04/205740.html Tomcat崩溃事件 今天一大早产品一部项目经理就来找我,他们 ...

  10. 【转】c3p0详细配置

      官方文档 : http://www.mchange.com/projects/c3p0/index.html <c3p0-config><default-config>&l ...

随机推荐

  1. C++分别用顺序栈和链栈实现数制的转换相关代码

    //案例分析:将一个十进制数N转化为八进制数,在计算过程中,使得N模8得到八进制数的各个数依次进栈,//然后将八进制数依次输出,得到八进制数.#include<iostream>#incl ...

  2. 新的学习历程-python5 输入输出基础

    1 uname=input("please input username:") 2 print("welcome",uname) #print各项间默认以空格作 ...

  3. Docker - Can't resolve instance hostname.

    Docker容器无法解析主实例主机名 在为redis集群搭建哨兵的时候遇到这个异常 解决方案:在配置文件中添加: ALLOW_EMPTY_PASSWORD=yes 参考文档:linux - redis ...

  4. Mac的Dock栏是什么?Mac Dock栏使用技巧

    ​ Dock栏就是Mac电脑屏幕下方的那一排快捷键,我们可以把自己常用的程序放到Dock上面,这样可以帮助我们快速的打开自己想要打开的文件和程序,默认情况下,OS X 的 Dock 置于屏幕的底部.当 ...

  5. MeterSphere中dubbo接口测试分享

    一.域名解释 1.1.接口文档:UserAccountAssetServiceI.getUserAccountVirtualAsset UserAccountAssetServiceI(接口名,需要用 ...

  6. QT debug/moc_frmalarminfo.o:(.data.rel.ro._ZTV12FrmAlarmInfo[_ZTV12FrmAlarmInfo]+0x1c0): undefined reference to `non-virtual thunk to FrmAlarmInfo::~FrmAlarmInfo()'解决方法

    这个报错很具有迷惑性,,,我在网上还看见了ZTI12的报错,但是仔细一看发现是.o文件报错. 简单解释下.o文件(此解释来自百度): o 就是object, 也就相当于windows下编译的obj文件 ...

  7. 卸载K8s集群及k8s命令自动补全

    一.配置命令自动补全 yum install -y bash-completion source /usr/share/bash-completion/bash_completion source & ...

  8. linux磁盘读写速度测试

    磁盘读写速度标准 1.机械硬盘读写速度平均60---80M每秒. 2.固态硬盘不同品牌型号之间,平均大约在150---300M每秒. 3.5400转的笔记本硬盘:50-90MB每秒. 4.7200转的 ...

  9. vxWidgets(一):初识

    wxWidgets 和 QT 之间的选择 跨平台的C++ GUI工具库很多,可是应用广泛的也就那么几个,Qt.wxWidgets便是其中的翘楚这里把GTK+排除在外,以C实现面向对象,上手相当困难,而 ...

  10. PHP二维数组根据某个元素(key)排序

    /** * 二维数组根据key排序 * @param $arr * @param $arr_key * @param string $order 排序规则 * @return mixed */ fun ...