The PURGE_STATS procedure purges the historical statistics saved before the specified timestamp.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_STATS.PURGE_STATS(
before_timestamp TIMESTAMP WITH TIME ZONE);
Parameters
Statistics saved before the timestamp specified by the before_timestamp parameter will be purged. If the value is set to NULL, the automatic purge strategy is used.
Exceptions
| Error code | Description |
|---|---|
| ORA-20000 | The object does not exist, or you do not have the required privileges. |
| ORA-20001 | Values are invalid or inconsistent. |
Examples
Manually purge the historical statistics saved before the specified timestamp.
obclient> CALL DBMS_STATS.PURGE_STATS (TO_TIMESTAMP('2021-09-26 19:02:12.675729', 'YYYY-MM-DD HH24:MI:SS.FF'));
Query OK, 0 rows affected