This topic describes the preparations required for you to disconnect a standby cluster. You must select a standby cluster and verify whether it meets the disconnection conditions before you can disconnect it.
Overview
You can select a standby cluster from the primary/standby clusters and delete the primary/standby relationship to disconnect the standby cluster from the primary cluster without affecting the online services.
Select a standby cluster
You must perform the following operation before you select a standby cluster to be disconnected.
Query the status of each standby cluster and select a standby cluster to be disconnected. Example:
obclient> SELECT CLUSTER_ROLE, SWITCHOVER_STATUS, PROTECTION_LEVEL FROM oceanbase.V$OB_CLUSTER;
+------------------+-------------------+---------------------+
| CLUSTER_ROLE | SWITCHOVER_STATUS | PROTECTION_LEVEL |
+------------------+-------------------+---------------------+
| PHYSICAL STANDBY | NOT ALLOWED | MAXIMUM PERFORMANCE |
+------------------+-------------------+---------------------+
1 row in set
Parameters:
CLUSTER_ROLE: the role of the cluster. The selected standby cluster must be in thePHYSICAL STANDBYrole.SWITCHOVER_STATUS: the switchover status of the cluster. Standby clusters in theSWITCHOVER SWITCHING,FAILOVER FLASHBACK, orFAILOVER CLEANUPstate cannot be disconnected by using the DISCONNECT statement.PROTECTION_LEVEL: the protection level of the cluster. The cluster at the protection level of MAXIMUM PERFORMANCE can be disconnected by using the DISCONNECT statement.To disconnect a standby cluster at another protection level, perform the following operation before you execute the DISCONNECT statement:
If the primary cluster is available and the protection level of the standby cluster is not MAXIMUM PERFORMANCE, the standby cluster is synchronizing logs with the primary cluster. To avoid the stop of data writes on the existing primary cluster after the disconnection, change the protection level of the standby cluster to MAXIMUM PERFORMANCE.
If the primary cluster is unavailable, specify the FORCE option in the DISCONNECT statement to force disconnect the standby cluster from the primary cluster.
Verify whether the standby cluster meets the disconnection conditions
Log on to the
systenant of the standby cluster to be disconnected with therootaccount.Create a new name for the standby cluster to be disconnected.
The new cluster name must be different from the name of the primary cluster.
Execute a statement to verify whether the cluster can be disconnected.
SQL syntax:
obclient> ALTER SYSTEM DISCONNECT STANDBY CLUSTER standby_cluster_name CLUSTER_ID standby_cluster_id SET CLUSTER_NAME standby_new_cluster_name OBCONFIG_URL config_url VERIFY;Parameters:
standby_cluster_name: the original name of the standby cluster to be disconnected. You can obtain the name by querying theV$OB_CLUSTERview.standby_cluster_id: the ID of the standby cluster to be disconnected. You can obtain the cluster ID by querying theV$OB_CLUSTERview.standby_new_cluster_name: the new name of the standby cluster after it is disconnected.config_url: the new value ofOBCONFIG_URLfor the standby cluster after it is disconnected.OBCONFIG_URLspecifies the URL of the OBConfig service.For more information about
OBCONFIG_URL, see obconfig_url.
If the execution of the statement is successful, the standby cluster can be disconnected. If the execution of the statement failed, the cause of the failure is returned. For more information about the failure message and solutions, see Standby cluster disconnection errors.