如果要删除表组,得先确认表组中没有表。具体方法就是从表组中删除表,或者将相关表的表组属性清空。
示例如下:
obclient> show tablegroups;
+-----------------+------------+---------------+
| Tablegroup_name | Table_name | Database_name |
+-----------------+------------+---------------+
| oceanbase | NULL | NULL |
| tpcc_group | cust | tpccdb |
| tpcc_group | dist | tpccdb |
| tpcc_group | hist | tpccdb |
| tpcc_group | nord | tpccdb |
| tpcc_group | ordl | tpccdb |
| tpcc_group | ordr | tpccdb |
| tpcc_group | stok | tpccdb |
| tpcc_group | ware | tpccdb |
+-----------------+------------+---------------+
9 rows in set (0.01 sec)
obclient> drop tablegroup tpcc_group;
ERROR 4615 (HY000): tablegroup is not empty
obclient>