Major compaction for V2.1.31
To upgrade from V2.1.31 to a later version, you must log on to OceanBase Database and perform the following steps to complete a progressive major compaction:
Execute the following SQL statements to prepare for the progressive major compaction:
obclient> SET ob_query_timeout = 100000000000; obclient> ALTER SYSTEM SET enable_sys_table_ddl = TRUE;Set the desired number of rounds in the progressive major compaction.
obclient> ALTER TENANT all SET default_progressive_merge_num = num;Notice
The value of
nummust be greater than 1. For more information about this parameter, see default_progressive_merge_num.Clear the recycle bins of all tenants.
obclient> PURGE RECYCLEBIN;Set the
rewrite_merge_versionparameter of each tenant. The value of ver indicates the version number of the next major compaction.obclient> ALTER tenant xxx SET rewrite_merge_version = ver;Initiate the progressive major compaction based on the number of rounds.
obclient> ALTER SYSTEM MAJOR FREEZE;After the major compaction is completed, roll back the progressive rounds of all tables.
obclient> ALTER TENANT ALL SET default_progressive_merge_num = 0;Roll back the
enable_sys_table_ddlparameter.obclient> ALTER SYSTEM SET enable_sys_table_ddl = false;
Major compaction for V2.2.1
For the upgrade from V2.2.1 to a later version, you must log on to OceanBase Database and trigger a major or minor compaction.
obclient> ALTER SYSTEM MINOR FREEZE;
or
obclient> ALTER SYSTEM MAJOR FREEZE;
Major compaction for V2.2.77
For a new cluster in OceanBase Database V2.2.77, we recommend that you run the following command to trigger a major or minor compaction:
obclient> ALTER SYSTEM MINOR FREEZE;
or
obclient> ALTER SYSTEM MAJOR FREEZE;