DB2匯入匯出方法總結

2022-03-29 20:27:02 字數 1708 閱讀 6572

1.匯出 del 文字檔案 

export to d:\t_testtable20121220.del of

del

select

*from t_testtable

2.匯出 ixf 文字檔案.ixf 檔案包含表結構和db2資料庫資訊 

export to d:\t_testtable20121220.ixf of ixf select * from t_testtable

3.匯入資料 之 資料插入 

import from d:\t_testtable20121220.del of

del

insert

into t_testtable

import from d:\t_testtable20121220.ixf of

ixf

insert

into t_testtable

4.匯入資料 之 資料替換

import from d:\t_testtable20121220.del of

del

replace

into

t_testtable

import

from d:\t_testtable20121220.ixf of

ixf

replace

into t_testtable

5.匯入資料 之 建立表結構,並匯入資料 

import from d:\t_testtable20121220.ixf of

ixf

create

into t_testtable

6.匯入資料 之 load匯入表資料 

load client from d:\t_testtable20121220.ixf of

ixf

insert

into

t_testtable

load client from d:\t_testtable20121220.del of

del

insert

into t_testtable

7.匯入資料 之 包含id為generated always 始終由系統生成的表

load client from d:\t_testtable20121220.ixf of

ixf

modified

by identityoverride insert

into t_testtable

8.匯入資料 之 del檔案中文亂碼的解決 

load client from d:\t_testtable20121220.del of

del

modified

by codepage=

1386

insert

into t_testtable

如果有中文亂碼和identity 的話,codepage 寫前面

9.匯入資料 之 load表時,表鎖死

load client from c:\data.del of

del

terminate

into t_testtable

DB2 匯入匯出

1 匯出資料 開始 執行 db2cmd 進入命令列 執行如下命令 db2look d bxfund2 e c o e data bxfund2.sql 此命令將bxfund2中的表的結構寫入到e盤data檔案下的bxfund2.sql檔案中,即匯出表結構,接著,我們來匯出資料 接著執行連線資料庫命令...

db2匯入匯出資料

1 匯出資料 開始 執行 db2cmd 進入命令列 執行如下命令 db2look d bxfund2 e c o e data bxfund2.sql 此命令將bxfund2中的表的結構寫入到e盤data檔案下的bxfund2.sql檔案中,即匯出表結構,接著,我們來匯出資料 接著執行連線資料庫命令...

db2 匯入匯出表

一 db2匯入匯出方法很多,在此列舉個比較常用的方法 匯入匯出分兩種一種是帶表結構的,一種為資料的,我們用的基本上是只有資料的 1 在db2中匯入匯出表 1 匯出表結構並且資料是二進位制格式 export to filename.ixf of ixf select from tablename wh...