| 場景 | 命令範例 | 關鍵說明 |
|---|---|---|
| 追加導入 (IMPORT) | import from /path/TABLE1.ixf of ixf insert into TABLE1; | 較慢,支援觸發器/約束,適合小數據量 |
| 追加裝載 (LOAD INSERT) | load from /path/TABLE1.ixf of ixf insert into TABLE1; | 高性能,繞過大部分約束,需較高權限 |
| 替換裝載 (LOAD REPLACE) | load from /path/TABLE1.ixf of ixf replace into TABLE1; | 裝載前清空表數據 |
| 重啟失敗裝載 | load from /path/TABLE1.ixf of ixf restart into TABLE1; | 從失敗點繼續,並記錄錯誤 |
| 帶日志記錄導入 | import from /path/TABLE1.ixf of ixf savecount 1000 messages /path/msg.txt insert into TABLE1; | 每 1000 行記錄一次進度 |
需忽略源數據中的自增值,由目標表自動生成:
load from /path/TABLE1.ixf of ixf modified by identityignore insert into TABLE1;
LOAD 後表可能進入 Set Integrity Pending 狀態,執行:
SET INTEGRITY FOR TABLE1 IMMEDIATE CHECKED;
-- 若仍失敗,改為跳過檢查 (需確保數據確實滿足約束)
SET INTEGRITY FOR TABLE1 IMMEDIATE UNCHECKED;
若仍報錯,必須檢查數據完整性(如外鍵、檢查約束違規),清洗數據後重新裝載。
SYSADM/DBADM/LOAD 權限;IMPORT 只需 INSERT 權限。FOR EXCEPTION 捕獲違規行)。選型原則: 大批量初始化/重建用 LOAD;日常增量/需觸發器業務用 IMPORT。