1.对于执行中的报错,可以在db2命令行下运行命令 : db2=>? SQLxxx 查看对应的报错原因及解决方法。

2.错误SQL0206N SQLSTATE=42703  检测到一个未定义的列、属性或参数名。
  SQL0206N  "SQL_COU_ALL" is not valid in the context where it is used.  SQLSTATE=42703
      db2 => ? "42703"    
      db2 => ? SQL0206N
   
3.错误SQL0668N code "7" SQLSTATE=57016   表处于pending state,需要重组该表。
  SQL0668N  Operation not allowed for reason code "7" on table "xxx.Z_BP_TMPBATCH_TB_HIS".  SQLSTATE=57016
     db2 => ? SQL0668N code 7  
     SQL0668N  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.
     User response:用户响应  
       7   Reorganize the table using the REORG TABLE command.
    For a table in the reorg pending state, note that the following clauses are not allowed when reorganizing the table:
    *  The INPLACE REORG TABLE clause
    *  The ON DATA PARTITION clause for a partitioned table when table has nonpartitioned indexes defined on the table

4.错误SQL20054N code="23" SQLSTATE=55019 对表的修改次数达到3次,必须重组表
  ALTER TABLE xxx.FM_BORRO ALTER COLUMN DOCUMENT_TYPE_1 SET NOT NULL
  报错:SQL20054N  The table "xxx.FM_BORROW" is in an invalid state for the operation. Reason code="23".  SQLSTATE=55019
  db2 => ? SQL20054N
    SQL20054N  The table "<table-name>" is in an invalid state for the operation. Reason code="<reason-code>".
  Explanation:
    The table is in a state that does not allow the operation. The "<reason-code>" indicates the state of the table that prevents the operation.
    23   The maximum number of REORG-recommended alters have been
         performed. Up to three REORG-recommended operations are allowed
         on a table before a reorg must be performed, to update the
         tables rows to match the current schema.
  User response:
    23        Reorg the table using the reorg table command.
    说明:当对表结构进行更改时,也可能导致表状态异常。比如,以下操作可能会导致表处于reorg-pending状态。
 (1)        alter table <tablename> alter <colname> set data type <new data type>
 (2)        alter table <tablename> alter <colname> set not null
 (3)        alter table <tablename> drop column <colname>
 (4)        ……   
 出现reorg pending的根源是当表结构变化后影响了数据行中的数据格式,这时需要对表做reorg。可能的错误号是:
 01.SQL0668N  Operation not allowed for reason code "7" on table "SDD.ST_INCRE008".  SQLSTATE=57016
 03.SQL20054N  The table "<table-name>" is in an invalid state for the operation. Reason code="7".
 复制代码每一个表在不进行重组(Reorg)的前提下,只允许进行3次结构上的修改。三次更改后必须对表进行重组。
 REORG TABLE "xx"."FM_BORROW" ALLOW NO ACCESS KEEPDICTIONARY;

5.报错 SQL0670N  SQLSTATE=54010 该表所有字段长度之和大于当前数据库页大小(8K)
  ALTER TABLE xxx.FAQ ALTER COLUMN FAQ_UNIT_NAME SET DATA TYPE VARCHAR(800)
  报错 SQL0670N  The row length of the table exceeded a limit of "8101" bytes. (Table space "SHJD_DATA".)  SQLSTATE=54010
  db2 => ? SQL0670N
    SQL0670N  The row length of the table exceeded a limit of "<length>" bytes. (Table space "<tablespace-name>".)
  Explanation:
    The row length of a table in the database manager cannot exceed:
 *  4005 bytes in a table space with a 4K page size
 *  8101 bytes in a table space with an 8K page size
 *  16293 bytes in a table space with an 16K page size
 *  32677 bytes in a table space with an 32K page size
    The length is calculated by adding the internal lengths of the columns.Details of internal column lengths can be found under CREATE TABLE in the SQL Reference.
  User response:
    指定页大小更大的表空间;消除表中的一列或多列

6.报错 SQL0190N  SQLSTATE=42837 不能改变该列,因为它的属性与当前的列属性不兼容
  ALTER TABLE xxx.BP_TMPDATA_1_TB_1903 ALTER COLUMN RATE SET DATA TYPE DECIMAL(6,4) 
  报错 SQL0190N  ALTER TABLE "BP_TMPDATA_1_TB_1903" specified attributes for column "RATE" that are not compatible with the existing column.  SQLSTATE=42837
  说明: BP_TMPDATA_1_TB_1903 现有数据的精度超过了 DECIMAL(6,4)  ,比如100.00

7.报错 SQL30081N SQLSTATE=08001   检测到通信错误  无法与应用程序服务器或其他服务器建立连接
  SQL30081N  A communication error has been detected. 
    Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS".  
    Location where the error was detected: "10.0.0.200".  Communication function detecting the error: "selectForConnectTimeout".  
    Protocol specific error code(s): "0", "*", "*".  SQLSTATE=08001
    检查服务器的配置情况如下:
      验证存在的DB2数据库
 db2 list db directory
 db2 list db directory show detail
      验证实例使用的通讯协议,查看DB2COMM变量
 db2set -all
      查看数据库管理器的配置,查看SVCENAME(特指tcpip协议)
 db2 get dbm cfg
      查看/etc/services中,有无与上面对应SVCENAME的端口,例如:
 db2cDB2 50000/tcp
      验证远程服务器实例配置
        db2 list node directory
        db2 list node directory show detail
      ping hostname来验证通讯
      使用telnet hostname port来验证是否能连到实例
      用DB2提供的PCT工具来检测一下

db2 执行报错收集的更多相关文章

  1. oracle创建包后执行报错:object omgmig.test_package is invalid.

    今天学习了一下oracle的包的写法,然后碰到这么个问题.包声明和包主体都正确,但是就是执行报错:object omgmig.test_package is invalid. 这是会报错的sql,看起 ...

  2. salt执行报错一例

    执行报错: 查看服务端日志: 认证有问题 重新认证吧!!! minion端: [root@super66 ~]# cd /etc/salt/[root@super66 salt]# lsminion ...

  3. Ubuntu下sh *.sh使用==操作符执行报错

    ----<鸟哥的Linux私房菜--基础篇>学习笔记 ubuntu默认的sh是连接到dash,而我们写shell脚本时使用的时bash.bash和dash在一些方面是不兼容的.因此执行同一 ...

  4. windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决

    windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决 一.发现问题 由于tomcat内存溢出,在wind ...

  5. apscheduler 执行报错No handlers could be found for logger "apscheduler.executors.default

    执行报错如下: No handlers could be found for logger "apscheduler.executors.default 解决: 加入日志,查看具体报错,载根 ...

  6. SQL server 维护计划中 “清除维护任务” 执行报错

    SQL server 维护计划中 “清除维护任务” 执行报错,错误如下: 执行查询“EXECUTE master.dbo.xp_delete_file 0,N'',N'',N'2019...”失败,错 ...

  7. scala的trait执行报错: 错误: 找不到或无法加载主类 cn.itcast.scala.`trait`

    scala的trait执行报错: 错误: 找不到或无法加载主类 cn.itcast.scala.`trait`.Children 原因:包名写成了trait,与trait关键字重名了: package ...

  8. hadoop执行 报错

    Error: java.io.IOException: Initialization of all the collectors failed. Error in last collector was ...

  9. DB2 57016报错的解决办法(表状态不正常,导致表无法操作)

    新建了一张表,删除了一列,然后执行insert的时候,报错 57016,解释为:因为表不活动. 1.执行db2 "load query table <tabname>" ...

随机推荐

  1. zookeeper 学习 zookeeper下载部署

    下载 http://mirror.bit.edu.cn/apache/zookeeper/ 校验 解压后得到zookeeper-3.4.10.jar,使用md5sum zookeeper-3.4.10 ...

  2. Spring Boot JPA的Column Table 注解命名字段无效

    @Table(name = "OrderInfo") @Entity public class OrderInfo { @Id @GeneratedValue private Lo ...

  3. hihocoder 前两题思路

    1800 : 玩具设计师 二维前缀和的写法有很多,最常见的是s[x-1][y]+s[x][y-1]-s[x-1][y-1]+a[x][y]; 涉及二维矩阵求和,联想前缀和,求>=指定面积的最大耐 ...

  4. 自建yum仓库yum源

    目的:搭建自己的yum源主要是解决大批量服务器下载更新人互联网带宽占用问题及速度问题以及不能访问的问题. 服务端:  步骤如下: 一.创建一个目录,就是我们yum软件存放的目录 [root@vicwe ...

  5. json 解析代码 全语言

    Javascript: 1.使用eval var parse_json_by_eval = function(str){ return eval('('+str+')'); } var value = ...

  6. python全栈开发day73-Django认证系统

    一.Form组件 day73 2018-08-10 1. 内容回顾 1. form表单组件 1. 常用字段 1. CharField() 2. ChoiceField() 2. 参数或配置 1. la ...

  7. day11 装饰器---函数的使用方法

    这个是一个难点,以后面试会经常出现的,要搞懂! 装饰器升级版,进阶内容1: def outer(flag): def wrapper(func): def inner(*args,**kwargs): ...

  8. HDU 5592 ZYB's Game 【树状数组】+【二分】

    <题目链接> 题目大意: 给你一个由1~n,n个数组成的序列,给出他们每个的前缀逆序数,现在要求输出这个序列. 解题分析: 由前缀逆序数很容易能够得到每个数的逆序数.假设当前数是i,它前面 ...

  9. POJ 2631 Roads in the North (模板题)(树的直径)

    <题目链接> 题目大意:求一颗带权树上任意两点的最远路径长度. 解题分析: 裸的树的直径,可由树形DP和DFS.BFS求解,下面介绍的是BFS解法. 在树上跑两遍BFS即可,第一遍BFS以 ...

  10. ECMAScript6 入门 Module

    目的:将大程序拆分成互相依赖的小模块文件.CommonJS 和 AMD 两种,前者用于服务器,后者用于浏览器.他俩都是运行时才确定 :ES6 模块的设计思想是尽量的静态化,使得编译时就能确定模块的依赖 ...