目的:使用資料泵,將一台電腦上的資料庫匯出,匯入到另一台電腦上的資料庫。
A電腦上的操作。expdp資料匯出
1、運行cmd;
2、登入資料庫,輸入命令:sqlplus system/密碼;
3、建立目錄路徑:create directory backup_path as ‘E:\app\tws\oradata\orcldv’; (backup_path為路徑名稱,可自命名(必須是已存在路徑),E:\app\tws\oradata\orcl為來源資料庫路徑)
5、匯入匯出操作授權:grant exp_full_database,imp_full_database to dmuser; (dmuser為資料庫使用者名稱)
6、退出:exit;
7、資料匯出,執行命令:expdpdmuser/***** directory=backup_path dumpfile=dmuser_schema.dmp logfile=dmuser_schema_29.log;(dmuser為使用者名稱,*****為密碼,dmuser_schema.dmp為匯出資料庫檔案,可自命名,但格式要為.dmp,dmuser_schema_29.log為記錄檔,可自命名)
B電腦上的操作。impdp 資料匯入
將匯出的資料庫檔案複製到目標資料庫路徑下。
1、運行cmd;
2、登入資料庫,輸入命令:sqlplus system/密碼;
3、建立目錄路徑:create directory goup_path as ‘E:\app\tws\oradata\orcl’; (goup_path為路徑名稱,可自命名,E:\app\tws\oradata\orcl為目標資料庫路徑)
4、退出:exit;
5、資料匯入,執行命令:impdpdmuser/***** directory=goup_path dumpfile=dmuser_schema.dmp logfile=dmuser_schema_29.log;
參考文檔:
http://www.cnblogs.com/jyzhao/p/4530575.html
http://blog.csdn.net/fjseryi/article/details/50013961
http://blog.itpub.net/23490154/viewspace-1061687/
http://blog.csdn.net/haiross/article/details/27580199/