1.DB2数据库表操作错误SQL0668N Operation not allowed for reason code "1" on table "XXXX". SQLSTATE=57016的解决方法

The table is in Check Pending state. The integrity of the table is not enforced and the content of the table may be invalid.

An operation on a parent table or an underlying table that is not in a check pending state may also receive this error if a dependent table is in a check pending state.

Execute the SET INTEGRITY statement with the IMMEDIATE CHECKED option on table table-name to bring the table out of the Check Pending state.

  www.2cto.com

For a user maintained materialized query table, execute the statement with the IMMEDIATE UNCHECKED option instead of the IMMEDIATE CHECKED option.:

 ERROR [57016] [IBM][DB2/AIX64] SQL0668N  Operation not allowed for reason code "1" on table "XXXX".  SQLSTATE=57016

可能有一行或多行违反了对数据定义的约

束。此表不能用于操作。若从属表处于检查暂挂状态,则对不处于检查暂挂

状态的父表的操作也可能接收到此错误。

用户响应: 执行带有 IMMEDIATE CHECKED 选项的 SET INTEGRITY

语句,并确保数据符合对该表或从属于它的表定义的所有约束。

set integrity for 表名immediate checked
 
2.对表进行任何操作都不被允许,提示SQLSTATE=57016 SQLCODE=-668 ,原因码 "7"的错误:SQL0668N Operation not allowed for reason code "7" on table XXX. 解决方法为:

执行命令:

  1. 执行 CALL SYSPROC.ADMIN_CMD('reorg table XXXXXXX')
  2. XXXXXXX'为表名

参考原文为:
Operation not allowed for reason code reason-code on table table-name.
Explanation: Access to table table-name is restricted. The cause is based on the following reason codes reason-code: 7
The table is in the reorg pending state. This can occur after an ALTER TABLE statement containing a REORG-recommended operation.7
Reorganize the table using the REORG TABLE command (note that INPLACE REORG TABLE is not allowed for a table that is in the reorg pending state).
其中:
reorg table <tablename> 通过重构行来消除“碎片”数据并压缩信息,对表进行重组。
runstats on table <tbschema>.<tbname> 收集表 <tbname> 的统计信息。
reorgchk on table all 确定是否需要对表进行重组,对于对所有表自动执行 runstats 很有用。
>>> reorg 和runstats 都是单个表优化,初始化的命令: 
runstats on table administrator.test;
reorg table administrator.test;

3.Operation not allowed for reason code "3" on table xxx
问题:
select count(*) from schema_name.table_name with ur;
: ERROR [57016] [IBM][DB2/LINUXX8664] SQL0668N  Operation not allowed for reason code "3" on table "schema_name.table_name".  SQLSTATE=57016

我刚才
Reorg table schema_name.table_name;
DB2 Database Error: ERROR [01H52] [IBM][DB2/LINUXX8664] SQL2216N  SQL error "-668" occurred while reorganizing a database table or its indexes.  SQLSTATE=01H52

1.重组表的时候不能进行任何操作

2.可以删除表重建
3.使用 load 命令,重启或者断开load pending状态,load..terminate,load..replace或load..restart解除暂挂状态

db2报错 Operation not allowed for reason的更多相关文章

  1. db2 报错 sqlcode=-420 自动类型转换的问题

    今天在测试遇到一个问题,前台点击页面查询数据时报错: , SQLSTATE, SQLERRMC=DECFLOAT, DRIVER=4.18.60 根据sqlcode查询错误原因为:-420 22018 ...

  2. db2报错: [DB2/NT] SQL0952N 由于中断,处理被取消 SQLSTATE=57014

    DB2被中断,报错:  [DB2/NT] SQL0952N 由于中断,处理被取消 SQLSTATE=57014 在DB2的开发过程中,今日运行了一个执行时间较为长的sql语句.使用DB2服务端的控制台 ...

  3. 使用npm install报错- operation not permitted解决

    原文:https://blog.csdn.net/weixin_41715295/article/details/79508104 这几天使用npm install时一直报错-4048 operati ...

  4. setfacl报错Operation not supported

    对文件目录setfacl权限设置时报错Operation not supported Google一下,发现是分区acl权限问题 一般情况下(ext4),默认acl支持都是加载的.但如果遇到二般情况, ...

  5. db2报错信息

    sqlcode sqlstate 说明000 00000 SQL语句成功完成01xxx SQL语句成功完成,但是有警告+012 01545 未限定的列名被解释为一个有相互关系的引用+098 01568 ...

  6. Namenode启动报错Operation category JOURNAL is not supported in state standby

    org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ipc.StandbyException): Operation category JO ...

  7. Mysql5.7创建存储过程中调用自定义函数报错Not allowed to return a result set from a function

    因为很多存储过程都会共用一段sql语句,所以我把共用的sql封装成一个自定义函数 AddCapital(); 然后通过存储过程调用,创建存储过程会报错1415,Not allowed to retur ...

  8. 解决kettle在两个mysql之间迁移数据时乱码的问题 和 相关报错 及参数调整, 速度优化

    1. 乱码问题 编辑目标数据库的链接: 配置编码参数即可. 2. 报错 No operations allowed after statement closed. 需要调整wait_timeout:  ...

  9. 关于本地使用antd的upload组件上传文件,ngnix报错405的问题

    使用阿里的ui框架antd的upload,会自动请求ngnix上面的一个路径,也就是action所在的位置,一直报错405 not allowed,后来经讨论,统一将action写成一个路径,后端对这 ...

随机推荐

  1. Centos6中Docker使用中国官方镜像加速

    vi /etc/sysconfig/docker 增加如下内容: other_args="--registry-mirror=https://registry.docker-cn.com&q ...

  2. C++ ifstream ofstream

    原文出自[比特网],转载请保留原文链接:http://soft.chinabyte.com/database/460/11433960.sh [导读] ofstream是从内存到硬盘,ifstream ...

  3. order by 导出数据不一致的问题

    转自 http://blog.csdn.net/wwwwei_csdn/article/details/78181197 前言   数据库分页是后台经常要使用的技术手段,有时候进行数据库查询会根据业务 ...

  4. [SDOI2018]原题识别

    题解: ..感觉挺烦得 而且我都没有注意到树随机这件事情.. 就写个30分的莫队.. #include <bits/stdc++.h> using namespace std; #defi ...

  5. (三)apache的安装与配置

    一.安装: 推荐使用cygwin自带的Setup.exe.带来的好处不言而喻,所有安装的程序都是经过测试的,这样确保你不会把宝贵的时间浪费来毫无意义的劳动上. 在安装程序中选择两个包就行了(分别是ap ...

  6. Codeforces 725E Too Much Money (看题解)

    Too Much Money 最关键的一点就是这个贪心可以在sqrt(n)级别算出答案. 因为最多有sqrt(n)个不同的数值加入. 我们可以发现最优肯定加入一个. 然后维护一个当前可以取的最大值, ...

  7. Codeforces round FF

    Problem A:水题,直接gan #include<bits/stdc++.h> using namespace std; ; int vis[N]; int main() { int ...

  8. jquery|js|jq常用正则

    var mobReg=/^1[34578]\d{9}$/; //手机号 if (!mobReg.test(mob)) { mui.alert("请填写正确手机号!"," ...

  9. Python argparse 模块

    Python argparse 模块 test.py: import argparse argparser = argparse.ArgumentParser(add_help=False) argp ...

  10. jenkins创建svn项目自动部署

    Exec command ; cd /home/zhxjdk18/server/jenkins_project/owgd_site/admin; rm -rf * ; source .bashrc ; ...