Oracle 資料幫浦技術(expdp impdp)

2021-10-01 14:06:16 字數 1217 閱讀 6791

使用資料幫浦技術實現邏輯備份

邏輯備份概述

邏輯備份時建立資料庫物件的邏輯副本,並存入乙個二進位制轉儲檔案的過程。從本質上來講邏輯備份與恢復實際就是對資料庫事實資料的匯入和匯出。

匯出:匯出就是資料庫的邏輯備份,實質是讀取乙個資料庫記錄並將這個記錄集寫入乙個檔案(副檔名通常是dmp),這些記錄的匯出與物理位置無關

匯入:匯入即資料庫的邏輯恢復,實質是讀取被匯出的二進位制轉儲檔案並將其恢復到資料庫。

使用資料幫浦技術匯入/匯出

資料幫浦(data pump)是一種在資料庫之間或在資料庫與作業系統之間高速傳輸資料的技術。資料幫浦工具執行在伺服器上,資料庫管理員需要指定資料庫目錄來儲存轉儲的資料。

連線oracle 資料庫

建立乙個操作目錄

授予使用者操作dump_dir目錄的許可權

使用expdp命令匯出資料(可以按照表匯出,按照使用者模式匯出,按照表空間匯出和全庫匯出),使用impdp命令匯入資料(可以按照表匯入,按照使用者模式匯入,按照表空間匯出和全庫匯入)。

匯出scott使用者下的emp和dept表

[oracle@dbserver~]$ expdp scott/oracle directory=dump_dir dumpfile=scotttab.dmp tables=emp,dept

匯入emp表

[oracle@dbserver~]$ impdp scott/oracle directory=dump_dir dumpfile=scotttab.dmp tables=emp

將匯出的scott使用者下的dept表和emp表匯入到tom使用者下

[oracle@dbserver~]$ impdp system/oracle11g directory=dump_dir dumpfile=scotttab.dmptables=scott.emp,scott.dept remap_schema=scott:tom

匯出全庫

[oracle@dbserverorcl]$ expdp system/oracle11g directory=dump_dir dumpfile=full.dmp full=y

匯入全庫

[oracle@dbserverorcl]$ impdp system/oracle11g directory=dump_dir dumpfile=full.dmp full=y

Oracle資料幫浦 impdp以及expdp

oracle資料幫浦 impdp以及expdp 一 建立邏輯目錄,該命令不會在作業系統建立真正的目錄,最好以system等管理員建立。create directory dpdata as opt 二 檢視管理理員目錄 同時檢視作業系統是否存在,因為oracle並不關心該目錄是否存在,如果不存在,則出...

oracle10G 資料幫浦技術

1.技術概述 資料幫浦技術是基於pl sql的dbms datapump提供的 通過兩個方式可以使用 乙個是命令列模式 乙個是基於web的企業級別影象介面管理工具完成資料的遷移。1 資料幫浦與imp exp的區別 是基於imp exp的,但是比imp exp速度塊 單執行緒比exp快2倍 比imp快...

oracle10G 資料幫浦技術

1.技術概述 資料幫浦技術是基於pl sql的dbms datapump提供的 通過兩個方式可以使用 乙個是命令列模式 乙個是基於web的企業級別影象介面管理工具完成資料的遷移。1 資料幫浦與imp exp的區別 是基於imp exp的,但是比imp exp速度塊 單執行緒比exp快2倍 比imp快...