os: centos 7.4
database:12.2.0.1 + dbf
switchover
一般指的时正常情况下,人为执行的切换命令或者在符合某些条件执行的。不会丢失数据
failover
一般指的是实例失效的情况下,进行的故障转移。丢失的数据多少依赖配置的dg级别。
dataguard broker 手动 switchover
DGMGRL> show configuration;
Configuration - dgconf
Protection Mode: MaxPerformance
Members:
orclp - Primary database
orcls1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 26 seconds ago)
手动切换 master 到 orcls1
DGMGRL> switchover to orcls1;
Performing switchover NOW, please wait...
Operation requires a connection to database "orcls1"
Connecting ...
Connected to "orcls1"
Connected as SYSDBA.
New primary database "orcls1" is opening...
Operation requires start up of instance "rac01" on database "orclp"
Starting instance "rac01"...
ORACLE instance started.
Database mounted.
Database opened.
Connected to "orclp"
Switchover succeeded, new primary is "orcls1"
手动再次切换 master 到 orclp
DGMGRL> switchover to orclp;
Performing switchover NOW, please wait...
Operation requires a connection to database "orclp"
Connecting ...
Connected to "orclp"
Connected as SYSDBA.
New primary database "orclp" is opening...
Operation requires start up of instance "rac01" on database "orcls1"
Starting instance "rac01"...
ORACLE instance started.
Database mounted.
Database opened.
Connected to "orcls1"
Switchover succeeded, new primary is "orclp"
参考:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/high-availability.html