Oracle的data guard建立完成後,檢查v$database的protection_mode和protection_level的值。如protection_mode值是MAXIMUM AVAILABILITY,那麼protection_level值也應該是這個值。如果不是這個值,而是RESYNCHRONIZATION。這表示data guard的日誌同步是不正常的。
在備庫的alert.log中也可以看到這樣資訊:"Primary database is in MAXIMUM PERFORMANCE mode"。表示主庫其實是最大效能模式,而不是預先設定的最大可用模式。
Oracle的data guard在主庫設定為最大可用模式不能實現時,自動降級為最大效能模式。這樣的結果使得日誌同步不再即時。
檢查資料字典視圖v$database
SQL> r
1* select protection_mode,protection_level from v$database
PROTECTION_MODE PROTECTION_LEVEL
-------------------- --------------------
MAXIMUM AVAILABILITY RESYNCHRONIZATION
檢查資料庫初始化參數log_archive_dest*
SQL> show parameter log_archive_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1 string LOCATION=+VG2/
log_archive_dest_2 string service=oxdb_standby lgwr asyn
c affirm valid_for=(online_lo
gfiles,primary_role) db_unique
_name=oxdg
分析
Oracle的data guard有三種保護模式,分別為最大保護模式、最大可用模式、最大效能模式。
Minimum Requirements for Maximum Protection Mode
Redo Archival Process LGWR
Network Transmission Mode SYNC
Disk Write Option AFFIRM
Standby Redo Logs? Yes
Standby Database Type Physical Only
Minimum Requirements for Maximum Availability Mode
Redo Archival Process LGWR
Network Transmission Mode SYNC
Disk Write Option AFFIRM
Standby Redo Logs? Required for physical standby databases only. Standby redo logs are not supported for logical standby databases.
Standby Database Type Physical or Logical
Minimum Requirements for Maximum Performance Mode
Redo Archival Process LGWR or ARCH
Network Transmission Mode ASYNC when using LGWR process. Not applicable when using the ARCH process.
Disk Write Option NOAFFIRM
Standby Redo Logs? Required for physical standby databases using the LGWR process.
Standby Database Type Physical or Logical