oracle備份(expdp、exp)及還原(imp、impdp)的方法

來源:互聯網
上載者:User

標籤:

oracle備份(exp、expdp)

--按使用者匯出表
expdp bdcdj/[email protected] schemas=bdcdj directory=a dumpfile=bdcdj.dmp
--按表名匯出表
expdp scott/[email protected] TABLES=emp,dept dumpfile=expdp.dmp DIRECTORY=dpdata1;
--按查詢條件匯出表
expdp scott/[email protected] directory=dpdata1 dumpfile=expdp.dmp Tables=emp query=‘WHERE deptno=20‘;
--按資料表空間匯出表
expdp system/manager DIRECTORY=dpdata1 DUMPFILE=tablespace.dmp TABLESPACES=temp,example;
--導整個資料庫
expdp system/manager DIRECTORY=dpdata1 DUMPFILE=full.dmp FULL=y;

--正常備份
exp bdcdj/[email protected] file=e:\bdcdj.dmp owner=bdcdj
--正常備份單張表
exp system/[email protected] file=d:\daochu.dmp tables=(table1,table2)

----------------------------------------------------------------------------------------------------------------------

oracle還原(imp、impdp)

--匯入表
impdp sde/[email protected] schemas=bdcdj directory=a dumpfile=bdcdj.dmp
--匯入資料表空間
impdp system/manager DIRECTORY=dpdata1 DUMPFILE=tablespace.dmp TABLESPACES=example;
--匯入資料庫
impdp system/manager DIRECTORY=dump_dir DUMPFILE=full.dmp FULL=y;
--追加資料
impdp system/manager DIRECTORY=dpdata1 DUMPFILE=expdp.dmp SCHEMAS=system TABLE_EXISTS_ACTION
--改變表的owner
impdp system/manager DIRECTORY=dpdata1 DUMPFILE=expdp.dmp TABLES=scott.dept REMAP_SCHEMA=scott:system;

--還原單表
imp sde/[email protected] file=e:\xx.dmp tables=表名
imp sde/[email protected] file=e:\sde_T_xtsz.dmp tables=T_xtsz

--正常還原
imp sde/[email protected] file=E:\nb\sde.dmp fromuser=sde touser=sde buffer=99999999 log=‘E:\nb\sde.log‘
-- 2 將d:\daochu.dmp中的表table1 匯入
imp system/[email protected] file=d:\daochu.dmp tables=(table1)

注意:這是我在工作中所用到的。一般就是這些常用的備份還原。希望對大家有個參考。注意加buffer=99999999是因為所匯入的資料庫檔案大的情況下的。為了防止資料的丟失。如果在還原時發現少表的情況下。本人建議是將空的模板庫在重新還原一下。這樣就會全部還原進去。

oracle備份(expdp、exp)及還原(imp、impdp)的方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.