The DELETE_SCHEMA_STATS procedure deletes the statistics on all tables of the specified user.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_STATS.DELETE_SCHEMA_STATS (
ownname VARCHAR2,
no_invalidate BOOLEAN DEFAULT FALSE,
force BOOLEAN DEFAULT FALSE);
Parameters
| Parameter | Description |
|---|---|
| ownname | The username. If the parameter is set to NULL, the current login username is used by default. |
| no_invalidate | Specifies whether to refresh the plan cache during statistics collection. If you set the value to TRUE, the plan cache will not be refreshed during statistics collection. |
| force | Specifies whether to perform forced deletion and ignore the lock status. The default value is FALSE. If you set the value to TRUE, statistics will be deleted even if they are locked. |
Exceptions
The error code OBE-20000 indicates that the object does not exist, or you do not have the required privileges.
Considerations
To call this procedure, you must be the owner of the table. To call this procedure on a table object in the sys tenant, you must be the table owner or have the SYSDBA privilege.
Examples
Delete the statistics on all tables of the hr user.
obclient> CALL DBMS_STATS.DELETE_SCHEMA_STATS('hr');
Query OK, 0 rows affected