In MySQL mode of OceanBase Database, you can modify the row format, block size, and character set of a table, and rename a table.
Modify the row format
Syntax:
ALTER TABLE table_name ROW_FORMAT = {DEFAULT | DYNAMIC | FIXED | COMPRESSED | REDUNDANT | COMPACT};
Syntax:
obclient> ALTER TABLE t1 ROW_FORMAT = COMPRESSED;
Query OK, 0 rows affected
Modify the block size
Syntax:
ALTER TABLE table_name BLOCK_SIZE = value;
Example:
obclient> ALTER TABLE t1 BLOCK_SIZE = 1024;
Query OK, 0 rows affected
Change the character set
Syntax:
ALTER TABLE table_name CONVERT TO CHARACTER SET charset_name;
Example:
obclient> ALTER TABLE test_collation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 0 rows affected
Rename a table
Syntax:
ALTER TABLE old_tbl_name RENAME TO new_tbl_name;
Example:
obclient> ALTER TABLE t1 RENAME TO t2;
Query OK, 0 rows affected
