oracle 數據庫導入導出語句


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);


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM