oracle匯入匯出

2021-09-02 10:59:33 字數 2203 閱讀 3040

>>>oracle目錄及expdp匯出

1、建立directory

create directory devdbdir as '/opt/temp/cs***p';    //該目錄需oracle使用者具有寫許可權

drop directory devdbdir;  //刪除

2、授權

grant read,write on directory devdbdir to devdb;

--檢視目錄及許可權

select privilege, directory_name, directory_path from user_tab_privs t, all_directories d

where t.table_name(+) = d.directory_name order by 2, 1;

3、執行匯出

expdp devdb/devdb directory=devdbdir dumpfile =devdb20150331.dmp logfile=devdb.log;

>>>impdp匯入

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

在伺服器操作不加@資料庫連線符

有時無法加schemas引數,為什麼??

oracle使用expdp和impdp資料幫浦進行匯出匯入的方法

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

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

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

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

4、對於10g以上的伺服器,使用exp通常不能匯出0行資料的空表,而此時必須使用expdp匯出。

>>>expdp引數說明

??結尾加分號的問題

命令列方式單引、括號 都要加轉義符

include=table:"in \(select table_name from user_tables where table_name like\ 'emp%\'\)"

userid=admin/admin

dumpfile=t_table.dmp

directory=thedir

logfile=t_table.log

include=table:"in (select t.table_name from user_tables)"

放棄命令列的理由大概有這些:

① 作業系統對cli字元數的限制

② 令人痛恨的轉義符

③ 無法跨平台重用

④ 官方文件到處鼓吹用指令碼方式

oracle expdp 過濾和並行

>>>oracle impdp的table_exists_action詳解

1)  skip:預設操作

2)  replace:先drop表,然後建立表,最後插入資料

4)  truncate:先truncate,然後再插入資料

exp imp

exp username/password tables=t_user file=/opt/temp/t_user.dmp

oracle 10g使用exp管道壓縮方式減小檔案大小

1、先建立命名管道

[ora10@ora12c ~]$ mknod /ora11_10/dumpfile/jinzypipe p

2、使用管道壓縮的方法匯出資料

[ora10@ora12c ~] 

exp jinzy/jinzy file=/ora11_10/dumpfile/jinzypipe tables=test & gzip < /ora11_10/dumpfile/jinzypipe > /ora11_10/dumpfile/jinzycompress.gz

3、使用管道匯入檔案

[ora10@ora12c ~]$imp jinzy/jinzy file=/ora11_10/dumpfile/jinzypipe tables=test & gunzip < /ora11_10/dumpfile/jinzycompress.gz > /ora11_10/dumpfile/jinzypipe

oracle匯出,匯入

匯出,在dos下執行 1.exp username userpassword databasename 可以是資料庫也可是遠端的,如username userpassword caac135 2.enter array fetch buffer size 4096 回車 3.export file ...

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匯入匯出

最簡單 exp duser duser remote localinstancename owner duser file file path dmp imp duser duser remote localinstancename file file path dmp 詳細出處參考 win10下o...