ob_org_cluster_id

2025-11-14 07:33:33  Updated

Note

This variable is available starting with V1.4.

Description

ob_org_cluster_id specifies the cluster_id for the current session of OceanBase Database. The value is persisted to the transaction log.

Privilege requirements

  • Query variables

    sys tenant and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_SESSION_VARIABLE view (Oracle mode) or the information_schema.SESSION_VARIABLES view (MySQL mode) to view the value of a session system variable.

  • Modify variables

    sys tenant and all user tenants can directly modify the value of a session system variable of their own tenant.

Attributes

Attribute Description
Type Int
Default value 0. The cluster ID of the cluster is used. This ID is a unique identifier generated when the cluster is created.
Value range [0, 4294967295]
Scope Session
Modifiable Yes. You can execute the SET statement to modify the value.

Usage notes

In most cases, you do not need to set the ob_org_cluster_id variable. OceanBase Database uses the default value when it generates logs (clog). OMS can use the ob_org_cluster_id variable to filter data. For more information about the data filtering feature of OMS, see Create a data migration project from a MySQL tenant of OceanBase Database to a MySQL tenant of OceanBase Database in the OceanBase Migration Service documentation.

For example, the OMS obcdc component sets the cluster_id_black_list parameter to cluster_id_black_list=2147473648, and the OBServer node sets the session variable to SET ob_org_cluster_id=2147473648; when it writes data. In this case, obcdc filters out all data whose cluster_id is 2147473648.

Examples

Set the cluster_id for the current session of OceanBase Database to 2147473648.

obclient> SET ob_org_cluster_id = 2147473648;

Contact Us