Note
For V4.4.2, this parameter is available starting with V4.4.2 BP1.
Description
The schema_history_archive_expire_time parameter specifies the retention period of schema history archive data.
To avoid unbounded growth of archive tables, OceanBase Database introduces controllable garbage collection (GC). During GC, the system calculates the cutoff schema version based on the retention period and the recycle point, and then deletes archive history data in batches.
Privilege requirements
Query the parameter
The
systenant and all user tenants can query this parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
The
systenant and user tenants can modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Type | Time |
| Default value | 0 |
| Value range |
|
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Examples
System tenant
Disable GC for schema history archive data in the
tenant1tenant.obclient(root@sys)[(none)]> ALTER SYSTEM SET schema_history_archive_expire_time = '0' TENANT = tenant1;Set the retention period of schema history archive data in the
tenant1tenant to 90 days.obclient(root@sys)[(none)]> ALTER SYSTEM SET schema_history_archive_expire_time = '90d' TENANT = tenant1;
User tenant
Disable GC for schema history archive data in the current tenant.
obclient> ALTER SYSTEM SET schema_history_archive_expire_time = '0';Set the retention period of schema history archive data in the current tenant to 90 days.
obclient> ALTER SYSTEM SET schema_history_archive_expire_time = '90d';
