oracle資料幫浦匯入匯出

2021-06-23 07:45:49 字數 1824 閱讀 8618

       使用expdp和impdp時應該注意的事項:

exp和imp是客戶端工具程式,它們既可以在客戶端使用,也可以在服務端使用。

expdp和impdp是服務端的工具程式,他們只能在oracle服務端使用,不能在客戶端使用。

imp只適用於exp匯出的檔案,不適用於expdp匯出檔案;impdp只適用於expdp匯出的檔案,而不適用於exp匯出檔案。

expdp或impdp命令時,可暫不指出使用者名稱/密碼@例項名 as 身份,然後根據提示再輸入,如:

expdp schemas=scott dumpfile=expdp.dmp directory=dpdata1;

一、建立邏輯目錄,該命令不會在作業系統建立真正的目錄,最好以system等管理員建立。

create directory dpdata1 as 'd:\test\dump';

二、檢視管理理員目錄(同時檢視作業系統是否存在,因為oracle並不關心該目錄是否存在,如果不存在,則出錯)

select * from dba_directories;

三、給scott使用者賦予在指定目錄的操作許可權,最好以system等管理員賦予。

grant read,write on directory dpdata1 to scott;

四、匯出資料

1)按使用者導

expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp directory=dpdata1;

2)並行程序parallel

expdp scott/tiger@orcl directory=dpdata1 dumpfile=scott3.dmp parallel=40 job_name=scott3

3)按表名導

expdp scott/tiger@orcl tables=emp,dept dumpfile=expdp.dmp directory=dpdata1;

4)按查詢條件導

expdp scott/tiger@orcl directory=dpdata1 dumpfile=expdp.dmp tables=emp query='where deptno=20';

5)按表空間導

expdp system/manager directory=dpdata1 dumpfile=tablespace.dmp tablespaces=temp,example;

6)導整個資料庫

expdp system/manager directory=dpdata1 dumpfile=full.dmp full=y;

五、還原資料

1)導到指定使用者下

impdp scott/tiger directory=dpdata1 dumpfile=expdp.dmp schemas=scott;

2)改變表的owner

impdp system/manager directory=dpdata1 dumpfile=expdp.dmp tables=scott.dept remap_schema=scott:system;

3)匯入表空間

impdp system/manager directory=dpdata1 dumpfile=tablespace.dmp tablespaces=example;

4)匯入資料庫

impdb system/manager directory=dump_dir dumpfile=full.dmp full=y;

5)追加資料

impdp system/manager directory=dpdata1 dumpfile=expdp.dmp schemas=system table_exists_action

oracle 資料幫浦匯入匯出

sqlplus system system egov create directory dump dir as d dbback exit expdp system system egov directory dump dir dumpfile urbanyw.dmp schemas urbanyw...

oracle資料幫浦匯入匯出

1.建立資料幫浦目錄 create directory home as home expdp 2.授權 grant read,write on directory home to scott 資料字典dba directories 3.匯出 全庫匯出 expdp system oracle comp...

Oracle資料幫浦匯入匯出

服務端提供oracle服務的例項,其是資料庫的核心,用於資料庫的管理,物件的管理與儲存 資料的儲存 查詢 資料庫資源的監控 監聽等一些服務。而客戶端只是乙個與服務端互動的工具,如sqlplus,在sqlplus裡執行sql語句傳到服務端,服務端進行解析後執行sql裡的操作,並將操作結果輸出到客戶端。...