This topic describes how to create a non-partitioned table group.
Syntax
CREATE TABLEGROUP [IF NOT EXISTS] tablegroupname [opt_tablegroup_option_list]
opt_tablegroup_option_list:
tablegroup_option [tablegroup_option]
tablegroup_option:
LOCALITY [=] locality_name
| PRIMARY_ZONE [=] primary_zone_name
Parameters
| Parameter | Description |
|---|---|
| tablegroup_name | The table group name. It can contain up to 64 characters in length and contain uppercase and lowercase letters, digits, and underscores (_). It must start with a letter or an underscore (_), and cannot contain keywords of OceanBase Database. If the name of the created table group already exists and IF NOT EXISTS is not specified, an error is returned. |
Examples
Create a table group named
tgn.obclient> CREATE TABLEGROUP tgn; Query OK, 0 rows affectedView the created
tgntable group.obclient> SHOW TABLEGROUPS WHERE Tablegroup_name='tgn'; +-----------------+------------+---------------+ | Tablegroup_name | Table_name | Database_name | +-----------------+------------+---------------+ | tgn | NULL | NULL | +-----------------+------------+---------------+ 1 row in setView the created
tgntable group.obclient> SHOW CREATE Tablegroup tgn\G *************************** 1. row *************************** Tablegroup: tgn Create Tablegroup: CREATE TABLEGROUP IF NOT EXISTS `tgn` BINDING = FALSE partition by hash partitions 10 1 row in set