
# 闪回相关参数
本章节介绍闪回功能相关参数。本版本只支持Ustore引擎闪回功能，不再支持Astore引擎闪回功能。
#### enable_recyclebin
**参数说明** **：**用来控制回收站的实时打开和关闭。
**参数类型：**布尔型
**参数单位：**无
**取值范围** ：
- on：表示实时打开回收站。
- off：表示实时关闭回收站。
 
**默认值** **：**off
**设置方式：** 该参数属于SIGHUP类型参数，请参考[表1](https://support.huaweicloud.com/centralized-devg-v8-gaussdb/gaussdb-40-0315.html#ZH-CN_TOPIC_0000002527988878__zh-cn_topic_0000002527058484_zh-cn_topic_0000002372412413_zh-cn_topic_0283137176_zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。
**设置建议：**需要使用闪回表功能时，将enable_recyclebin设置为on。
**设置不当的风险与影响：**关闭时无法使用闪回功能。
#### recyclebin_retention_time
**参数说明** **：**设置回收站对象保留时间，超过该时间的回收站对象将被自动清理。
**参数类型：**整型
**参数单位：**s（秒）
**取值范围** **：**1 \~ 2147483647
**默认值** **：**900（即15min）
**设置方式：** 该参数属于SIGHUP类型参数，请参考[表1](https://support.huaweicloud.com/centralized-devg-v8-gaussdb/gaussdb-40-0315.html#ZH-CN_TOPIC_0000002527988878__zh-cn_topic_0000002527058484_zh-cn_topic_0000002372412413_zh-cn_topic_0283137176_zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。例如，不带单位取值900，表示recyclebin_retention_time为900s；带单位取值15min，表示recyclebin_retention_time为15min。取值如果要带单位，必须为s、min、h、d。
**设置建议：**根据用户需求对回收站对象保留时间进行设置。
**设置不当的风险与影响：**请在充分理解参数含义，并经过测试验证后进行修改。
#### undo_retention_time
**参数说明**：设置undo旧版本保留时间。
**参数类型：**整型
**参数单位：**s（秒）
**取值范围**：0 \~ 259200
**默认值**：0
**设置方式：** 该参数属于SIGHUP类型参数，请参考[表1](https://support.huaweicloud.com/centralized-devg-v8-gaussdb/gaussdb-40-0315.html#ZH-CN_TOPIC_0000002527988878__zh-cn_topic_0000002527058484_zh-cn_topic_0000002372412413_zh-cn_topic_0283137176_zh-cn_topic_0237121562_zh-cn_topic_0059777490_t91a6f212010f4503b24d7943aed6d846)中对应设置方法进行设置。例如，不带单位取值900，表示undo_retention_time为900s；带单位取值15min，表示undo_retention_time为15min。取值如果要带单位，必须为s、min、h、d。
**设置建议：**推荐使用默认值。
**设置不当的风险与影响：**取值若超出范围，或者取值带有除s、min、h、d以外的单位时，会有报错提示。
![](https://support.huaweicloud.com/centralized-devg-v8-gaussdb/public_sys-resources/notice_3.0-zh-cn.png)
- 在进行Ustore闪回查询时，如果中途设置该参数为0，则会清理闪回点快照信息，之前的任何版本不允许再做闪回查询。执行闪回查询会报错："cannot find the restore point"。
- 如果想要保留的undo记录旧版本时间为time1，闪回查询执行的SQL时间为time2，需要设置参数undo_retention_time大于两者之和。即设置undo_retention_time \> time1 + time2 + 3s。建议设置 undo_retention_time = time1 + 1.5 \* time2。例如：想要保留3h的旧版本，闪回查询执行时间为1h，则undo_retention_time = 3h + 1.5 \* 1h = 4.5h。
 
