In Oracle mode of OceanBase Database, you can change the row format, change the block size, and rename a table.
Change the row format
Syntax:
ALTER TABLE table_name [MOVE]
{ NOCOMPRESS
| COMPRESS [BASIC]
| COMPRESS FOR OLTP
| COMPRESS FOR QUERY [LOW | HIGH]
| COMPRESS FOR ARCHIVE [LOW | HIGH]
};
Parameters:
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.
Example:
obclient> ALTER TABLE t1 MOVE NOCOMPRESS;
Query OK, 0 rows affected
Change the block size
Syntax:
ALTER TABLE table_name BLOCK_SIZE = value;
Sample code:
obclient> ALTER TABLE t1 BLOCK_SIZE = 1024;
Query OK, 0 rows affected
Rename a table
Syntax:
ALTER TABLE old_tbl_name RENAME TO new_tbl_name;
Sample code:
obclient> ALTER TABLE t1 RENAME TO t2;
Query OK, 0 rows affected