Note
- For V4.0.0 and later, this parameter is available starting with V4.0.0.
- For V2.1 and later, this parameter is available starting with V2.1.
Description
undo_retention specifies the range of multi-version data to be retained by the system and controls the recycling of multi-version data during a dump.
Privilege requirements
Query the parameter
systenant and all user tenants can use theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview to query this parameter.Modify the parameter
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:
When the value of
undo_retentionis0, multi-version data is not retained. The dump file contains only the latest version of data rows.When the value of
undo_retentionis greater than0, multi-version data is retained for the specified number of seconds. The dump file contains multiple versions of data rows.Notice
After multi-version data is enabled for a tenant, major compactions retain the incremental dump files, but do not store multi-version data 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 SSTables retained.
Examples
Set the range of multi-version data to be retained by the system to 1800s.
obclient> ALTER SYSTEM SET undo_retention=1800;
