前言
對于本機安裝了oracle 客戶端,下述命令都可以在 dos 執(zhí)行,當然 dmp 文件導出在本地。
但在實際研發(fā)時,沒人愿意在本機上安裝龐大的 oracle 軟件,這時你需要使用 Xshell/puTTY..
遠程工具連接到 Linux 進行操作,進行 Linux 上 dmp 文件的導入導出。
正文
a. 將用戶 system 用戶表導出到指定路徑 D 盤
1
|
exp system /password @SID file =d: /daochu .dmp full=y |
b. 將用戶 system 與 sys 用戶的表導出到指定路徑 D 盤
1
|
exp system /password @SID file =d: /daochu .dmp owner=(system,sys) |
c. 將用戶 system 中的表 table_A、table_B 導出到指定路徑 D 盤
1
|
exp system /password @SID file = d: /daochu .dmp tables=(table_A,table_B) |
d. 將用戶 system 中的表 table1 中的字段 filed1 以"00"打頭的數(shù)據(jù)導出
1
|
exp system /passwor @SID filed=d: /daochu .dmp tables=(table1) query=/ " where filed1 like '00%'/" |
對于壓縮可以用 winzip 將 dmp 文件進行壓縮,也可以在上面命令后面 加上 compress=y
來實現(xiàn)。
導出 DMP文件適用于大型數(shù)據(jù)庫完整遷移,對遷移前后兩者服務器數(shù)據(jù)庫字符集要求一致,且對CLOB字段支持不太友好。
對于小數(shù)據(jù)的導出其實用 PLSQL 能做的更好,更快,導出的SQL也很直觀。
e. 將 D:/daochu.dmp 中的數(shù)據(jù)導入 TEST 數(shù)據(jù)庫中。
1
2
|
imp system /password @SID file =d: /daochu .dmp imp system /password @HUST full=y file =d: /data/newsmgnt .dmp ignore=y |
上面命令如果出現(xiàn)問題,假設有的表已存在,對該表可以不進行導入,后面添加 ignore=y
。
f. 將 d:/daochu.dmp中的表table1 導入
1
|
imp system /passord @SID file =d: /daochu .dmp tables=(table1) |
總結
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對服務器之家的支持。
原文鏈接:http://www.cnblogs.com/java-class/p/5619594.html