怎么导出oracle库,【DG】怎么从Oracle备库导出数据
1、使用exp導(dǎo)出
2、使用expdp導(dǎo)出
======================================================
若使用exp導(dǎo)出,則可以直接在備庫執(zhí)行導(dǎo)出動(dòng)作。
exp?lhr/lhr?buffer=409600000?file=/tmp/lhr.dmp?log=/tmp/lhr.log?owner=lhr
imp?lhr/lhr?buffer=409600000?file=/tmp/lhr.dmp?log=/tmp/lhrimp.log?full=y
======================================================
使用expdp導(dǎo)出先決條件:
我們都知道數(shù)據(jù)泵(Data Pump)不能直接在物理備用數(shù)據(jù)庫上執(zhí)行,這由于執(zhí)行數(shù)據(jù)泵時(shí)數(shù)據(jù)泵會(huì)創(chuàng)建和維護(hù)一個(gè)表,還要求數(shù)據(jù)庫必須是READ WRITE模式,因此我們必須從其他數(shù)據(jù)庫使用NETWORK_LINK備份物理備用數(shù)據(jù)庫。
NETWORK_LINK參數(shù)啟動(dòng)主要通過使用一個(gè)有效的數(shù)據(jù)庫鏈接。當(dāng)expdp啟動(dòng)連接后由source_database_link引用物理備用數(shù)據(jù)庫,檢索數(shù)據(jù),并將數(shù)據(jù)寫入到一個(gè)轉(zhuǎn)儲(chǔ)文件集。
物理備用數(shù)據(jù)庫必須是“READ ONLY”模式。
執(zhí)行備份:
物理備用數(shù)據(jù)庫的相關(guān)操作:
--?Connect?to?Physical?Standby?database?and?check?its?status
SQL>?select?instance_name,?status?from?v$instance;
INSTANCE_NAME?STATUS
----------------?------------
PHYSTBY?MOUNTED
--?Cancel?managed?recovery?and?open?database?in?"READ?ONLY"?mode.
SQL>?alter?database?recover?managed?standby?database?cancel;
SQL>?alter?database?open?read?only;
--?Verify?database?status
SQL>?select?instance_name,?status?from?v$instance;
INSTANCE_NAME?STATUS
----------------?------------
PHYSTBY?OPEN
SQL>?select?open_mode?from?v$database;
OPEN_MODE
--------------------
READ?ONLY
其他數(shù)據(jù)庫(READ WRITE)操作:
--?create?DB?Link,?Oracle?Directory?and?test?it
SQL>?create?database?link?expdp_primary?connect?to?system?identified?by?password?using?‘standby_database’;
SQL>?select?db_unique_name?from?v$database;
SQL>?select?db_unique_name?from?v$database@expdp_primary;
SQL>?create?directory?datapump?as?‘/tmp’;
--?Use?NETWORK_LINK?to?database?link?above?to?connect?to?the?Physical?Standby?database.
expdp?system/password?directory=datapump?network_link=expdp_primary?full=y?dumpfile=standby_database.dmp?logfile=standby_database.log
總結(jié)
以上是生活随笔為你收集整理的怎么导出oracle库,【DG】怎么从Oracle备库导出数据的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: stl min函数_std :: min
- 下一篇: mysql saveorupdate_M