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. [转] babel入门基础

    背景 babel的官网说babel是下一代的js语法编译器,现在自己也在很多项目中使用了babel,可是自己对babel的认识呢,只停留在从google和别人项目中copy的配置代码上,内心感到很不安 ...

  2. (转载)dotnet core 中文乱码 codepages

    引子 转载自:http://www.jianshu.com/p/1c9c59c5749a 参考:.Net Core 控制台输出中文乱码 上文中我查阅了一些cli的源码, 闲来无事就继续翻代码, 冥冥之 ...

  3. SQLServer中处理亿万级别的数据

    在SQLServer中处理亿万级别的数据(历史数据),可以按以下方面进行: 去掉表的所有索引 用SqlBulkCopy进行插入 分表或者分区,减少每个表的数据总量 在某个表完全写完之后再建立索引 正确 ...

  4. Filebeat6.31整合Kafka集群消息队列(三)

    wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.3.2-linux-x86_64.tar.gz [root@ ...

  5. vue-cli 部分浏览器不支持es6的语法-babel-polyfill的引用和使用

    npm install --save-dev babel-polyfill babel-polyfill用正确的姿势安装之后,引用方式有三种: 1.require("babel-polyfi ...

  6. PHP把采集抓取网页的html中的的&nbsp;去掉或者分割成数组

    日期:2017/11/6 操作系统:windows 今天抓取网页的时候出现 无法替换,经过多次测试,找到了办法;(注意是从网页上抓取到的) 分割 explode("  ",HTML ...

  7. NOI2018Day2T1 屠龙勇士 set 扩展欧几里德 中国剩余定理

    原文链接https://www.cnblogs.com/zhouzhendong/p/NOI2018Day2T1.html 题目传送门 - 洛谷P4774 题意 题解 首先我们仔细看一看样例可以发现如 ...

  8. LeetCode竞赛题:笨阶乘(我们设计了一个笨阶乘 clumsy:在整数的递减序列中,我们以一个固定顺序的操作符序列来依次替换原有的乘法操作符:乘法(*),除法(/),加法(+)和减法(-)。)

    通常,正整数 n 的阶乘是所有小于或等于 n 的正整数的乘积.例如,factorial(10) = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1.相反,我们设计了一个笨 ...

  9. 20165235 2018-3 《Java程序设计》第5周学习总结

    20165235 2018-3 <Java程序设计>第5周学习总结 教材学习内容总结 第六章 内部类与异常类 (一)内部类:1.java支持在一个类中定义另一个类,这个类叫内部类.2.内部 ...

  10. mysql 分区 1526错误

    mysql 分区 原文:http://fyzjhh.blog.163.com/blog/static/1694442262012544429953/ 参考:https://bugs.mysql.com ...