PURGE_STATS is used to delete historical statistics before a specified time.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_STATS.PURGE_STATS(
before_timestamp TIMESTAMP WITH TIME ZONE);
Parameters
The before_timestamp parameter specifies the timestamp before which statistics will be purged. If NULL, the automatic purging strategy is used.
Exceptions
| Error code | Description |
|---|---|
| OBE-20000 | The object does not exist or the user does not have sufficient privileges. |
| OBE-2001 | Invalid or inconsistent value. |
Examples
Manually purge historical statistics before a specified time.
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
