Oracle數(shù)據(jù)庫RMAN不完全恢復(fù)之基于SCN恢復(fù)
作者:aqszhuaihuai
本文我們主要介紹了Oracle數(shù)據(jù)庫RMAN不完全恢復(fù)之基于SCN恢復(fù)的相關(guān)知識,希望能夠?qū)δ兴鶐椭?/div>
之前我們介紹了:Oracle數(shù)據(jù)庫RMAN不完全恢復(fù)之基于時間恢復(fù),本文我們介紹一下Oracle數(shù)據(jù)庫RMAN不完全恢復(fù)的基于SCN恢復(fù)的相關(guān)知識,希望能夠?qū)δ兴鶐椭?/p>
基于SCN恢復(fù)是指當(dāng)出現(xiàn)用戶錯誤(例如誤刪除表、誤截斷表)時,恢復(fù)到指定SCN點(diǎn)的恢復(fù)。
模擬誤刪除表t_user。
執(zhí)行rman,啟動數(shù)據(jù)庫到mount狀態(tài)。
使用set until scn命令指定要恢復(fù)到的scn點(diǎn)。
轉(zhuǎn)儲、恢復(fù)數(shù)據(jù)庫,并使用resetlogs選項打開數(shù)據(jù)庫。
--模擬誤刪除表t_user。
- SQL> select count(*) from t_user;
- COUNT(*)
- ----------
- 2
- SQL> insert into t_user select 'spring mvc_' from dual;
- 1 row created.
- SQL> commit;
- Commit complete.
- SQL> alter system switch logfile;
- System altered.
- SQL> alter system checkpoint;
- System altered.
- SQL> select current_scn from v$database;
- CURRENT_SCN
- -----------
- 1214281
- SQL> drop table t_user;
- Table dropped.
--恢復(fù)
- [oracle@localhost ~]$ rman target sys/oracle@oralife nocatalog
- RMAN> run {
- 2> startup force mount;
- 3> set until scn=1214281;
- 4> restore database;
- 5> recover database;
- 6> sql 'alter database open resetlogs';
- 7> }
--已恢復(fù)
- SQL> select count(*) from t_user;
- COUNT(*)
- ----------
- 3
在實(shí)際環(huán)境下,應(yīng)該使用LogMiner確定誤操作SCN點(diǎn)。
在執(zhí)行了不完全恢復(fù)之后,推薦刪除早期所有備份,重新備份數(shù)據(jù)庫。
以上就是Oracle數(shù)據(jù)庫RMAN不完全恢復(fù)之基于SCN恢復(fù)的全部內(nèi)容,本文我們就介紹到這里了,希望本次的介紹能夠?qū)δ兴斋@!
【編輯推薦】
責(zé)任編輯:趙鵬
來源:
CSDN博客


相關(guān)推薦




