Oracle 11g Data guard 物理備庫故障恢復重建例項
--環境
主庫:雙節點RAC
備庫:單例項資料庫
故障描述:
物理備庫的資料盤、線上日誌盤、歸檔日誌盤出現大量壞塊,裡面的資料和主庫不一致;格式化備庫的資料盤後,需要重建物理備庫。
恢復重建流程:
1、複製主庫的0級備份和0級備份之後全部的歸檔日誌備份到備庫,在備庫裡面註冊
catalog start with '/ORADATA/bk';
檢查備份檔案和歸檔日誌的狀態,刪除不存在的備份和歸檔日誌
CROSSCHECK BACKUP;
CROSSCHECK ARCHIVELOG ALL;
DELETE EXPIRED BACKUP;
delete expired archivelog all;
2、將備庫啟動到MOUNT狀態,執行RESTORE命令重建資料檔案
RESTORE DATABASE;
3、由於線上日誌檔案盤損壞,需要重建線上日誌
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------------------------------------- ---
1 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_1_cnfrvovo_.log NO
1 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_1_cnfrvpbb_.log NO
2 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_2_cnfrs851_.log NO
2 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_2_cnfrs8kp_.log NO
3 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_3_cnfrlx8d_.log NO
3 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_3_cnfrlxp1_.log NO
4 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_4_cnfrxstd_.log NO
4 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_4_cnfrxt8y_.log NO
5 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_5_cnfrzbq4_.log NO
5 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_5_cnfrzc55_.log NO
6 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_6_cnfs196l_.log NO
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------------------------------------- ---
6 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_6_cnfs19mz_.log NO
7 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_7_cnfs2h63_.log NO
7 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_7_cnfs2hms_.log NO
8 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_8_cnfs4hnv_.log NO
8 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_8_cnfs4j36_.log NO
10 STANDBY /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_10_cnfsc27n_.log NO
10 STANDBY /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_10_cnfsc2o0_.log NO
14 STANDBY /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_14_cnfsc6m6_.log NO
14 STANDBY /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_14_cnfsc70p_.log NO
手動建立出檢視裡面的日誌檔案,例如
touch /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_1_cnfrvovo_.log
touch /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_1_cnfrvpbb_.log
清空日誌組
alter database drop logfile group 1;
4、恢復歸檔日誌
RUN
{
SET ARCHIVELOG DESTINATION TO '/ORADATA/arc/';
RESTORE ARCHIVELOG FROM SEQUENCE 27345 UNTIL SEQUENCE 27392 thread 1;
RESTORE ARCHIVELOG FROM SEQUENCE 9587 UNTIL SEQUENCE 9658 thread 2;
}
5、應用日誌
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
6、應用日誌完成後,開啟資料庫
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER DATABASE OPEN;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
主庫:雙節點RAC
備庫:單例項資料庫
故障描述:
物理備庫的資料盤、線上日誌盤、歸檔日誌盤出現大量壞塊,裡面的資料和主庫不一致;格式化備庫的資料盤後,需要重建物理備庫。
恢復重建流程:
1、複製主庫的0級備份和0級備份之後全部的歸檔日誌備份到備庫,在備庫裡面註冊
catalog start with '/ORADATA/bk';
檢查備份檔案和歸檔日誌的狀態,刪除不存在的備份和歸檔日誌
CROSSCHECK BACKUP;
CROSSCHECK ARCHIVELOG ALL;
DELETE EXPIRED BACKUP;
delete expired archivelog all;
2、將備庫啟動到MOUNT狀態,執行RESTORE命令重建資料檔案
RESTORE DATABASE;
3、由於線上日誌檔案盤損壞,需要重建線上日誌
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------------------------------------- ---
1 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_1_cnfrvovo_.log NO
1 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_1_cnfrvpbb_.log NO
2 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_2_cnfrs851_.log NO
2 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_2_cnfrs8kp_.log NO
3 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_3_cnfrlx8d_.log NO
3 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_3_cnfrlxp1_.log NO
4 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_4_cnfrxstd_.log NO
4 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_4_cnfrxt8y_.log NO
5 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_5_cnfrzbq4_.log NO
5 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_5_cnfrzc55_.log NO
6 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_6_cnfs196l_.log NO
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------------------------------------- ---
6 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_6_cnfs19mz_.log NO
7 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_7_cnfs2h63_.log NO
7 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_7_cnfs2hms_.log NO
8 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_8_cnfs4hnv_.log NO
8 ONLINE /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_8_cnfs4j36_.log NO
10 STANDBY /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_10_cnfsc27n_.log NO
10 STANDBY /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_10_cnfsc2o0_.log NO
14 STANDBY /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_14_cnfsc6m6_.log NO
14 STANDBY /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_14_cnfsc70p_.log NO
touch /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_1_cnfrvovo_.log
touch /ORADATA/redolog/GTFDBDG/onlinelog/o1_mf_1_cnfrvpbb_.log
清空日誌組
alter database drop logfile group 1;
4、恢復歸檔日誌
RUN
{
SET ARCHIVELOG DESTINATION TO '/ORADATA/arc/';
RESTORE ARCHIVELOG FROM SEQUENCE 27345 UNTIL SEQUENCE 27392 thread 1;
RESTORE ARCHIVELOG FROM SEQUENCE 9587 UNTIL SEQUENCE 9658 thread 2;
}
5、應用日誌
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
6、應用日誌完成後,開啟資料庫
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER DATABASE OPEN;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2107601/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11g Data guard 物理備庫應急切換(failover)後原有主庫的重建(通過RMAN恢復)OracleAI
- 搭建Oracle Data Guard 11g(物理備用)Oracle
- Oracle 11g Data Guard 物理備庫快速配置指南(上)Oracle
- Oracle 11g Data guard 物理備庫應急切換(failover)流程OracleAI
- Oracle 11g Data guard 物理主備庫正常切換(switchover)流程Oracle
- 使用Data Guard Broker進行Data Guard物理備用庫配置(Oracle 19c)Oracle
- Oracle 11g 例項恢復Oracle
- Oracle 11g RAC Data Guard 物理standby 建立Oracle
- Oracle 11g Data Guard 物理備庫開啟日誌延時應用流程Oracle
- Data guard 配置之搭建物理備庫
- DATA GUARD物理備庫的SWITCHOVER切換
- 【ASK_ORACLE】Oracle Data Guard(二)物理備庫的概念和優勢Oracle
- 總結11g 物理data guard
- 恢復案例:熱備期間例項故障解決
- 物理data guard備standby庫的時候報錯。
- 【DataGuard】Oracle 11g物理Data Guard之Snapshot Standby資料庫功能Oracle資料庫
- Oracle 12c Data guard 物理備庫應急切換(failover)流程OracleAI
- Oracle 12c Data guard 物理主備庫正常切換(switchover)流程Oracle
- Oracle例項恢復Oracle
- Data Guard高階玩法:通過閃回恢復failover備庫AI
- 【轉】【DataGuard】Oracle 11g物理Data Guard之Snapshot Standby資料庫功能Oracle資料庫
- Oracle11g Data Guard 暫停物理備庫的日誌傳輸Oracle
- Data Guard物理備庫read/write後,切換回備庫狀態
- Oracle 11g Data GuardOracle
- 9 Oracle Data Guard 故障診斷Oracle
- ZT:oracle10g Data Guard新特性:物理備庫也可以read/writeOracle
- oracle 10g物理data guard 操作Oracle 10g
- Oracle例項恢復和介質恢復Oracle
- Oracle Data Guard主庫備庫角色切換(Switchovers)Oracle
- Oracle 11g Data Guard Enabling Active Data GuardOracle
- oracle 11g之物理備庫管理Oracle
- Oracle例項恢復機制Oracle
- Oracle 例項恢復詳解Oracle
- 物理DG!Oracle 10G Data Guard DemoOracle 10g
- oracle database 例項恢復和介質恢復OracleDatabase
- 一次dataguard備份恢復到單例項的故障記錄單例
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項OracleLinux
- 【DataGuard】使用Grid Control調整Oracle物理Data Guard備庫為Read OnlyOracle