oracle數據泵導入導出命令


1.在PL/SQL的界面,找到Directories文件夾,找到目錄文件的路徑

 

 

2.通過SSH進入服務器

  找到相應的路徑 cd /u01/oracle/dpdir

  輸入指令

  df -h   查看資源使用量

  su – oracle   進入系統的oracle用戶

  

3.導出數據庫文件

expdp userid=hbcxjm/oracle  directory=dpdir dumpfile=hbcxjm.dmp job_name=hbcxjm logfile=hbcxjmlog parallel=2 schemas=hbcxjm

PS:

其中userid是要導出的目標庫的用戶名密碼,directory是建立的路徑名稱,dumpfile是目標文件名稱

4.新建數據庫用戶

   PS:注意表空間問題,確保表空間充足,否則導入會報錯

5.導入數據

impdp hbcxjm/oracle directory=dpdir dumpfile=hbcxjm.dmp REMAP_SCHEMA=hbcxjm:hbcxjm REMAP_TABLESPACE=TP_HBCXJM:TP_HBCXJM

table_exists_action = truncate  logfile=hbcxjmimp.log SCHEMAS=hbcxjm

PS:

REMAP_SCHEMA:導出數據用戶的名稱和導入數據用戶的名稱

REMAP_TABLESPACE:導出數據用戶的表空間和導入數據用戶的表空間

table_exists_action:如果表中有數據的處理方式,此處采用truncate處理

logfile:日志文件名稱

 

例子:

文件導出:

expdp userid=hbcxjm/oracle  directory=dpdir dumpfile=hbcxjm.dmp job_name=hbcxjm logfile=hbcxjmlog parallel=2 schemas=hbcxjm

expdp userid=drm_hbcxjm/oracle  directory=dpdir dumpfile=drm_hbcxjm.dmp job_name=drm_hbcxjm logfile=drm_hbcxjmlog parallel=2 schemas=drm_hbcxjm

expdp userid=hbcxjm_report/oracle  directory=dpdir dumpfile=hbcxjm_report.dmp job_name=hbcxjm_report logfile=hbcxjm_reportlog parallel=2 schemas=hbcxjm_report

expdp userid=hbcxjm_siif/oracle  directory=dpdir dumpfile=hbcxjm_siif.dmp job_name=hbcxjm_siif logfile=hbcxjm_siiflog parallel=2 schemas=hbcxjm_siif

expdp userid=hxpt3dd/oracle  directory=dpdir dumpfile=hxpt3dd.dmp job_name=hxpt3dd logfile=hxpt3ddlog parallel=2 schemas=hxpt3dd

expdp userid=drm_hxpt3dd/oracle  directory=dpdir dumpfile=drm_hxpt3dd.dmp job_name=drm_hxpt3dd logfile=drm_hxpt3ddlog parallel=2 schemas=drm_hxpt3dd

文件導入:

impdp hbcxjm/oracle directory=dpdir dumpfile=hbcxjm.dmp REMAP_SCHEMA=hbcxjm:hbcxjm REMAP_TABLESPACE=TP_HBCXJM:TP_HBCXJM table_exists_action = truncate logfile=hbcxjmimp.log SCHEMAS=hbcxjm

impdp drm_hbcxjm/oracle directory=dpdir dumpfile=drm_hbcxjm.dmp REMAP_SCHEMA=drm_hbcxjm:drm_hbcxjm REMAP_TABLESPACE=TP_HBCXJM_DRM:TP_HBCXJM_DRM table_exists_action = truncate logfile=drm_hbcxjmimp.log SCHEMAS=drm_hbcxjm

impdp hbcxjm_report/oracle directory=dpdir dumpfile=hbcxjm_report.dmp REMAP_SCHEMA=hbcxjm_report:hbcxjm_report REMAP_TABLESPACE=TP_HBCXJM_DRM:TP_HBCXJM_DRM table_exists_action = truncate logfile=hbcxjm_reportimp.log SCHEMAS=hbcxjm_report

impdp hbcxjm_siif/oracle directory=dpdir dumpfile=hbcxjm_siif.dmp REMAP_SCHEMA=hbcxjm_siif:hbcxjm_siif REMAP_TABLESPACE=TP_HBCXJM:TP_HBCXJM table_exists_action = truncate logfile=hbcxjm_siifimp.log SCHEMAS=hbcxjm_siif

impdp hxpt3dd/oracle directory=dpdir dumpfile=hxpt3dd.dmp REMAP_SCHEMA=hxpt3dd:hxpt3dd REMAP_TABLESPACE=TP_HBCXJM_YBDD:TP_HBCXJM_YBDD table_exists_action = truncate logfile=hxpt3ddimp.log SCHEMAS=hxpt3dd

impdp drm_hxpt3dd/oracle directory=dpdir dumpfile=drm_hxpt3dd.dmp REMAP_SCHEMA=drm_hxpt3dd:drm_hxpt3dd REMAP_TABLESPACE=TP_HBCXJM_YBDD:TP_HBCXJM_YBDD table_exists_action = truncate logfile=drm_hxpt3ddimp.log SCHEMAS=drm_hxpt3dd


免責聲明!

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



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