OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.2.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.2.0
    iconOceanBase Database
    SQL - V 4.2.0
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Enable the arbitration service for a tenant

    Last Updated:2023-10-31 11:17:10  Updated
    share
    What is on this page
    Prerequisites
    Procedure
    References

    folded

    share

    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. You can also enable the arbitration service for a tenant after the tenant is created. This topic describes how to enable the arbitration service for an existing tenant.

    Prerequisites

    • The arbitration service has been deployed in the cluster where the tenant resides. For more information about how to deploy the arbitration service, see Deploy an OceanBase cluster with two replicas and the arbitration service.

    • The tenant has two or four full-featured replicas.

      Note

      If you want to enable the arbitration service for a tenant, the number of full-featured replicas in the locality of the tenant must meet the specified requirement. The number of read-only replicas in the locality of the tenant is not limited. For example, if the value of Locality of a tenant is F@z1,F@z2 or F@z1,F@z2,R@z3, you can enable the arbitration service for the tenant.

    Procedure

    1. Log on to the sys tenant of the cluster as the root user.

      Note that you must specify the corresponding fields in the following sample code based on your actual database configurations.

      obclient -h10.xx.xx.xx -P2883 -uroot@sys -p***** -A
      

      For more information about how to connect to a database, see Overview (MySQL mode) or Overview (Oracle mode).

    2. Execute the following statement to query the connection status of all nodes in the cluster.

      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 set
      

      The connection status between a node and the arbitration service is indicated by the value of the STATUS field in the query result.

      • ACTIVE: The arbitration service can communicate with the node. You can enable the arbitration service for the tenant only when the arbitration service can communicate with all nodes.
      • INACTIVE: The arbitration service cannot communicate with the node. In this case, you cannot enable the arbitration service for the tenant. Check the network communication between the node and the arbitration service.
    3. Execute the following statement to query the arbitration service status of the tenant.

      SELECT * FROM oceanbase.DBA_OB_TENANTS WHERE tenant_name = 'oracle001'\G
      

      The query result is as follows:

      *************************** 1. row ***************************
                       TENANT_ID: 1004
                     TENANT_NAME: oracle001
                     TENANT_TYPE: USER
                     CREATE_TIME: 2023-06-26 19:40:21.457857
                     MODIFY_TIME: 2023-06-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,
                      COMPATIBLE: 4.2.0.0
      1 row in set
      

      The arbitration service status of the tenant can be:

      • ENABLED: The arbitration service is enabled for the tenant.

      • DISABLED: The arbitration service is disabled for the tenant.

      • ENABLING: The arbitration service is being enabled for the tenant.

      • DISABLING: The arbitration service is being disabled for the tenant.

      The preceding query result shows that the value of the ARBITRATION_SERVICE_STATUS field is DISABLED, which indicates that the arbitration service is disabled for the tenant.

      For more information about the DBA_OB_TENANTS view, see DBA_OB_TENANTS.

    4. Execute the following statement to enable the arbitration service for the tenant:

      The syntax is as follows:

      ALTER TENANT tenant_name [SET] ENABLE_ARBITRATION_SERVICE = true;
      

      The tenant_name field specifies the name of the tenant for which you want to enable the arbitration service. The SET keyword is optional.

      The following sample statement enables the arbitration service for a tenant named oracle001:

      ALTER TENANT oracle001 ENABLE_ARBITRATION_SERVICE = true;
      
    5. Query the DBA_OB_TENANTS view to check whether the arbitration service is enabled for the tenant.

      SELECT * FROM oceanbase.DBA_OB_TENANTS WHERE tenant_name = 'oracle001'\G
      

      The query result is as follows:

      *************************** 1. row ***************************
                       TENANT_ID: 1004
                     TENANT_NAME: oracle001
                     TENANT_TYPE: USER
                     CREATE_TIME: 2023-06-26 19:40:21.457857
                     MODIFY_TIME: 2023-06-27 13:54:29.486203
                    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: 1687845307275557916
                  REPLAYABLE_SCN: 1687845307275557916
                    READABLE_SCN: 1687845307131393135
              RECOVERY_UNTIL_SCN: 4611686018427387903
                        LOG_MODE: NOARCHIVELOG
      ARBITRATION_SERVICE_STATUS: ENABLED
                        UNIT_NUM = 1,
                      COMPATIBLE: 4.2.0.0
      1 row in set
      

      In the query result, the value of the ARBITRATION_SERVICE_STATUS field is ENABLED, which indicates that the arbitration service is enabled for the tenant.

    6. After you enable the arbitration service, some log streams of the tenant may still have no arbitration members. These log streams cannot be downgraded or upgraded. Check whether all log streams have arbitration members.

      After you enable the arbitration service, the existing log streams of the tenant can use the arbitration service, but the new log streams created after the arbitration service is enabled may lack arbitration members and cannot be upgraded or downgraded. This is because a log stream is created in non-strict mode and the arbitration member may not be created. You can execute the following statement to check whether all log streams of the tenant have arbitration members.

      The syntax 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: the ID of the tenant for which the arbitration service is enabled.

      • arb_server_ip: the IP address of the server on which the arbitration service is deployed.

      • arb_server_port: the remote procedure call (RPC) port for the arbitration service. By default, Port 2882 is used.

      For example:

      (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. Otherwise, RootService will add arbitration members to log streams that lack arbitration members in the background. You can check whether an arbitration member addition task is running by querying the CDB_OB_LS_ARB_REPLICA_TASKS view.

      After the task is completed, you can query the CDB_OB_LS_ARB_REPLICA_TASK_HISTORY view to confirm the task execution result. If the task succeeded, arbitration members are added to log streams, and the arbitration service is available. If the task failed, contact OceanBase Technical Support for assistance.

      For more information about the fields in the GV$OB_LOG_STAT view, see GV$OB_LOG_STAT.

    References

    For more information about the arbitration service, see the following topics:

    • Deploy an OceanBase cluster with two replicas and the arbitration service

    • Disable the arbitration service for a tenant

    • Modify the log stream downgrade control time

    • Replace the arbitration service for a cluster

    • Remove the arbitration service for a cluster

    Previous topic

    Overview
    Last

    Next topic

    Disable the arbitration service for a tenant
    Next
    What is on this page
    Prerequisites
    Procedure
    References