The SET_TABLEGROUP_BALANCE_WEIGHT subprogram sets the weight of a Sharding = 'NONE' table group.
Note
This subprogram is supported starting from OceanBase Database V4.4.1.
Limitations
In OceanBase Database V4.4.2:
For versions earlier than V4.4.2 BP1, you can set the weight of a table group only if the Sharding attribute is
NONE.For V4.4.2 BP1 and later, you can set the weight of a table group only for
SHARDING = 'NONE'combined withSCOPE = 'SERVER'orSHARDING = 'NONE'combined withSCOPE = 'ZONE'. You cannot set the weight forSHARDING = 'NONE'combined withSCOPE = 'CLUSTER'.
Syntax
DBMS_BALANCE.SET_TABLEGROUP_BALANCE_WEIGHT(
weight INT,
tablegroup_name VARCHAR(65535)
);
Parameters
Parameter |
Description |
|---|---|
| weight | The weight of the table group (an integer), in the range [1, +∞). A higher weight means a higher proportion of resources allocated. |
| tablegroup_name | The name of the table group. |
Considerations
When
enable_database_sharding_none = true, the default table group created with a new database has weight1. OtherSHARDING = 'NONE'table groups that have never had a weight set default to0and do not participate in weight balancing.For a table group that has a weight, table-level and partition-level weights in that table group have no effect.
We recommend using at most three weight tiers:
- High weight = 100% * total number of
SHARDING = 'NONE'table groups - Medium weight = 50% * total number of
SHARDING = 'NONE'table groups - Low weight = 1
- High weight = 100% * total number of
Examples
In the
systenant, call this subprogram to set the weight of theTG_TD_testtable group in themysqltenant to 10.obclient> CALL DBMS_BALANCE.SET_TABLEGROUP_BALANCE_WEIGHT(10, 'TG_TD_test') TENANT = 'mysql';In a user tenant, call this subprogram to set the weight of the
TG_TD_testtable group in that tenant to 10.obclient> CALL DBMS_BALANCE.SET_TABLEGROUP_BALANCE_WEIGHT(10, 'TG_TD_test');
References
- For information about deleting the weights of
Sharding = 'NONE'table groups, see CLEAR_TABLEGROUP_BALANCE_WEIGHT. - For information about querying the weights of different table groups, see oceanbase.CDB_OB_DATABASES or oceanbase.DBA_OB_DATABASES.
- For information about whether to enable auto-aggregation for user tables when creating a database, see enable_database_sharding_none.
