1. 程式人生 > >oracle 數據庫導入導出語句

oracle 數據庫導入導出語句

導入導出 tab oracle ignore 字段 man target exp font

oracle的exp/imp命令用於實現對數據庫的導出/導入操作;exp命令用於把數據從遠程數據庫服務器導到本地,生成.dmp文件;imp命令用於把本地的數據庫.dmp文件從本地導入到遠程的oracle數據庫中

1 將數據庫test完全導出.用戶名system/manager導出到D:daochu.dmp 代碼如下:

exp system/manager@test file=d:daochu.dmp full=y

2.將數據庫中system用戶與sys用戶的表導出代碼如下:

exp system/manager@test file=d:daochu.dmp owner=(system,sys)

3.將數據庫中的表table1 table2 導出 代碼如下:

exp system/manager@test file:= d:daochu.dmp tables=(table1,table2)

4.將數據庫中的表table1中的字段filed1以"00"打頭的數據導出 代碼如下;

exp system/manager@test file:=d:daochu.dmp tables=(table1) query="where filed1 like ‘00%‘"

5.將D:daochu.dmp中的數據導入到test數據庫中代碼如下

imp system/manager@test file:=d:doachu.dmp (這樣寫的肯定會報錯,因為數據庫中已經存在表了,對該表就不能導入)

所以 要在後面加上ignore=y就可以了

imp system/manager@test file:=d:daochu.dmp ignore=y 就可以了

6.將d:daochu.dmp中的表table1導入到test的數據庫中

imp system/manager@test file:=d:daochu.dmp tables=(table1);

oracle 數據庫導入導出語句