單節點DG的failover切換介紹
一般我們在搭建DG的過程中,通常都會進行switchover和failover切換演練,不過對於客戶來說,他們更加註重failover切換演練,關心的東西才會關注。本章就簡單介紹下failover切換介紹
1、當生產庫異常當機了,在備庫上檢視是否有日誌GAP
1) 檢視是否有日誌GAP:
SQL> SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
no rows selected
2) 如果有,則複製過來
3) 手工的註冊這些日誌:
SQL> ALTER DATABASE REGISTER LOGFILE '路徑';
注:如果返回的有記錄,按照返回資訊對應的複製歸檔檔案到待轉換的standby伺服器。這一步非常重要,必須確保所有已生成的歸檔檔案均已存在於standby 伺服器,不然可能會資料不一致造成轉換時報錯
2、結束日誌apply
SQL> alter database recover managed standby database cancel; #停止歸檔日誌應用
3、停止接收日誌
SQL> alter database recover managed standby database finish force; #停止日誌接收,結束備庫活動著的RFS程式,以便執行failover切換
4、切換資料庫為primary
SQL> alter database commit to switchover to primary with session shutdown;
5、open資料庫
SQL> alter database open;
注:恢復備庫:recover standby database until cancel;啟用備庫:alter database activate standby database;
具體操作筆記:
SQL> SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
no rows selected
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database recover managed standby database finish force;
Database altered.
SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY TO PRIMARY
SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL> alter database open;
Database altered.
SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
---------------- --------------------
PRIMARY FAILED DESTINATION
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
beiku OPEN
SQL> select NAME,RESETLOGS_TIME,LOG_MODE,OPEN_MODE,PROTECTION_MODE,REMOTE_ARCHIVE,DATABASE_ROLE,SWITCHOVER_STATUS,FORCE_LOGGING from v$database;
NAME RESETLOGS LOG_MODE OPEN_MODE PROTECTION_MODE REMOTE_A DATABASE_ROLE SWITCHOVER_STATUS FOR
--------- --------- ------------ -------------------- -------------------- -------- ---------------- -------------------- ---
XUH 12-JUL-15 ARCHIVELOG READ WRITE MAXIMUM PERFORMANCE ENABLED PRIMARY FAILED DESTINATION YES
SQL>
1、當生產庫異常當機了,在備庫上檢視是否有日誌GAP
1) 檢視是否有日誌GAP:
SQL> SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
no rows selected
2) 如果有,則複製過來
3) 手工的註冊這些日誌:
SQL> ALTER DATABASE REGISTER LOGFILE '路徑';
注:如果返回的有記錄,按照返回資訊對應的複製歸檔檔案到待轉換的standby伺服器。這一步非常重要,必須確保所有已生成的歸檔檔案均已存在於standby 伺服器,不然可能會資料不一致造成轉換時報錯
2、結束日誌apply
SQL> alter database recover managed standby database cancel; #停止歸檔日誌應用
3、停止接收日誌
SQL> alter database recover managed standby database finish force; #停止日誌接收,結束備庫活動著的RFS程式,以便執行failover切換
4、切換資料庫為primary
SQL> alter database commit to switchover to primary with session shutdown;
5、open資料庫
SQL> alter database open;
注:恢復備庫:recover standby database until cancel;啟用備庫:alter database activate standby database;
具體操作筆記:
SQL> SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
no rows selected
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database recover managed standby database finish force;
Database altered.
SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY TO PRIMARY
SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL> alter database open;
Database altered.
SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
---------------- --------------------
PRIMARY FAILED DESTINATION
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
beiku OPEN
SQL> select NAME,RESETLOGS_TIME,LOG_MODE,OPEN_MODE,PROTECTION_MODE,REMOTE_ARCHIVE,DATABASE_ROLE,SWITCHOVER_STATUS,FORCE_LOGGING from v$database;
NAME RESETLOGS LOG_MODE OPEN_MODE PROTECTION_MODE REMOTE_A DATABASE_ROLE SWITCHOVER_STATUS FOR
--------- --------- ------------ -------------------- -------------------- -------- ---------------- -------------------- ---
XUH 12-JUL-15 ARCHIVELOG READ WRITE MAXIMUM PERFORMANCE ENABLED PRIMARY FAILED DESTINATION YES
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30310891/viewspace-1730571/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 單節點DG的switchover切換介紹
- 【DATAGUARD】物理dg的failover切換(六)AI
- ROSE HA切換節點導致DG失敗、恢復ROS
- RAC+單例項DG的切換單例
- DG的切換操作
- 物理DG角色轉換: failoverAI
- 單例項DG切換中的虛擬IP單例
- 主備切換(failover)AI
- javascript DOM元素節點操作簡單介紹JavaScript
- Dataguard failover切換實驗AI
- 邏輯DG主備庫轉換的failoverAI
- Zookeeper 節點特性介紹
- RAC環境STANDBY的FAILOVER切換AI
- DATA GUARD物理STANDBY的FAILOVER切換AI
- mongodb叢集節點故障的切換方法MongoDB
- dg切換操作文件
- oracle dg切換操作示例Oracle
- 【DG】三大模式切換模式
- oracle 11g dg broker 開啟fast-start failover自動故障切換OracleASTAI
- 【DATAGUARD】物理dg配置客戶端無縫切換 (八.2)--Fast-Start Failover 的配置客戶端ASTAI
- 【DATAGUARD】物理dg的switchover切換(五)
- 使用Broker實現DG切換
- Oracle RAC DG手動切換Oracle
- DG_三大模式切換模式
- 簡單介紹Vue實現滑鼠懸浮切換圖片srcVue
- dataguard之物理standby庫failover 切換AI
- Oracle Failover - TAF 透明應用切換OracleAI
- 物理Standby角色切換作業failoverAI
- dg搭建 單點-單點
- 【DG】DG之Switchover和Failover的區別AI
- RAC環境LOGICAL STANDBY的FAILOVER切換AI
- rhel6.4-11.2.0.3-RAC搭建單節點DG
- Hadoop-HA節點介紹Hadoop
- javascript的節點相關內容介紹JavaScript
- DG 進行failoverAI
- FAILOVER後DG的重新搭建AI
- DKHhadoop新增新節點功能介紹Hadoop
- javascript節點型別詳細介紹JavaScript型別