The PURGE_STATS procedure purges the historical statistics earlier than the specified point in time.
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 of the specified point in time.
obclient [testUser01]> CALL DBMS_STATS.PURGE_STATS ('2021-09-26 19:02:12.675729');
Query OK, 0 rows affected