暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

【DB2】如何解决表Pending挂起问题

4813

1) 解除每一个表的Check Pending状态

db2 set constraints for tabname

2)表重组可以使表解除挂起状态

db2 reorg table tabname

3)表处于Load Pending状态,此时执行reorg会报错如下

SQL0668N Operation not allowed for reason code "3" on table <schema_name>.<table_name>. SQLSTATE=57016

SQL0668N reason code 3就代表这张表处于Load Pending状态。说明之前尝试load这张表有报错,这张表将无法访问直到load操作重启或终止

  • You can use queries to detect and remove the Load Pending state.

You can use the following query to detect the Load Pending state:

Select TABSCHEMA, TABNAME, LOAD_STATUS from SYSIBMADM.ADMINTABINFO where load_status = 'PENDING' and tabschema = '<schema_name>'"

  • You must restart or terminate the previously failed LOAD operation on this table by issuing LOAD with the RESTART or TERMINATE option.

You can use the following query to terminate the Load Pending state:

(注1:如果LOAD时使用了NON-RECOVERABLE参数,那么终止LOAD后这张表会丢失)

(注2:online backup期间无法执行,所有DDL操作受影响)

db2 load from /dev/null of del terminate into <schema_name>.<table_name> nonrecoverable

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论