Purpose
You can use this statement to switch the roles between the primary cluster and a standby cluster in a lossless manner.
In maximum protection and maximum availability modes, the primary cluster must be configured in SYNC mode before switchover so that at least one standby cluster is in SYNC mode after the switchover.
Before switchover, check whether the cluster can be switched based on the SWITCHOVER_STATUS column in the V$OB_CLUSTER view. NOT ALLOWED or another value indicates that the switchover condition is not met.
obclient> SELECT SWITCHOVER_STATUS, SWITCHOVER_INFO FROM V$OB_CLUSTER;
+-------------------+------------------------------+
| SWITCHOVER_STATUS | SWITCHOVER_INFO |
+-------------------+------------------------------+
| TO STANDBY | SYNCED STANDBY CLUSTERS: 2,3 |
+-------------------+------------------------------+
Syntax
ALTER SYSTEM commit_switchover_clause;
commit_switchover_clause:
COMMIT TO SWITCHOVER TO PRIMARY
| COMMIT TO SWITCHOVER TO PHYSICAL STANDBY
Parameters
| Parameter | Description |
|---|---|
| COMMIT TO SWITCHOVER TO PRIMARY | Switches a standby cluster to the primary role. |
| COMMIT TO SWITCHOVER TO PHYSICAL STANDBY | Switches the primary cluster to the standby role. |
Examples
Switch the primary cluster to the standby role.
obclient> ALTER SYSTEM COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;Switch a standby cluster to the primary role.
obclient> ALTER SYSTEM COMMIT TO SWITCHOVER TO PRIMARY;