The DELETE_SCHEMA_STATS procedure deletes statistics for all tables in the specified schema.
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 schema. |
| 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. If the object is in the sys tenant, you must be the owner of the table or have the SYSDBA privilege.
Examples
Delete the statistics on all tables in the hr schema.
obclient> CALL DBMS_STATS.DELETE_SCHEMA_STATS('hr');
Query OK, 0 rows affected