Oracle DataGuard歸檔日誌丟失處理方法
問題描述
9.3日dg備庫異常關閉,9.17日主庫磁碟空間滿,刪除了歸檔日誌,導致備庫丟失了9.3號到9.17號得歸檔日誌,所以當9.24日啟動備庫時報錯
ORA-10458: standby database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: '/u01/oracle/oradata/system/system01.dbf'
解決辦法:
1、在主庫備份控制檔案
backup current controlfile for standby format '/archivelog/0924_ctl_%U.bka'
2、已備庫得最大SCN號在主庫備份
在備庫上執行
select name,to_char(checkpoint_change#) from v$datafile order by checkpoint_change#;
NAME TO_CHAR(CHECKPOINT_CHANGE#)
----------------------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/TBSP_STAT_DATA_202009_01.dbf 446416908432
3、在主庫上執行備份語句
rman target /
run
{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
allocate channel c5 device type disk;
backup as compressed backupset incremental from scn 446416908432 database format '/archivelog/0924_%U.bka' tag 'forstandby';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
4、把生成得備份檔案都傳到備庫上
scp 0924* x.x.x.x:/tmp/
5、
這時候我們需要關閉備庫,然把把例項啟動到nomount關態
STANDBY> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
STANDBY> startup nomount;
ORACLE instance started.
Total System Global Area 1224736768 bytes
Fixed Size 2923824 bytes
Variable Size 939524816 bytes
Database Buffers 268435456 bytes
Redo Buffers 13852672 bytes
6、在備庫上執行restore,先恢復控制檔案,在恢復資料檔案
rman target / nocatalog
RMAN> restore standby controlfile from '/tmp/0924_ctl_0rr22q7u_1_1.dbf';
Starting restore at 03-APR-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=DISK
............................................
很快控制檔案就了恢復完成了,我們開啟另一個視窗,通過sqlplus把備庫以standby的方式mount起來
STANDBY> alter database mount;
恢復資料檔案
先註冊一下備份檔案
rman> catalog start with '/tmp';
開始恢復
run
{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
allocate channel c5 device type disk;
recover database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
7、啟動備庫同步
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database disconnect from session using current logfile;
Database altered.
select process,client_process,sequence#,status from v$managed_standby;
PROCESS CLIENT_P SEQUENCE# STATUS
--------- -------- ---------- ------------
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
ARCH ARCH 0 CONNECTED
RFS ARCH 0 IDLE
RFS LGWR 33 IDLE
MRP0 N/A 33 WAIT_FOR_LOG
現在我們檢視備庫狀態,MRP程式已經開始最新的日誌應用了.到此我們通過增量SCN備份和恢復來修復
備庫歸檔日誌丟失的過程已經全部完成了.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30166976/viewspace-2724007/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 非歸檔下日誌檔案丟失的處理辦法
- Oracle資料庫聯機日誌檔案丟失處理方法(1)Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(3)Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(2)Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(4)Oracle資料庫
- Oracle資料庫聯機日誌檔案丟失處理方法(5)Oracle資料庫
- Oracle聯機日誌檔案丟失或損壞的處理方法Oracle
- Oracle資料庫聯機日誌檔案丟失處理方法(總結)!Oracle資料庫
- ORACLE聯機日誌檔案丟失或損壞的處理方法(轉)Oracle
- Oracle聯機日誌檔案丟失或損壞的處理方法 (轉)Oracle
- Oracle_dg歸檔丟失問題處理Oracle
- Oracle資料庫聯機日誌檔案丟失處理方法(總結)(轉)Oracle資料庫
- [原創] Oracle資料庫聯機日誌檔案丟失處理方法(總結)!Oracle資料庫
- 歸檔模式下的日誌檔案丟失的解決方法模式
- 使用RMAN增量備份處理Dataguard因歸檔丟失造成的gap
- 非歸檔丟失日誌檔案的恢復
- oracle歸檔日誌丟失後的資料庫恢復Oracle資料庫
- 記一次Oracle 聯機日誌檔案丟失的處理方案Oracle
- oracle dataguard 自動刪除歸檔日誌Oracle
- 控制檔案丟失處理方法
- OGG整合抽取模式丟失歸檔處理模式
- 在歸檔模式下丟失日誌檔案的恢復模式
- ORACLE DATAGUARD中手工處理日誌v$archive_GAP的方法OracleHive
- 聯機日誌檔案丟失解決方法
- 【redo】日誌檔案的丟失解決方法
- 丟失已歸檔日誌檔案下恢復資料庫資料庫
- oracle丟失日誌檔案的恢復( 轉)Oracle
- 在DATAGUARD中手工處理日誌GAP的方法
- Oracle聯機日誌檔案丟失解決方法一例Oracle
- oracle歸檔日誌Oracle
- Oracle 歸檔日誌Oracle
- 【備份恢復】恢復 丟失已歸檔重做日誌檔案
- 聯機日誌檔案丟失解決方法(二)
- 聯機日誌檔案丟失解決方法(一)
- DATAGUARD中手工處理日誌GAP
- dataguard 歸檔丟失,備庫基於SCN恢復
- ORACLE 11G DATAGUARD 日誌中斷處理方案Oracle
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle