The DELETE_SCHEMA_STATS procedure is used to delete statistics for all tables under a specified user.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this.
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 username is set to NULL, the current login username will be used. |
| no_invalidate | Specifies whether to clear the Plan Cache when collecting statistics. Set to TRUE to not clear the Plan Cache when collecting statistics. |
| force | Specifies whether to forcibly delete statistics, ignoring lock status. Default is FALSE. If set to TRUE, statistics will be deleted even if they are locked. |
Exceptions
Error code OBE-20000 indicates that the object does not exist or that the user does not have sufficient privileges.
Considerations
To call this procedure, you must be the owner of the table. For objects owned by SYS, you must be the owner or have the SYSDBA privilege.
Examples
Delete statistics for all tables under the hr user.
obclient> CALL DBMS_STATS.DELETE_SCHEMA_STATS('hr');
Query OK, 0 rows affected
