Recover physical standby database after loss of archive log(2)
前幾天一起和同事處理過一起歸檔丟失的dg,記錄一下:上次寫過一篇DG丟失歸檔後的處理過程,總體來說就是使用增量備份覆蓋gap資料從而跳過gap的archivelog 這裡再闡述另一種情況
[oracle@db61 orcl]$
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Jun 20 14:35:01 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SQL> recover standby database;
ORA-00279: change 40103914365 generated at 05/23/2012 09:26:36 needed for thread 3
ORA-00289: suggestion : /data/oracle/oradata/orcl/arch/3_8658_657561562.dbf
ORA-00280: change 40103914365 for thread 3 is in sequence #8658
Specify log: {<RET>=suggested | filename | AUTO | CANCEL} auto
ORA-00308: cannot open archived log '/data/oracle/oradata/orcl/arch/3_8658_657561562.dbf'
ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3
這個庫的大概情況為丟失了6月4號至今的所有歸檔,很容易想到使用standby 的current_scn去作為 起始scn增量備份,對於這裡的增量備份出現了一個有趣的現象。看上面的操作,可以知道還是需要scn為40103914365的歸檔檔案,but why ?既然已經使用增量備份recover database,這裡就不兜圈子了,DG開啟redo apply之後 oracle 會尋找file header最低的scn開始apply 我們可以查詢下當前的file header scn:
SQL> select file#,to_char(checkpoint_change#) from v$datafile_header;
FILE# TO_CHAR(CHECKPOINT_CHANGE#)
---------- ----------------------------------------
1 42501726792
2 42501726792
3 42501726801
4 42501726801
5 42501726801
6 42501726801
7 42501726792
8 40103914365
9 42501726792
10 42501726801
11 42501726801
...
看到file 8的scn正是oracle需要的scn 對應上面的操作:change 40103914365 generated at 05/23/2012 09:26:36 needed for thread 3 這裡的05/23/2012 09:26:36足以說明問題。檢視主庫的file 8檔案發現 change time 為 05/23/2012,從這裡可以說明file 8自從2012-05-23之後從來沒有change過,對於這種file – BLOCK change為0 ,也就是說change scn為上一次的05/23/2012 09:26:36之前的change scn,即所有的塊都不滿足以上條件,所以對於從6月4號開始的增量備份,oracle將忽略這個檔案的所有blocks從而導致recover之後file header checkpoint scn沒有發生變化,當開啟redo apply之後oracle仍然從最小的scn開始嘗試恢復,從而導致這個詭異的現象,當然這種極端情況是很少出現的,這裡我們可以採用rman copy這個file到standby端從而解決這個問題。
eg:
RMAN> copy datafile '+DATA/pri/datafile/udata01_16.dbf' to '/data/xxx.dbf';
4個小時之後DG 追上了16天的gap 恢復速度還是不錯的 總體來說通過增量備份恢復丟失歸檔的DG是一個很常規的手法 16天的歸檔>=4T 如果從帶庫恢復歸檔 將是一個漫長的過程
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/758322/viewspace-733651/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- Performing a Failover to a Physical Standby DatabaseORMAIDatabase
- Oracle DG建立Physical Standby DatabaseOracleDatabase
- Oracle 19c透過recover standby database from service修復GAP案例OracleDatabase
- Oracle Physical Database LimitsOracleDatabaseMIT
- 【DG】Data Guard搭建(physical standby)
- recover database using backup controlfile理解Database
- Setup Standby Database on One PC(轉)Database
- Oracle DG Standby Database型別OracleDatabase型別
- Oracle DG建立Logical Standby DatabaseOracleDatabase
- Oracle 12.2 physical standby備庫收集AWR報告Oracle
- Oracle 12.2 使用Database Link優化Standby Database WorkloadOracleDatabase優化
- 什麼叫archive log expired?Hive
- Archive log mining steps(logminer to html)HiveHTML
- log_archive_dest與log_archive_dest_n與USE_DB_RECOVERY_FILE_DESTHive
- Physical Standby Switchover_status Showing Not Allowed. (Doc ID 1392763.1)
- ORA-279 signalled during: alter database recover logfileDatabase
- [20230110]sql profile run standby database.txtSQLDatabase
- 搭建windows到linux的oracle 12c physical standby備庫WindowsLinuxOracle
- Oracle 12.2 ORA-01113 ORA-01110 recover after normal shutdownOracleORM
- 4 Creating a Logical Standby Database 建立邏輯備庫Database
- 17 LOG_ARCHIVE_DEST_n 引數屬性Hive
- 在Oracle DG Standby庫上啟用flashback database功能OracleDatabase
- 2 新增standby masterAST
- [20200114]關於log_archive_dest_1設定.txtHive
- [20200219]log_archive_dest_1定義問題.txtHive
- ORA-16024: parameter LOG_ARCHIVE_DEST_1 cannot be parsedHive
- You may fail to backup log or restore log after TDE certification/key rotation.AIREST
- Oracle RAC+DG 調整redo/standby log fileOracle
- 透過RMAN備份standby database成功恢復還原Database
- oracle12.2 adg ORA-46952: standby database format mismatch for password fileOracleDatabaseORM
- Bug 12725963 - New database connection fails with ORA-12541 after vip failoverDatabaseAI
- oracle ocp 19c考題8,科目082考試題-logical and physical database structuresOracleDatabaseStruct
- Oracle 12c DG備庫啟動報錯standby database requires recoveryOracleDatabaseUI
- [20181113]Logical Standby建立2.txt
- ORACLE 閃回檢視v$flashback_database_log/statOracleDatabase
- DATAGUARD手記(PRIMARY+2STANDBY)(一)
- DATAGUARD手記(PRIMARY+2STANDBY)(二)
- alter database disable thread 2Databasethread