Note
- This parameter is available starting with V4.0.0. In this version, the parameter type is changed from a system variable to a parameter.
- This parameter is available starting with V2.1 as a system variable.
Description
undo_retention specifies the range of multi-version data to be retained in the system. It controls the recycling of multi-version data during a dump.
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 | Int |
| Default value | 1800, in seconds |
| Value range | [0, 4294967295] |
| 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. |
Considerations
OceanBase Database retains multiple versions of historical data rows during a dump. You can use undo_retention to control the range of multi-version data to be retained during a dump.
Specifically:
If the value of
undo_retentionis0, multi-version data is not retained. Only the latest version of data rows is retained in the dump file.If the value of
undo_retentionis greater than0, multi-version data is retained in the dump file for the specified period of time (in seconds).Notice
After multi-version data is retained in a tenant, the incremental dump files generated during major compactions are retained, but multi-version data is not stored in Major SSTables. We recommend that you do not set this parameter to a large value to avoid exceeding the limit on the number of retained SSTables.
Examples
Set the range of multi-version data to be retained in the system to 1800s.
obclient> ALTER SYSTEM SET undo_retention=1800;