【DataGuard】Oracle Dataguard三種保護模式特點總結

kunlunzhiying發表於2017-01-12
Oracle Dataguard提供了三種資料保護模式,在此分別總結一下三種資料保護模式的特點。

1.最大保護模式
1)這種模式提供了最高階別的資料保護能力;
2)要求至少一個物理備庫收到重做日誌後,主庫的事務才能夠提交;
3)主庫找不到合適的備庫寫入時,主庫會自動關閉,防止未受保護的資料出現;
4)優點:該模式可以保證備庫沒有資料丟失;
5)缺點:主庫的自動關閉會影響到主庫的可用性,同時需要備庫恢復後才能提交,對網路等客觀條件要求非常的高,主庫的效能會因此受到非常大的衝擊。

2.最大可用性模式
1)該模式提供了僅次於“最大保護模式”的資料保護能力;
2)要求至少一個物理備庫收到重做日誌後,主庫的事務才能夠提交;
3)主庫找不到合適的備庫寫入時,主庫不會關閉,而是臨時降低到“最大效能模式”模式,直到問題得到處理;
4)優點:該模式可以在沒有問題出現的情況下,保證備庫沒有資料丟失,是一種折中的方法;
5)缺點:在正常執行的過程中缺點是主庫的效能受到諸多因素的影響。

3.最大效能模式
1)該模式是預設模式,可以保證主資料庫的最高可用性;
2)保證主庫執行過程中不受備庫的影響,主庫事務正常提交,不因備庫的任何問題影響到主庫的執行;
4)優點:避免了備庫對主資料庫的效能和可用性影響;
5)缺點:如果與主庫提交的事務相關的恢復資料沒有傳送到備庫,這些事務資料將被丟失,不能保證資料無損失;


4.oracle官方文件中關於以上三種模式的描述

內容引用在此,供參考。
5.6.1.1  Maximum Protection Mode

This protection mode ensures that no data loss will occur if the primary database fails. To provide this level of protection, the redo data needed to recover each transaction must be written to both the local online redo log and to the standby redo log on at least one standby database before the transaction commits. To ensure data loss cannot occur, the primary database shuts down if a fault prevents it from writing its redo stream to at least one remote standby redo log. For multiple-instance RAC databases, Data Guard shuts down the primary database if it is unable to write the redo records to at least one properly configured database instance. The maximum protection mode requires that at least one standby instance has a standby redo log and the LGWR, SYNC, and AFFIRM attributes be used on the LOG_ARCHIVE_DEST_n parameter for this destination.
5.6.1.2 Maximum Availability Mode

This protection mode provides the highest level of data protection that is possible without compromising the availability of the primary database. Like maximum protection mode, a transaction will not commit until the redo needed to recover that transaction is written to the local online redo log and to at least one remote standby redo log. Unlike maximum protection mode, the primary database does not shut down if a fault prevents it from writing its redo stream to a remote standby redo log. Instead, the primary database operates in maximum performance mode until the fault is corrected and all gaps in redo log files are resolved. When all gaps are resolved, the primary database automatically resumes operating in maximum availability mode.

This mode ensures that no data loss will occur if the primary database fails, but only if a second fault does not prevent a complete set of redo data from being sent from the primary database to at least one standby database.

Like maximum protection mode, the maximum availability mode requires that you:

    * Configure standby redo log files on at least one standby database.
    * Set the SYNC, LGWR, and AFFIRM attributes of the LOG_ARCHIVE_DEST_n parameter for at least 1 standby database.

5.6.1.3 Maximum Performance Mode

This protection mode (the default) provides the highest level of data protection that is possible without affecting the performance of the primary database. This is accomplished by allowing a transaction to commit as soon as the redo data needed to recover that transaction is written to the local online redo log. The primary database's redo data stream is also written to at least one standby database, but that redo stream is written asynchronously with respect to the commitment of the transactions that create the redo data.

When network links with sufficient bandwidth are used, this mode provides a level of data protection that approaches that of maximum availability mode with minimal impact on primary database performance.

The maximum performance mode enables you to either set the LGWR and ASYNC attributes, or set the ARCH attribute on the LOG_ARCHIVE_DEST_n parameter for the standby database destination. If the primary database fails, you can reduce the amount of data that is not received on the standby destination by setting the LGWR and ASYNC attributes.

5.小結
在部署Oracle Dataguard時,需要充分考慮三種保護模式下對資料和效能的影響,以便趨利避害。具體環境具體分析,每一種資料保護模式都有其應用場合。預設的最大效能模式較常見,執行在該模式下的系統需要時刻注意備庫是否有日誌丟失,通常可以考慮“一主帶多備”(一套主庫對應多個備庫)的方法來保證日誌的完整性。

Good luck.

secooler
10.10.12

-- The End --

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28211342/viewspace-2132318/,如需轉載,請註明出處,否則將追究法律責任。

相關文章