DB2错误代码对照表
- 格式:xls
- 大小:75.00 KB
- 文档页数:24
数据库db2错误代码⼤全sqlcode sqlstate 说明000 00000 SQL语句成功完成01xxx SQL语句成功完成,但是有警告+012 01545 未限定的列名被解释为⼀个有相互关系的引⽤+098 01568 动态SQL语句⽤分号结束+100 02000 没有找到满⾜SQL语句的⾏+110 01561 ⽤DATA CAPTURE定义的表的更新操作不能发送到原来的⼦系统+111 01590 为2型索引设置了SUBPAGES语句+117 01525 要插⼊的值的个数不等于被插⼊表的列数+162 01514 指定的表空间被置为检查挂起状态+203 01552 使⽤⾮唯⼀的名字来解决命名的限定列+204 01532 命名的对象未在DB2中定义+206 01533 命名的列不在SQL语句中指定的任何表中存在+218 01537 因为SQL语句引⽤⼀个远程对象,不能为该SQL语句执⾏EXPLAIN+219 01532 命名的PLAN TABLE不存在+220 01546 不正确定义PLAN TABLE,检查命名列的定义+236 01005 SQLDA中的SQLN的值⾄少应于所描述的列的个数⼀样⼤+237 01594 ⾄少有⼀个被描述的列应该是单值类型,因此扩展的SQLVAR条⽬需要另外的空间+238 01005 ⾄少应有⼀个被描述的列是⼀个LOB,因此扩展的SQLVAR条⽬需要另外的空间+239 01005 ⾄少应有⼀个被描述的列应是单值类型,因此扩展的SQLVAR条⽬需要另外的空间+304 01515 该值不能被分配给宿主变量,因为该值不再数据类型的范围之内+331 01520 不能被翻译的字符串,因此被设置为NULL+339 01569 由于与DB2 2.2版本的⼦系统连接,所以可能存在字符转换问题+394 01629 使⽤优化提⽰来选择访问路径+395 01628 设置了⽆效的优化提⽰,原因代码指定了为什么,忽略优化提⽰+402 01521 未知的位置+403 01522 本地不存在CREAT ALIAS对象+434 01608 在DB2未来发布的版本中将不⽀持指定的特性,IBM建议你停⽌使⽤这些特性+445 01004 值被CAST函数截取+462 01Hxx 由⽤户定义的函数或存储过程发出的警告+464 01609 命名的存储过程超出了它可能返回的查询结果集的个数限制+466 01610 指定由命名的存储过程返回的查询结果集的个数。
sqlcode sqlstate错误信息000 00000SQL语句成功完成01xxx SQL语句成功完成,然则有警告+012 01545未限制的列名被申明为一个有彼此关系的引用+098 01568动态SQL语句用分号停止+100 02000没有找到满足SQL语句的行+110 01561用DATA CAPTURE定义的表的更新操纵不克不及发送到本来的子体系+111 01590为2型索引设置了SUBPAGES语句+117 01525要插入的值的个数不便是被插入表的列数+162 01514指定的表空间被置为搜检挂起状况+203 01552应用非独一的名字来解决定名的限制列+204 01532定名的对象未在DB2中定义+206 01533定名的列不在SQL语句中指定的任何表中存在+218 01537因为SQL语句引用一个长途对象,不克不及为该SQL语句履行EXPLAIN+219 01532定名的PLAN TABLE不存在+220 01546不正断定义PLAN TABLE,搜检定名列的定义+236 01005SQLDA中的SQLN的值至少应于所描述的列的个数一样大+237 01594至少有一个被描述的列应当是单值类型,是以扩大的SQLVAR条目须要别的的+238 01005至少应有一个被描述的列是一个LOB,是以扩大的SQLVAR条目须要别的的空+239 01005至少应有一个被描述的列应是单值类型,是以扩大的SQLVAR条目须要别的的+304 01515该值不克不及被分派给宿主变量,因为该值不再数据类型的局限之内+331 01520不克不及被翻译的字符串,是以被设置为NULL+339 01569因为与DB2 2.2版本的子体系连接,所以可能存在字符转换题目+394 01629应用优化提示来选择接见路径+395 01628设置了无效的优化提示,原因代码指定了为什么,忽视优化提示+402 01521未知的地位+403 01522本地不存在CREAT ALIAS对象+434 01608在DB2将来公布的版本中将不支撑指定的特点,IBM建议你停止应用这些特点+445 01004值被CAST函数截取+462 01Hxx由用户定义的函数或存储过程发出的警告+464 01609定名的存储过程超出了它可能返回的查询成果集的个数限制+466 01610指定由定名的存储过程返回的查询成果集的个数。
1.还原数据库之后,客户端无法和服务器主机连接,SQL30081N 检测到通信错误。
正在使用的通信协议:"TCP/IP"。
正在使用的通信API:"SOCKETS"。
检测到错误的位置:"192.168.247.120"。
检测到错误的通信功能:"connect"。
特定于协议的错误代码:"10061"、"*" 和 "*"。
SQLSTATE=08001a.最可能是数据库没启动。
b.可能还原之后端口设置缺失的原因。
肯定和db2 dbm的svcename服务有关。
>>db2 get dbm cfg|grep SVCENAMETCP/IP Service name (SVCENAME) =SSL service name (SSL_SVCENAME)=这里TCP/IP端口设置时缺失了。
需要手动设置。
>>db2set DB2COMM=TCP/IP,NETBIOS设置通信方式>>db2set>>db2 update dbm cfg for tsbdw using svcename 50000DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed successfully更新通信端口>>db2stop>>db2start>>db2 get dbm cfg |grep SVCENAMETCP/IP Service name (SVCENAME) = 50000SSL service name (SSL_SVCENAME) =重连数据库即可成功2.在忘记关闭数据库的情况下重启的服务器会导致实例挂起,数据库起不起来无法执行DB2的各种命令报错SQL6036N START or STOP DATABASE MANAGER command is already in progress.Kill alldb2_kill + ipclean to recycle the instancenote:kill db2 process force。
DB2错误码及信息•0This is a successful run.•-60The length or scale is not valid.•-84The SQL statement cannot be executed.•-102The literal string is too long. The maximum allowable size is size. The string begins with string.•-104token is an incorrect token.•-107The name, name is too long. The maximum allowable size is size.•-109clause clause is not permitted.•-112The operand of a column function is another column function.•-113There is an incorrect character in: string, reason code nnn.The number of insert columns must match the number of insert values.•-119A column that was identified in a HAVING clause must beincluded in the GROUP BY clause.•-120A WHERE clause or SET clause includes an aggregate columnfunction.•-121An INSERT or UPDATE statement references a column for update multiple times.•-122The SELECT statement with a no GROUP BY clause contains a column name and a column function in the SELECT clause, ora column name is contained in the select clause, but not inthe GROUP BY clause.•-125An integer in the ORDER BY clause must identify a column of the result.The SELECT statement contains both an ORDER BY clause and an UPDATE clause.•-127The DISTINCT qualifier is specified more than once in a subselect.•-129There are too many tables referenced in a single query.•-134There is an improper use of the LONG STRING COLUMN or a host variable of a MAXIMUM LENGTH greater than 254. •-138The SUBSTRING argument is not valid.•-150An INSERT, UPDATE, or DELETE statement was issued on a view.•-151An UPDATE was issued on a non-updateable column.•-153A CREATE VIEW statement must have a column-name list. •-156The target of a MAP INDEX statement must be a table.The column list for view is not valid.•-170The number of arguments is not valid.•-171The function argument is not valid.•-181The string representation of a DATETIME value is not valid.•-182An arithmetic expression with a DATETIME value is not valid.•-183An arithmetic operation on a DATE or TIMESTAMP value produced a value that is out of the range of the valid dates.•-185The LOCAL date and time format is not supported.•-199The keyword, keyword is not valid.•-203A reference to a column name is ambiguous.•-204The name is an undefined name.The column, column-name is not a column in the table, table-name.•-206The column-name must be a column in an inserted table, updated table, or any table that is identified in a FROM clause.•-208A column that is not valid is included in the ORDER BYclause.•-300The host variable is not null terminated.•-301The input-host variable type is not valid.•-302The host variable is not valid or too large for the target column.•-303The output-host variable type is not valid.•-304Conversion of SQL data type would result in truncated value.An output-indicator variable was not given.•-312CREATE VIEW statement contains parameter markers or host variables.•-313The number of host variables is incorrect.•-338The ON clause for a table join is not valid.•-401The operands of an arithmetic or comparison operation are not comparable.•-402An expression in a select list contains operands that are not compatible.•-405The numeric literal is out of range.•-407An UPDATE or INSERT value is NULL, and the target column is defined as NOT NULL.An UPDATE or INSERT value is not compatible with the data type of the target column.•-412The SELECT CLAUSE of a subquery specifies multiple columns.•-415The corresponding columns in each table of a UNION do not have the compatible data types.•-416There is an operand of a UNION that contains a long SQL column.•-419The decimal-divide operation is not valid.•-420There is an incorrect decimal string.•-421The operands of a UNION do not have the same number of result columns.•-444The stored procedure failed to load.The stored procedure definition includes one or more OUTPUT parameters for which no host variable was passed. •-501The cursor that is identified in a FETCH or CLOSE statement is not open.•-502The cursor that is identified in an OPEN statement is already open.•-504The cursor name is not defined.•-514The cursor is not in a prepared state.•-516The DESCRIBE statement does not identify a PREPARED statement.•-517The statement that is named in the declaration for the cursor must be a SELECT statement.•-518The statement is not prepared.The PREPARE statement identifies the SELECT statement of the opened cursor.•-530The foreign key was incorrect. The insert positioning failed on a multi-record mapped table.•-537The primary key clause identifies the column, column-name more than once.•-542The column-name cannot be a column of a primary key because it can contain null values.•-551Privileges are necessary to run the SQL statement.•-601The name of the object to be created cannot be identical to the existing name.•-602The CREATE INDEX statement specifies too many columns (number is the maximum).A data type definition specifies an incorrect length, precision,or scale attribute for column-name.•-607An INSERT, UPDATE, or DELETE statement was issued on a non-updateable table.•-612A duplicate column name is specified.•-637Duplicate keyword. keyword.•-638The table, table, cannot be created because a column definition is missing.•-644An incorrect value, value, is specified for the keyword or clause, keyword-or-clause in the statement, stmt-type.•-681An error occurred while a column in a field procedure was being encoded or decoded.•-682The program cannot load the field procedure.The SQL statement caused a data exception error.•-803Duplicate keys were detected on table table-name.•-804The input SQLDA is incorrect.•-811The results of a subselect produced more than one row. •-817An update is prohibited. A two-phase-commit situation or a catalog update statement (DDL) was issued while another connector transaction was incomplete.•-870The number of host variables is incorrect.•-904An unavailable resource prevented the SQL statement from running.•-922Authorization for the connection failed.•-4901The cursor limit was exceeded.The memory limit was exceeded.•-4903The SQL statement is unsupported.•-4904The SQL function or expression is not supported.•-4905An internal processing error occurred.•-4906The conversion is not valid.•-4907An internal catalog error occurred while reading or updating the system catalog.•-4908The mapped data is not valid.•-4909A DDLEX mapping error occurred.•-4910An error occurred during a connector update that required a backout of the current transaction.•-4911The statement processing was cancelled.。
db2报错Operationnotallowedforreason1.表操作错误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.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可能有⼀⾏或多⾏违反了对数据定义的约束。
【数据库】:关于DB2数据库错误提⽰说明SQLSTATE 消息本节列⽰ SQLSTATE 及其含义。
SQLSTATE 是按类代码进⾏分组的;对于⼦代码,请参阅相应的表。
表 2. SQLSTATE 类代码类代码含义要获得⼦代码,参阅...00 完全成功完成表 301 警告表 402 ⽆数据表 507 动态 SQL 错误表 608 连接异常表 709 触发操作异常表 80A 功能部件不受⽀持表 90D ⽬标类型规范⽆效表 100F ⽆效标记表 110K RESIGNAL 语句⽆效表 1220 找不到 CASE 语句的条件表 1321 基数违例表 1422 数据异常表 1523 约束违例表 1624 ⽆效游标状态表 1725 ⽆效事务状态表 1826 ⽆效 SQL 语句标识表 1928 ⽆效权限规范表 212D ⽆效事务终⽌表 222E ⽆效连接名表 2334 ⽆效游标名表 2436 游标灵敏度异常表 2538 外部函数异常表 2639 外部函数调⽤异常表 273B SAVEPOINT ⽆效表 2840 事务回滚表 2942 语法错误或存取规则违例表 3044 WITH CHECK OPTION 违例表 3146 Java DDL 表 3251 ⽆效应⽤程序状态表 3353 ⽆效操作数或不⼀致的规范表 3454 超出 SQL 限制,或超出产品限制表 3555 对象不处于先决条件状态表 3656 其它 SQL 或产品错误表 3757 资源不可⽤或操作员⼲预表 3858 系统错误表 39类代码 00 完全成功完成表 3. 类代码 00:完全成功完成SQLSTATE 值含义00000 操作执⾏成功,并且未产⽣任何类型的警告或异常情况。
类代码 01 警告表 4. 类代码 01:警告SQLSTATE 值含义01002 发⽣ DISCONNECT 错误。
01003 从列函数的⾃变量消去 NULL 值。
01004 字符串值在指定给具有较短长度的另⼀字符串数据类型时被截断。
db2连接报错connect。
ERRORCODE=-4499,SQLSTATE=08001(转载)在使⽤data studio连接远程DB2数据库时报错如下:[jcc][Thread:main][SQLException@5b775b77] java.sql.SQLException[jcc][Thread:main][SQLException@5b775b77] SQL state = 08001[jcc][Thread:main][SQLException@5b775b77] Error code = -4499[jcc][Thread:main][SQLException@5b775b77] Message = [jcc][t4][2043][11550][4.13.111] 异常 .ConnectException:打开端⼝50,000 上服务器 192.168.1.107/192.168.1.107 的套接字时出错,消息为:Connection timed out: connect。
ERRORCODE=-4499, SQLSTATE=08001[jcc][Thread:main][SQLException@5b775b77] Stack trace followscom.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2043][11550][4.13.111] 异常 .ConnectException:打开端⼝ 50,000 上服务器 192.168.1.107/192.168.1.107 的套接字时出错,消息为:Connection timed out: connect。
ERRORCODE=-4499, SQLSTATE=08001com.ibm.db2.jcc.am.id.a(id.java:320)Cause:Error 1: DB2 return code is -4499Four problems might be the cause of this error.1、Firewall is not stopped2、DB2 is stopped.3、The wrong DB2 database listening port number is specified.4、The wrong database name is specified.solution:1、Check whether firewall is stopped.chkconfig iptables off 永久性关闭service iptables stop 重启主机后失效2、Check whether DB2 is started.db2 list db directory3、Check the DB2 listening portdb2 get dbm cfg |grep SVCENAME,查看TCP/IP服务名称和/etc/services中定义的db2服务名称是否匹配4、Check the DB2COMMdb2set -all 检查DB2COMM是否是TCPIP。
DB2 常见错误代码DB2 的错误信息分为4类:1: DB2错误信息: --> SQL<XXXX>N例如: SQL2062N该类错误信息可以通过DB2 命令查看详细描述:$db2 ? <SQLXXXXN>2: Error Code: →-XXX可以参考附件DB2_Code.PDF 查找.3: SQL STATE Code: →SQLSTATE: XXXXX该类错误信息一般会和Error Code 一同出现. 可在附件DB2_Code.PDF 查找错误描述. 4: Reason Code. →Reason code: "xxxx".出现该类通常是第三方API 或操作系统返回的错误信息. 可从系统层面查找原因.例如:在AIX 可以在如下文件找到该错误的描述:/usr/include/sys/ errno.h例如常见Reason Code#endif /* _ALL_SOURCE */#define EPERM 1 /* Operation not permitted */#define ENOENT 2 /* No such file or directory */#define ESRCH 3 /* No such process */#define EINTR 4 /* interrupted system call */#define EIO 5 /* I/O error */#define ENXIO 6 /* No such device or address */#define E2BIG 7 /* Arg list too long */#define ENOEXEC 8 /* Exec format error */#define EBADF 9 /* Bad file descriptor */#define ECHILD 10 /* No child processes */#define EAGAIN 11 /* Resource temporarily unavailable */#define ENOMEM 12 /* Not enough space */#define EACCES 13 /* Permission denied */#define EFAULT 14 /* Bad address */#define ENOTBLK 15 /* Block device required */#define EBUSY 16 /* Resource busy */#define EEXIST 17 /* File exists */#define EXDEV 18 /* Improper link */#define ENODEV 19 /* No such device */#define ENOTDIR 20 /* Not a directory */******************************************************************************* CV备份中常见的一些错误信息:1:SQL2426N The database has not been configured to allow the incremental backup operation. Reason code = "1".Reason Code= “1”从/usr/include/sys/ errno.h 查找Reason Code=”1” 的描述#define EPERM 1 /* Operation not permitted (操作不被允许)原因分析:此时1 代表某些操作不被允许., 配合SQL2426N 可以知道是因为没有更新TRACKMOD 参数为ON. 所以增量备份不备允许.2:SQL2062N An error occurred while accessing media"/opt/simpana/Base64/libDb2Sbt.so". Reason code: "11".Reason Code= "11"从/usr/include/sys/ errno.h 查找Reason Code=”11” 的描述#define EAGAIN 11 /* Resource temporarily unavailable (无法分配资源)原因分析:1: CommCell里面的DB2 子客户端没有关联相应的存储策略。