os: centos 7.4
db: oracle 12.1.0.2
一旦开始使用Broker,就必须一直使用它修改DG的配置,如果使用sqlplus修改配置,broker会将配置改回原样,或者导致broker配置参数与数据库之间不一致.
DGMGRL> create configuration dgconf as primary database is orclp connect identifier is tns_orclp_dgmgrl;
DGMGRL> add database orcls1 as connect identifier is tns_orcls1_dgmgrl;
DGMGRL> show configuration;
DGMGRL> show configuration verbose;
DGMGRL> enable configuration;
DGMGRL> disable configuration;
DGMGRL> remove configuration;
DGMGRL> show database orclp;
DGMGRL> show database orcls1;
DGMGRL> show database verbose orclp;
DGMGRL> show database verbose orcls1;
DGMGRL> show database verbose orclp statusreport;
DGMGRL> show database verbose orcls1 statusreport;
DGMGRL> show database orclp InconsistentProperties;
DGMGRL> show database orcls1 InconsistentProperties;
DGMGRL> edit configuration set property FastStartFailoverThreshold='120';
DGMGRL> edit configuration set protection mode as maxprotection;
DGMGRL> edit configuration set protection mode as maxavailability;
DGMGRL> edit configuration set protection mode as maxperformance;
DGMGRL> edit database orclp set property StandbyArchiveLocation ='';
DGMGRL> edit database orclp set property LogXptMode ='SYNC';
DGMGRL> edit database orclp set property LogXptMode ='ASYNC';
DGMGRL> edit database orcls2 set property DelayMins=120;
DGMGRL> edit database orcls2 set property ApplyLagThreshold=7500;
DGMGRL> edit database orclp set property DbFileNameConvert ='+DG_DATA01/ORCLS1/, +DG_DATA01/ORCLP/, +DG_FRA/ORCLS1/, +DG_FRA/ORCLP/';
DGMGRL> edit database orclp set property LogFileNameConvert='+DG_DATA01/ORCLS1/, +DG_DATA01/ORCLP/, +DG_FRA/ORCLS1/, +DG_FRA/ORCLP/';
DGMGRL> show fast_start failover;
DGMGRL> enable fast_start failover;
DGMGRL> disable fast_start failover;
DGMGRL> start observer;
DGMGRL> stop observer;
下面是在 standby 库上常用的命令
SQL> alter database recover managed standby database cancel;
SQL> alter database flashback on;
SQL> alter database recover managed standby database using current logfile disconnect from session;
SQL> alter database open read only;