Description
You can use this statement to perform the following operations:
Add multiple tables to a table group.
Modify the partitioning rules of a table group.
Modify the locality and primary zone of a table group.
Syntax
- Add multiple tables to a table group.
ALTER TABLEGROUP tablegroupname ADD [TABLE] tblname [, tblname...]
- Modify the partitioning rules of a table group.
ALTER TABLEGROUP tablegroupname alter_tg_partition_option
alter_tg_partition_option:
DROP PARTITION '(' name_list ')'
| ADD PARTITION opt_range_partition_list
| modify_tg_partition_info
- Modify the locality and primary zone of a table group.
ALTER TABLEGROUP tablegroupname alter_tablegroup_actions
alter_tablegroup_actions:
alter_tablegroup_action
| alter_tablegroup_action, alter_tablegroup_action
alter_tablegroup_action:
SET LOCALITY [=] locality_name
|SET PRIMARY_ZONE [=] primary_zone_name
Parameters
| Parameter | Description |
|---|---|
| tablegroupname | Specifies a table group. |
| tblname | Specifies a table name. If multiple tables are added, separate the tables with a comma (,). When multiple tables are added, the table names can be duplicated. If a table to be added already exists in the table group specified for tablegroupname, the system does not return an error. |
| modify_tg_partition_info | Modifies the partitioning rules of the table group. |
| LOCALITY locality_name | Specifies the locality of the table group. |
| PRIMARY_ZONE primary_zone_name | Specifies the primary zone of the table group. |
Example
Creating the table group tgh and modify the locality of the table group to F@zone1
obclient> create tablegroup tgh locality='F,R{ALL_SERVER}@zone1' partition by hash partitions 10;
Query OK, 0 rows affected (0.09 sec)
obclient> alter tablegroup tgh set locality ='F@zone1 ';
Query OK, 0 rows affected (0.09 sec)