Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support the arbitration service.
You can enable the arbitration service for a tenant when you create the tenant. For more information, see Create a tenant. If the arbitration service is not enabled for a tenant, you can enable it after the tenant is created. This topic describes how to enable the arbitration service for an existing tenant.
Prerequisites
Make sure that the arbitration service is deployed in the current cluster. For more information, see Deploy an OceanBase cluster with two replicas and the arbitration service.
Before you enable the arbitration service, make sure that the Locality of the tenant to be enabled is 2F or 4F. At present, the arbitration service can be enabled only for tenants whose Locality is 2F or 4F.
Note
The arbitration service can be enabled only for tenants whose Locality contains two F replicas. The number of R replicas in the Locality of a tenant does not affect whether the arbitration service can be enabled. For example, the arbitration service can be enabled for a tenant whose Locality is
F@z1,F@z2orF@z1,F@z2,R@z3.
Procedure
Log in to the
systenant of the cluster as therootuser.The following example shows how to connect to the database. Please replace the placeholders with actual values in your environment.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AFor more information about how to connect to the database, see Overview of database connections (MySQL mode) and Overview of database connections (Oracle mode).
Execute the following command to view the connectivity status of nodes in the cluster.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.GV$OB_ARBITRATION_SERVICE_STATUS;The query result is as follows.
+----------------+----------+-----------------------------+----------+ | SVR_IP | SVR_PORT | ARBITRATION_SERVICE_ADDRESS | STATUS | +----------------+----------+-----------------------------+----------+ | xx.xx.xx.197 | 2882 | xx.xx.xx.192:2882 | ACTIVE | | xx.xx.xx.194 | 2882 | xx.xx.xx.192:2882 | ACTIVE | +----------------+----------+-----------------------------+----------+ 2 rows in setThe value of the
STATUScolumn indicates the connectivity status of a node with the arbitration service:ACTIVE: indicates that the arbitration service can communicate with the node. The arbitration service can be enabled for a tenant only when all nodes are in theACTIVEstate.INACTIVE: indicates that the arbitration service cannot communicate with the node. The arbitration service cannot be enabled for the tenant. Check the network connectivity between the node and the arbitration service.
Execute the following command to view the status of the arbitration service for the tenant.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TENANTS WHERE tenant_name = 'oracle001'\GThe query result is as follows.
*************************** 1. row *************************** TENANT_ID: 1004 TENANT_NAME: oracle001 TENANT_TYPE: USER CREATE_TIME: 2026-01-26 19:40:21.457857 MODIFY_TIME: 2026-01-27 13:51:47.053502 PRIMARY_ZONE: zone1;zone2 LOCALITY: FULL{1}@zone1, FULL{1}@zone2 PREVIOUS_LOCALITY: NULL COMPATIBILITY_MODE: ORACLE STATUS: NORMAL IN_RECYCLEBIN: NO LOCKED: NO TENANT_ROLE: PRIMARY SWITCHOVER_STATUS: NORMAL SWITCHOVER_EPOCH: 0 SYNC_SCN: 1687845116605766616 REPLAYABLE_SCN: 1687845116605766616 READABLE_SCN: 1687845116605766616 RECOVERY_UNTIL_SCN: 4611686018427387903 LOG_MODE: NOARCHIVELOG ARBITRATION_SERVICE_STATUS: DISABLED UNIT_NUM: 1 ZONE_UNIT_NUM_LIST: zone1:1,zone2:1 COMPATIBLE: 4.6.0 MAX_LS_ID: 1002 RESTORE_DATA_MODE: NORMAL FLASHBACK_LOG_SCN: NULL COMMENT: 1 row in setThe arbitration service of a tenant can be in one of the following states:
ENABLED: indicates that the arbitration service is enabled for the tenant.DISABLED: indicates that the arbitration service is disabled for the tenant.ENABLING: indicates that the arbitration service is being enabled for the tenant.DISABLING: indicates that the arbitration service is being disabled for the tenant.
The query result shows that the
ARBITRATION_SERVICE_STATUScolumn isDISABLED, which indicates that the arbitration service is disabled for the tenant.For more information about the
DBA_OB_TENANTSview, see DBA_OB_TENANTS.Execute the following command to enable the arbitration service for the tenant.
The statement is as follows:
ALTER TENANT tenant_name [SET] ENABLE_ARBITRATION_SERVICE = true;In this statement,
tenant_namespecifies the name of the tenant for which you want to enable the arbitration service, andSETis an optional keyword.The following example shows how to enable the arbitration service for the
oracle001tenant.obclient(root@sys)[oceanbase]> ALTER TENANT oracle001 ENABLE_ARBITRATION_SERVICE = true;After the command is executed, query the
DBA_OB_TENANTSview again to confirm whether the arbitration service is enabled for the tenant.obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TENANTS WHERE tenant_name = 'oracle001'\GThe query result is as follows.
*************************** 1. row *************************** TENANT_ID: 1004 TENANT_NAME: oracle001 TENANT_TYPE: USER CREATE_TIME: 2026-01-26 19:40:21.457857 MODIFY_TIME: 2026-01-27 13:51:47.053502 PRIMARY_ZONE: zone1;zone2 LOCALITY: FULL{1}@zone1, FULL{1}@zone2 PREVIOUS_LOCALITY: NULL COMPATIBILITY_MODE: ORACLE STATUS: NORMAL IN_RECYCLEBIN: NO LOCKED: NO TENANT_ROLE: PRIMARY SWITCHOVER_STATUS: NORMAL SWITCHOVER_EPOCH: 0 SYNC_SCN: 1687845116605766616 REPLAYABLE_SCN: 1687845116605766616 READABLE_SCN: 1687845116605766616 RECOVERY_UNTIL_SCN: 4611686018427387903 LOG_MODE: NOARCHIVELOG ARBITRATION_SERVICE_STATUS: ENABLED UNIT_NUM: 1 ZONE_UNIT_NUM_LIST: zone1:1,zone2:1 COMPATIBLE: 4.6.0 MAX_LS_ID: 1002 RESTORE_DATA_MODE: NORMAL FLASHBACK_LOG_SCN: NULL COMMENT: 1 row in setThe query result shows that the
ARBITRATION_SERVICE_STATUScolumn isENABLED, which indicates that the arbitration service is enabled for the tenant.After the arbitration service is enabled, some log streams of the tenant may still lack arbitration members. These log streams cannot be upgraded or downgraded. You can perform the following steps to confirm this.
When the arbitration service is enabled for a tenant, all log streams created at that time can use the arbitration service. However, log streams created after the arbitration service is enabled may lack arbitration members. This is because the creation of log streams is not strictly enforced, and the arbitration members may not be created successfully. Therefore, you can use the following statement to check whether all log streams of the tenant have arbitration members.
The statement is as follows:
(SELECT distinct ls_id FROM GV$OB_LOG_STAT WHERE tenant_id = tenantid) EXCEPT (SELECT ls_id FROM GV$OB_LOG_STAT WHERE tenant_id = tenantid AND role = 'LEADER' AND arbitration_member = 'arb_server_ip:arb_server_port');The parameters are described as follows:
tenantid: specifies the tenant ID of the tenant for which you want to enable the arbitration service.arb_server_ip: specifies the IP address of the arbitration service.arb_server_port: specifies the RPC port of the arbitration service. The default value is 2882.
The following example shows how to execute the statement.
obclient(root@sys)[oceanbase]> (SELECT distinct ls_id FROM GV$OB_LOG_STAT WHERE tenant_id = 1004) EXCEPT (SELECT ls_id FROM GV$OB_LOG_STAT where tenant_id = 1004 and role = 'LEADER' and arbitration_member = '100.xx.xx.xx:2882');If the query result is empty, all log streams have arbitration members, and the arbitration service is available. If the query result is not empty, the Root Service will automatically add arbitration members to these log streams. You can query the
CDB_OB_LS_ARB_REPLICA_TASKSview to check whether there are ongoing tasks for adding arbitration members. If such tasks exist and are ongoing, wait for them to complete.After the tasks for adding arbitration members are completed, you can query the
CDB_OB_LS_ARB_REPLICA_TASK_HISTORYview to check the task results. If the tasks are successful, the log streams have arbitration members, and the arbitration service is available. If the tasks fail, contact OceanBase support for assistance.For more information about the fields in the
GV$OB_LOG_STATview, see GV$OB_LOG_STAT.
References
For more information about the arbitration service, see the following topics:
