db2操作从分区表DETACH下来的临时表报错

DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor.

 During SQL processing it returned:

SQL20285N  The statement or command was not processed either because the table named 'TEST.TABLE1_PART20200313'

has detached dependent tables or because an asynchronous partition detach operation on the table is not complete.Reason

code="2". SQLSTATE=55057

以上错误是在操作从分区表中DETACH下来的临时表时报出的错误,经分析错误原因为若DETACH下来的分区资源尚未完全释放时

操作临时表的话即会抛出此异常。

通过查询db2帮助命令也可得知问题原因:

db2 ? 55057

SQLSTATE 55057:The statement or command is not allowed while the table has detached dependents or until the asynchronous

partition detach task completes.

db2  ?  SQL20285N

SQL20285N  The statement or command was not processed either because the table named "<table-bane>" hass detached

dependent tables or because an asynchronous partition detach operation on the table is not complete.Reason Code =

"<reason-code>".

The specific reason this message was returned is indicated by the value of the runtime token "<reason-code>":

1   The table is the target table of a detach operation and has detached dependents which are required to be incrementally

maintained with respects to the current content of this table in order to preserve the integrity of the detached dependents.The

statement or command is not allowed because execution of the statement or command would prevent the detached dependents

from being incrementally maintained.

2   The table is the target table of a detach operation and is not available because the asychronous partition detach task has not

completed.

3   The table is the source table of a detach operation and has logically detached partitions.The statement or command is not

allowed because the asynchronous partition detach task has not completed.

4   The table has detached partitions and there are dependent tables that need to be incrementally maintained with respect to

these detached partitions.The statement is not allowed because execution of the statement or command would incalidate the

incremental maintentance of the dependent table.

解决方法如下:

针对错误码2解决方法:使用list utilities命令监控卸载分区进程执行情况,直至卸载分区命令执行完成,再继续操作即可。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值