Just blogged

元SIerの今はWebビジネス中心なヒトが日々のトピックを綴ります。

データの移行

LOAD IMPORT
データの挿入方法 大量のデータを挿入する SQLのINSERT機能を用いて1行ずつ挿入する
処理速度 高速
処理方法 フォーマットされたページを直接DBに書き込む
ログ 最小限 すべての行の履歴
対象表 LOAD中はOffline IMPORT中もOnline

データベース[sampedb]の表[sample_table]からすべての行を取り出し、[sampledb2]の[target_table]へ上書き挿入する

  • EXPORT
    • db2 connect to sampledb user db2admin using db2admin
    • db2 export to sample_table_1.ixf of ixf select * from sample_table
    • db2 terminate
  • LOAD
    • db2 connect to sampledb2 user db2admin using db2admin
    • db2 load from sample_table_1.ixf replace into target_table
    • db2 terminate
  • IMPORT
    • db2 connect to sampledb2 user db2admin using db2admin
    • db2 import from sample_table.ixf of ixf insert_update into target_table
    • db2 terminate