Oracle資料泵

來源:互聯網
上載者:User

標籤:

 

要使用資料泵必須先建立資料庫目錄

       資料庫目錄只允許sys建立

       普通使用者使用 必須授權

假設scott 使用者是匯出匯入使用者

      

SQL> ! mkdir dp_dir

SQL> create directory dp_dir as ‘/home/oracle/dp_dir‘;

Directory created.

SQL> grant read,write on directory dp_dir to scott;

 

Grant succeeded.

 

資料泵匯出方法: 匯出scott使用者

       expdp     

匯出案例1,按表匯出

expdp scott/tiger directory= dp_dir  dumpfile=tab.dmp logfile=scott.log tables=dept,emp

 

匯出案例2,按使用者匯出

expdp scott/tiger directory= dp_dir  dumpfile=dumpscott.dmp schemas=scott

 

匯出案例3,全庫匯出,且並行匯出

expdp scott/tiger directory= dp_dir  dumpfile=full.dmp parallel=4 full=y

備份檔案在/home/oracle/dp_dir/ 目錄下

 

資料泵匯入方法: 匯入scott使用者

       Impdp  將檔案拷貝到/home/oracle/dp_dir/ 目錄下

 

匯入案例1,按表匯入,從scott到scott2

impdp scott2/tiger directory=dp_dir  dumpfile=tab.dmp tables=scott.dept,scott.emp remap_schema=scott:scott2

 

匯入案例2,按使用者匯入,從scott到scott2

impdp scott/tiger directory= dp_dir  dumpfile=schema.dmp remap_schema=scott:scott2

 

匯入案例3,全庫匯入

impdp scott/tiger directory= dp_dir  dumpfile=full.dmp full=y

附:

不同使用者不同資料表空間下的匯入操作:

       impdp 使用者名稱/密碼 directory=‘您建立的目錄的名稱‘ dumpfile=‘匯出的檔案名稱‘

remap_schema=匯出的使用者名稱稱:要匯入的使用者名稱稱 remap_tablespace=匯出的資料表空間名稱:要匯入的資料表空間名稱

 

 

impdp system/[email protected]/orcl directory=dp_dir remap_schema=EFMIS_23_YANSHI:efmis_23_20150511 transform=oid:n dumpfile=EFMIS_23_YANSHI_201505110900.dmp

 

expdp fasp_20000/[email protected]/orcl directory=dp_dir dumpfile=dumpscott.dmp schemas=fasp_20000

 

expdp efmis_62/[email protected]/orcl directory=dpdump dumpfile=EFMIS_62_20150821.dmp schemas=EFMIS_62

 

impdp system/[email protected]/orcl directory=dp_dir remap_schema=OA_0608:HQOA_20150806  dumpfile= OA_0608_20150806.DMP

 

logfile=EFMIS_62_20150821.log

 

Oracle資料泵

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.