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,
stattab VARCHAR2 DEFAULT NULL,
statid VARCHAR2 DEFAULT NULL,
statown VARCHAR2 DEFAULT NULL,
no_invalidate BOOLEAN DEFAULT FALSE),
force BOOLEAN DEFAULT FALSE);
Parameters
| Parameter | Description |
|---|---|
| ownname | The name of the user. If the username is set to NULL, the current logon username is used by default. |
| stattab | Note The current version does not support this parameter. |
| statid | Note The current version does not support this parameter. |
| statown | Note This parameter is unavailable now. |
| no_invalidate | Note The current version does not support this parameter. |
| force | Specifies whether to perform forced deletion and ignore the lock status. Default value: FALSE. If you set the value to TRUE, statistics will be deleted even if they are locked. |
Exceptions
The error code ORA-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. For objects in the sys tenant, you must be the owner of the table or have the SYSDBA privilege to call this procedure.
Examples
Delete the statistics on all tables of the hr user.
obclient> CALL DBMS_STATS.DELETE_SCHEMA_STATS('hr');
Query OK, 0 rows affected