DB2 import資料匯入的skipcount參數使用方法

來源:互聯網
上載者:User

DB2 import和load比起效能來由於會記錄日誌,所以通過速度比較慢,並且資料記錄太大容易造成事物日誌滿的問題發生,但有些操作不得不記日誌,所以就不得不適用import,不過其有個COMMITCOUNT選項完全可以避免,來指定import多少條記錄即提交,有助於及時釋放日誌:

並且由於及時提交了,所以在運行失敗了還可以重新在起點繼續進行操作:

db2 "import from tab1.ixf of ixf modified by generatedignore COMMITCOUNT 500000 insert into  RCDB2.T_CUST_DTL"

上面我設定每匯入50W條記錄就提交,然而匯入中發現索引資料表空間不足,會話運行失敗:
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

查詢目前已經成功匯入的資料量如下:

db2 select count(*) from RCDB2.T_CUST_DTL with ur

1
-----------
    5000000

  1 record(s) selected.

這個就可以作為重新匯入的起點。

db2 "import from tab1.ixf of ixf modified by generatedignore COMMITCOUNT 500000 SKIPCOUNT 5000000 insert into  RCDB2.T_CUST_DTL"

另外還有個參數RESTARTCOUNT N何SKIPCOUNT等效, 跳過前N條記錄繼續import,想當的方便

DB2資料庫效能調整和最佳化(第1、2版) PDF

DB2資料庫效能最佳化介紹

本文永久更新連結地址:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.