Data Guard 10g 的保护级别为RESYNCHRONIZATION问题
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
解决
根据最大可用模式的最低要求,将log_archive_dest_2调整为lgwr sync affirm。
SQL> alter system set log_archive_dest_2='service=oxdb_standby lgwr sync affirm valid_for=(online_logfiles,primary_role) db_unique_name=oxdg'; System altered. SQL> alter system switch logfile; System altered.
检查protection_level的值,已经恢复正常。
SQL> select protection_mode,protection_level from v$database; PROTECTION_MODE PROTECTION_LEVEL -------------------- -------------------- MAXIMUM AVAILABILITY MAXIMUM AVAILABILITY
在备库的alert.log日志文件中:
Fri Nov 23 16:39:55 2012 Redo Shipping Client Connected as PUBLIC -- Connected User is Valid RFS[6]: Assigned to RFS process 20534 RFS[6]: Identified database type as 'physical standby' Primary database is in MAXIMUM PERFORMANCE mode Changing standby controlfile to MAXIMUM PERFORMANCE mode Primary database is in MAXIMUM PERFORMANCE mode RFS[6]: Successfully opened standby log 21: '+VG1/oxdb/standby_redo21.log'
我们能看到主库已经从最大性能模式自动转为最大可用模式。
上一篇: Excuse me?这个前端面试在搞事!