How to Use the skipcount parameter for data import from DB2 import

Source: Internet
Author: User
Tags sql error

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.