This topic describes how to restore the original primary cluster after a lossy failover.
After a lossy failover, data is inconsistent between the new primary cluster and the original primary cluster, and the original primary cluster cannot be connected. You need to rebuild the primary/standby relationship.
Procedure
Delete the original primary cluster or other standby clusters from the new primary cluster, and clear the data of the original primary cluster or other standby clusters.
You can run the following commands to delete clusters, and then manually clear the processes and data of the clusters.
In the new primary cluster, run the following command to query information about other clusters:
obclient> SELECT CLUSTER_ID, CLUSTER_ROLE, CLUSTER_STATUS FROM V$OB_STANDBY_STATUS; +-------------+-----------------------+-------------------+ | CLUSTER_ID | CLUSTER_ROLE | CLUSTER_STATUS | +-------------+-----------------------+-------------------+ | 1 | PHYSICAL STANDBY | DISABLED | +-------------+-----------------------+-------------------+ 1 row in setIn the new primary cluster, delete the information about other clusters.
obclient> ALTER SYSTEM REMOVE CLUSTER obcluster CLUSTER_ID = 1; Query OK, 0 rows affectedManually clear the processes and data of the other clusters.
Create a standby cluster on the servers hosting the other clusters and rebuild the primary/standby relationship.
Notice
After a lossy failover, the system will automatically initiate a major compaction. You need to wait for the major compaction to complete and then create a standby cluster.
You can run SQL commands to add a standby cluster. When you add a standby cluster, ensure that the cluster ID allocated to the standby cluster is unique. For more information, see Deploy a standby cluster by using SQL commands.
After the new standby cluster is synchronized in real time, switch the primary and standby roles.
For more information, see Switchover.