In OceanBase Database in Oracle mode, you can modify the row format, modify the block size, and rename a table.
Modify the row format
The syntax for modifying the row format is as follows:
ALTER TABLE table_name [MOVE]
{ NOCOMPRESS
| COMPRESS [BASIC]
| COMPRESS FOR OLTP
| COMPRESS FOR QUERY [LOW | HIGH]
| COMPRESS FOR ARCHIVE [LOW | HIGH]
};
where:
NOCOMPRESS: specifies that the data is not encoded or compressed and is stored in theflatformat.COMPRESS BASIC: specifies that the data is not encoded and is stored in theflatformat, and is compressed usinglz4_1.0.COMPRESS FOR OLTP: specifies that the data is not encoded and is stored in theflatformat, and is compressed usinglz4_1.0.COMPRESS FOR QUERY [LOW | HIGH]: specifies that the data is encoded and stored in theencodingformat, and is compressed usingzstd_1.0.COMPRESS FOR ARCHIVE: specifies that the data is encoded and stored in theencodingformat, and is compressed usingzstd_1.0. The default value isCOMPRESS FOR ARCHIVE.
Here is an example of modifying the row format:
obclient> ALTER TABLE t1 MOVE NOCOMPRESS;
Query OK, 0 rows affected
Modify the block size
The syntax for modifying the block size is as follows:
ALTER TABLE table_name BLOCK_SIZE = value;
Here is an example of modifying the block size:
obclient> ALTER TABLE t1 BLOCK_SIZE = 1024;
Query OK, 0 rows affected
Rename a table
The syntax for renaming a table is as follows:
ALTER TABLE old_tbl_name RENAME TO new_tbl_name;
Here is an example of renaming a table:
obclient> ALTER TABLE t1 RENAME TO t2;
Query OK, 0 rows affected
