oracle 資料幫浦匯入匯出

2021-07-30 09:08:59 字數 1799 閱讀 4389

cmd

sqlplus system/password

1. 建立directory

2. 匯出expdp

3. 匯入impdp

4. 完成

建立directory

impdp

impdp grid_sysdb/[email protected]:1521/cityak dumpfile=grid_workflowdb.dmp logfile=workflowdb.log directory=dir_dp

極簡單三步走

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

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

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

select * from dba_directories;

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

grant read,write on directory dpdata1 to scott;

scott 是使用者,tiger 是密碼

四、匯出資料

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資料幫浦匯入匯出

使用expdp和impdp時應該注意的事項 exp和imp是客戶端工具程式,它們既可以在客戶端使用,也可以在服務端使用。expdp和impdp是服務端的工具程式,他們只能在oracle服務端使用,不能在客戶端使用。imp只適用於exp匯出的檔案,不適用於expdp匯出檔案 impdp只適用於expd...

oracle資料幫浦匯入匯出

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