In the Oracle mode of OceanBase Database, you can change the row format, block size, and name of a table.
Change the row format
The syntax for changing 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]
};
The parameters are described as follows:
NOCOMPRESS: Data is not encoded or compressed, and is saved in theflatformat.COMPRESS BASIC: Data is not encoded but is saved in theflatformat and compressed by using thelz4_1.0algorithm.COMPRESS FOR OLTP: Data is not encoded but is saved in theflatformat and compressed by using thelz4_1.0algorithm.COMPRESS FOR QUERY [LOW | HIGH]: Data is encoded, saved in theencodingformat, and compressed by using thezstd_1.0algorithm.COMPRESS FOR ARCHIVE: Data is encoded, saved in theencodingformat, and compressed by using thezstd_1.0algorithm. By default,COMPRESS FOR ARCHIVEis used.
Here is an example:
obclient> ALTER TABLE t1 MOVE NOCOMPRESS;
Query OK, 0 rows affected
Change the block size
The syntax for changing the block size is as follows:
ALTER TABLE table_name BLOCK_SIZE = value;
Here is an example:
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:
obclient> ALTER TABLE t1 RENAME TO t2;
Query OK, 0 rows affected