---
title: "schema_history_archive_expire_time - OceanBase 数据库 V4.4.2 | OceanBase 文档中心"
description: schema_history_archive_expire_time 说明 对于 V4.4.2 版本，该配置项从 V4.4.2 BP1 版本开始引入。 功能描述 配置项 schema_history_archive_expire_time 用于指定 Schema 多版本历史归档数据的保留时间。 为避免归档表无限增长，…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*P8CuR4UJ_FkAAAAAAAAAAAAADiGDAQ/original) OceanBase 数据库分布式版 - V 4.4.2 LTS

# schema_history_archive_expire_time

更新时间：2026-04-29 15:21:42

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.4.2/zh-CN/700.reference/800.configuration-items-and-system-variables/100.system-configuration-items/400.tenant-level-configuration-items/7410.schema_history_archive_expire_time.md)

#### 说明

对于 V4.4.2 版本，该配置项从 V4.4.2 BP1 版本开始引入。

## 功能描述

配置项 `schema_history_archive_expire_time` 用于指定 Schema 多版本历史归档数据的保留时间。

为避免归档表无限增长，OceanBase 数据库引入了可控 GC（Garbage Collection）。回收时使用回收位点对应的 schema_version 结合保留时间换算出归档 GC 的截止版本，并分批删除归档历史数据。

## 权限要求

- 查询配置项

  `sys` 租户和所有用户租户均可以使用 `SHOW PARAMETERS` 语句或视图 `GV$OB_PARAMETERS` 查询该配置项。
 - 修改配置项

  `sys` 租户和用户租户均可修改该配置项。

## 属性说明

| **属性** | **描述** |
| --- | --- |
| 参数类型 | Time |
| 默认值 | 0 |
| 取值范围 | - `0`：表示关闭归档历史数据的 GC - `[30d, 365d]`：表示最少保留对应天数的归档历史数据。建议设置为业务可接受的保留时间。 |
| 是否可修改 | 是，支持通过 `ALTER SYSTEM SET` 语句修改。 |
| 是否重启 OBServer 节点生效 | 否，设置后立即生效。 |

## 配置示例

- 系统租户

     - 关闭租户 `tenant1` 中 Schema 多版本历史归档数据的 GC。

      ```shell
      obclient(root@sys)[(none)]> ALTER SYSTEM SET schema_history_archive_expire_time = '0' TENANT = tenant1;

      ```
     - 设置租户 `tenant1` 中 Schema 多版本历史归档数据的保留时间为 90 天。

      ```shell
      obclient(root@sys)[(none)]> ALTER SYSTEM SET schema_history_archive_expire_time = '90d' TENANT = tenant1;

      ```
 - 用户租户

     - 关闭本租户 Schema 多版本历史归档数据的 GC。

      ```shell
      obclient> ALTER SYSTEM SET schema_history_archive_expire_time = '0';

      ```
     - 设置本租户 Schema 多版本历史归档数据的保留时间为 90 天。

      ```shell
      obclient> ALTER SYSTEM SET schema_history_archive_expire_time = '90d';

      ```

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
