DB2因表空间不够产生load表失败

时间:2024-05-20 20:04:38

今天下午恢复表的时候发现出现错误:

SQL3520W  Load Consistency Point was successful.

SQL3110N  The utility has completed processing.  "185345" rows were read from
the input file.

SQL3519W  Begin Load Consistency Point. Input record count = "185345".

SQL3520W  Load Consistency Point was successful.

SQL3515W  The utility has finished the "LOAD" phase at time "01/06/2011
08:46:53.986782".

SQL3500W  The utility is beginning the "BUILD" phase at time "01/06/2011
08:46:53.987138".

SQL3213I  The indexing mode is "REBUILD".

SQL0289N  Unable to allocate new pages in table space "XXXX". 
SQLSTATE=57011

SQL0289N  Unable to allocate new pages in table space "XXXX". 
SQLSTATE=57011

因为load表的时候先是删除表的索引,然后往表里面放数据,最后从新建立索引,因为索引所在的表空间快用完了,所以创建索引的时候出现Unable to allocate new pages in table space的错误。这个时候这个表处于load pending状态,所以首先需要解除load pending状态。可以用命令db2 load query table XXXX查看其load处于的状态,然后用db2 "load from empty.txt  of del terminate into XXXX NONRECOVERABLE"解除load pending状态。

解除load pending状态后需要知道表的索引所在的表空间,这个可以用db2look来查看ddl, 具体命令

db2look -d $DB -t $Table  -a -e -x  -o ./outfile

然后用db2 alter tablespace $Tablespace extend (all $NumberOfPages)

最后重新load表即可

转自:http://blog.****.net/zheyimiao/article/details/6121079