imp/exp 它們是操作系統下一個可執行的文件 存放目錄/ORACLE_HOME/bin下
該命令在“開始菜單>>運行>>CMD”中執行(快捷鍵:WINDOWS+R 輸入cmd)
一、數據導出(exp.exe)
1、將數據庫orcl完全導出,用戶名system,密碼accp,導出到d:\daochu.dmp文件中
exp system/accp@orcl file=d:\daochu.dmp full=y
2、將數據庫orcl中scott用戶的對象導出
exp scott/accp@orcl file=d:\daochu.dmp owner=scott
3、將數據庫orcl中的scott用戶的表emp、dept導出
exp scott/accp@orcl file= d:\daochu.dmp tables=emp,dept owner=scott
4、將數據庫orcl中的表空間testSpace導出
exp system/accp@orcl file=d:\daochu.dmp tablespaces=testSpace
二、數據導入(imp.exe)
1、將d:\daochu.dmp 中的數據導入 orcl數據庫中
imp system/accp@orcl file=d:\daochu.dmp full=y
2、如果導入時,數據表已經存在,將報錯,對該表不會進行導入;加上ignore=y即可,表示忽略現有表,在現有表上追加記錄
imp scott/accp@orcl file=d:\daochu.dmp full=y ignore=y
3、將d:\daochu.dmp中的表emp導入
imp scott/accp@orcl file=d:\daochu.dmp tables=emp
導入數據時,常帶buffer屬性 buffer=8192000