Note
This variable was introduced in V1.4.
Description
The ob_route_policy variable specifies the routing strategy for the OBServer node to select a data replica.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (in Oracle mode) or theinformation_schema.GLOBAL_VARIABLESview (in MySQL mode) to query the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (in Oracle mode) or theinformation_schema.SESSION_VARIABLESview (in MySQL mode) to query the value of a session system variable.
Modify variables
Set the variable at the global level
The
systenant can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Set the variable at the session level
The
systenant and all user tenants can directly modify the value of a session system variable in the current tenant.
Attribute descriptions
| Attribute | Description |
|---|---|
| Parameter type | Enum |
| Default value | 1 |
| Value range |
|
| Effective scope | |
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Examples
Set the routing policy for selecting data replicas inside the OBServer node to prioritize the Zone where the read-only replica is located.
Set the variable at the session level
obclient> SET ob_route_policy = 'READONLY_ZONE_FIRST';or
obclient> SET ob_route_policy = 1;Set the variable at the global level
obclient> SET GLOBAL ob_route_policy = 'READONLY_ZONE_FIRST';or
obclient> SET GLOBAL ob_route_policy = 1;