The role switching between Data guard master and subordinate libraries is divided into the following two kinds:
1) Switchover
Swithchover are usually artificial and planned for role swaps, such as upgrades. It is usually lossless, that is, there will be no loss of data. Its implementation is mainly divided into two stages:
Primary to standby.
Standby (one) to primary
2) Failover
Failover means that because primary failure cannot be recovered for a short time, standby has to act as a primay role, which is likely to result in data loss if in the highest performance mode.
The following shows the physical standby switchover and failover (logical standby switching is similar).
1. Physical Standby Execution switchover
1 Confirm whether Pirmary can be switched to standby
Primary>select switchover_status from V$database;
Switchover_status
--------------------
To STANDBY
2) switch primary to standby
Primary>alter database commit to switchover to physical standby;
3) Starting the original primary to Mount state
At this time the original primary is to standby identity in operation.
4 Confirm whether standby can be switched to primary
Standby>select switchover_status from V$database;
Switchover_status
--------------------
To PRIMARY
5) switch standby to Primary
Standby>alter database commit to switchover to primary;
Database altered.
Standby>alter database open;
Database altered.
6) Verify
Primary>select database_role from V$database;
Database_role