Note
This variable is available starting with V1.4.
Description
ob_org_cluster_id specifies the cluster_id of the current session in OceanBase Database. The value is persisted to the transaction log.
Privilege requirements
Query variables
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) or theinformation_schema.SESSION_VARIABLESview (MySQL mode) to view the value of a session system variable.Modify variables
systenant and all user tenants can directly modify the value of a session system variable in their own tenant.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | int |
| Default value | 0, which indicates to use the cluster's own cluster_id, which is the 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
Usually, you do not need to set the ob_org_cluster_id variable. When OceanBase Database generates logs (clog), it uses the default value. OMS can use the ob_org_cluster_id variable to implement data filtering. 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, if the OMS obcdc component sets the cluster_id_black_list parameter to 2147473648 and the OBServer node sets the session variable to SET ob_org_cluster_id=2147473648;, then obcdc will filter out all data with a cluster_id of 2147473648.
Examples
Set the cluster_id of the current session in OceanBase Database to 2147473648.
obclient> SET ob_org_cluster_id = 2147473648;