Compared with performance, DB2 import and load log records are slow, and data records are too large, which may cause full transaction logs. However, some operations have to be logged, therefore, it is not applicable to import. However, it can be completely avoided with the COMMITCOUNT option. to specify the number of import records, that is, to submit, it helps release logs in a timely manner:
And because the submission is made in time, you can continue the operation at the starting point after the operation fails:
Db2 "import from tab1.ixf of ixf modified by generatedignore COMMITCOUNT 500000 insert into RCDB2.T _ CUST_DTL"
In the preceding settings, 50 million records are submitted for each import. However, during the import, the index tablespace is insufficient and the session fails to run:
SQL3306N An SQL error "-289" occurred while inserting a row into the table.
SQL0289N Unable to allocate new pages in table space "RCDB2_INDX_01 ".
SQLSTATE = 5701
Query the data volume that has been successfully imported as follows:
Db2 select count (*) from RCDB2.T _ CUST_DTL with ur
1
-----------
5000000
1 record (s) selected.
This can be used as the starting point for re-import.
Db2 "import from tab1.ixf of ixf modified by generatedignore COMMITCOUNT 500000 SKIPCOUNT 5000000 insert into RCDB2.T _ CUST_DTL"
In addition, there is another parameter restartcount n which is equivalent to SKIPCOUNT. Skip the first N records and continue import.
DB2 database performance adjustment and optimization (1st and 2) PDF
DB2 database performance optimization
This article permanently updates the link address: