Note
- This parameter is available starting with V4.0.0. In V4.0.0, the parameter type changes from a system variable to a parameter.
- This parameter is available starting with V2.1 as a system variable.
Description
undo_retention specifies the time period for which multiple versions of data should be retained during a dump. It controls the retention of multiple versions of data during the dump process.
Privilege requirements
Query the parameter
The
systenant and all user tenants can use theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview to query this parameter.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 data during a dump. You can use undo_retention to control the retention of multiple versions of data during the dump process.
Specifically:
When the value of
undo_retentionis0, only the latest version of data is retained in the dump file.When the value of
undo_retentionis greater than0, multiple versions of data are retained in the dump file for the specified time period (in seconds).Notice
After you enable multiple version dumps for a tenant, major compactions retain the corresponding incremental dump files. However, major SSTables do not store multiple versions of data. 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 time period for which multiple versions of data should be retained to 1800 seconds.
obclient> ALTER SYSTEM SET undo_retention=1800;