版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/ctypyb2002/article/details/86689488
oracle dataguard 提供如下三种保护模式:
最大保护:maximize protection
最高可用:maximize availability
最高性能:maximize performance
默认的是 最高性能 模式,该模式数据保护能力有限,适合允许有一定数据丢失的数据库.
除此以外,都应该为 最高可用 或者 最大保护 模式.
show configuration
DGMGRL> show configuration;
Configuration - dgconf
Protection Mode: MaxPerformance
Members:
orcls1 - Primary database
orclp - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS (status updated 16 seconds ago)
查看数据库
DGMGRL> show database orcls1;
Database - orcls1
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
orcl
Database Status:
SUCCESS
DGMGRL> show database orclp;
Database - orclp
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Average Apply Rate: 2.00 KByte/s
Real Time Query: ON
Instance(s):
orcl
Database Status:
SUCCESS
disable fast_start failover
修改前需要先停止 fast-start failover
DGMGRL> stop observer;
Done.
DGMGRL> disable fast_start failover;
Disabled.
升级 MaxPerformance => MaxAvailability
开始调整
DGMGRL> edit database orclp set property LogXptMode ='SYNC';
DGMGRL> edit database orcls1 set property LogXptMode ='SYNC';
DGMGRL> edit configuration set protection mode as maxavailability;
修改成功
DGMGRL> show configuration;
Configuration - dgconf
Protection Mode: MaxAvailability
Members:
orcls1 - Primary database
orclp - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 44 seconds ago)
升级 MaxAvailability => MaxProtection
DGMGRL> edit database orclp set property LogXptMode ='SYNC';
DGMGRL> edit database orcls1 set property LogXptMode ='SYNC';
DGMGRL> edit configuration set protection mode as maxprotection;
修改成功
DGMGRL> show configuration;
Configuration - dgconf
Protection Mode: MaxProtection
Members:
orcls1 - Primary database
orclp - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 17 seconds ago)
MaxProtection 是最高级别了,如果确认在 MaxProtection 模式下运行,最好确保至少两个 slave.
降级 MaxProtection => MaxAvailability
DGMGRL> edit configuration set protection mode as maxavailability;
降级 MaxAvailability => MaxPerformance
DGMGRL> edit configuration set protection mode as maxperformance;
MaxPerformance 是最低级别了,为了进一步提升主库的性能,可以修改为 ASYNC.
DGMGRL> edit database orclp set property LogXptMode ='ASYNC';
DGMGRL> edit database orcls1 set property LogXptMode ='ASYNC';
参考: