Skip to main content

PURGE_STATS

PURGE_STATS deletes historical statistics recorded before the specified time.

Syntax

DBMS_STATS.PURGE_STATS(
before_timestamp TIMESTAMP WITH TIME ZONE);

Parameters

before_timestamp specifies the time before which statistics are deleted. If this parameter is set to NULL, the automatic purge strategy is used.

Exceptions

Error codeDescription
HY000
  • The object does not exist or the user does not have the required privileges.
  • Invalid or inconsistent value.

Examples

Manually delete historical statistics recorded before the specified time.

CALL DBMS_STATS.PURGE_STATS ('2021-09-26 19:02:12.675729');
Query OK, 0 rows affected