Note
- For V5.x versions, this parameter is available starting with V5.0.1.
- For V4.4.2, this parameter is available starting with V4.4.2 BP1.
Overview
The schema_history_archive_expire_time parameter specifies the retention period for multi-version historical archive data of schemas.
To prevent archived tables from growing indefinitely, OceanBase Database introduces Controlled GC (Garbage Collection). During collection, the archive GC cut-off version is calculated based on the schema_version corresponding to the recycle point and the retention period. Archived historical data is then deleted in batches.
Privilege requirements
Query parameters
Both the
systenant and all user tenants can query this parameter using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify parameters
Both the
systenant and user tenants can modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Time |
| Default Value | 0 |
| Value range |
|
| Modifiable | Yes, you can use the following methods:ALTER SYSTEM SETStatement modification. |
| Whether to restart the OBServer node for the change to take effect | No. The setting takes effect immediately. |
Configuration example
System tenant
Stop the garbage collection for schema multi-version historical archive data in tenant
tenant1.obclient(root@sys)[(none)]> ALTER SYSTEM SET schema_history_archive_expire_time = '0' TENANT = tenant1;Set the retention period for multi-version historical archive data in the schema of tenant
tenant1to 90 days.obclient(root@sys)[(none)]> ALTER SYSTEM SET schema_history_archive_expire_time = '90d' TENANT = tenant1;
User tenant
Stop GC for multi-version historical archive data of the current tenant's schema.
obclient> ALTER SYSTEM SET schema_history_archive_expire_time = '0';Set the retention period for multi-version historical archive data of schemas in this tenant to 90 days.
obclient> ALTER SYSTEM SET schema_history_archive_expire_time = '90d';
