If you do not specify a table group when creating a table, you can add the table to a table group afterward. You can add a table to a table group by changing the table group attribute of the table or using the ALTER TABLEGROUP ADD syntax.
- Example: Changing the table group attribute of a table
Notice
Do not use single quotation marks (') when changing the table group attribute. Otherwise, the names are case-sensitive.
obclient> alter table ordr tablegroup=tpcc_group;
Query OK, 0 rows affected (0.04 sec)
obclient> alter table ordl tablegroup=tpcc_group;
Query OK, 0 rows affected (0.04 sec)
- Example: Adding a table to a table group
To add a table to a table group, make sure that the table has the same partitioning strategy as that of the table group.
obclient> alter table ordr tablegroup='';
Query OK, 0 rows affected (0.04 sec)
obclient> alter table ordl tablegroup='';
Query OK, 0 rows affected (0.03 sec)
obclient> alter tablegroup tpcc_group add ordr, ordl ;
Query OK, 0 rows affected (0.03 sec)
obclient>