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