Note
This variable is available starting with V1.4.
Description
ob_org_cluster_id specifies the cluster_id for the current session in OceanBase Database. This 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-compatible mode) or theinformation_schema.SESSION_VARIABLESview (MySQL-compatible mode) to view the values of session system variables.Modify variables
systenant and all user tenants can directly modify the values of session system variables in their respective tenants.
Attributes
| Attribute | Description |
|---|---|
| Type | int |
| Default value | 0, which indicates to use the cluster's own cluster_id, the unique identifier generated at cluster creation |
| Value range | [0, 4294967295] |
| Scope | Session |
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage notes
Typically, you do not need to set the ob_org_cluster_id variable. OceanBase Database uses the default value when generating logs (clogs). OMS can use the ob_org_cluster_id variable to implement data filtering. For more information about OMS data filtering, see Create a data migration project from a MySQL-compatible tenant to an OceanBase Database MySQL-compatible tenant in the OceanBase Migration Service documentation.
For example, if the OMS obcdc component sets the cluster_id_black_list to 2147473648 and the OBServer node sets the session variable to SET ob_org_cluster_id=2147473648;, then obcdc filters all data with cluster_id equal to 2147473648.
Examples
Set the cluster_id for the current session in OceanBase Database to 2147473648.
obclient> SET ob_org_cluster_id = 2147473648;