對於數據的導出,導入。對於exp/imp能夠實現把遠程數據導入到客戶端,可是功能沒有expdp/impdp強大
對於expdp/impdp功能很強大,可是對於導出的數據只能是在服務端。下面咱們就基於經過expdp結合dblink
把數據直接導出到本地 下面使用導出服務器
若是空間容許建議導出到服務器ide
# 對於orac_remote是一個本地命名,能夠經過netca進行配置,或者直接修改相關配置文件
# 須要保持orac_remote的system用戶是open狀態,而且密碼是正確的
# 能夠經過 select * from scott.emp@to_orac_remote 進行測試,若是不成功,須要檢查權限和用戶已經命名空間orac_remote
1 建立dblink 鏈接測試
create database link to_orac_remote
connect to system identified by gpecnew using 'orac_remote'rem
2 建立directory目錄get
create directory backup as '/backup'
grant read,write on directory backup to systemit
3 編寫expdp的parfile參數文件 scott.par配置
userid=system/root
directory=backup
dumpfile=scott.dump
logfile=scott.log
schemas=scott
network_link=to_orac_remotefile
4 執行命令導出到本地
expdp parfile=scott.parselect
5 導入到本地
(測試的時候先在本地刪除scott用戶以及全部的表 drop user scott cascade)
impdp system/root directory=backup dumpfile=scott.dump logfile=scott2.log 命名空間