The DELETE_COLUMN_STATS procedure is used to delete column-level statistics.
Syntax
DBMS_STATS.DELETE_COLUMN_STATS (
ownname VARCHAR2,
tabname VARCHAR2,
colname VARCHAR2,
partname VARCHAR2 DEFAULT NULL,
cascade_parts BOOLEAN DEFAULT TRUE,
no_invalidate BOOLEAN DEFAULT FALSE,
force BOOLEAN DEFAULT FALSE,
col_stat_type VARCHAR2 DEFAULT 'ALL');
Parameters
| Parameter | Description |
|---|---|
| ownname | The username. If the username is set to NULL, the current login username will be used by default. |
| tabname | The name of the table to which this column belongs. |
| colname | The column name or extension. |
| partname | The name of the partition where the statistics are stored. If the table is partitioned and partname is NULL, the statistics are stored at the global table level. |
| cascade_parts | Whether to delete statistics at the partition level and subpartition level. The default is TRUE. |
| no_invalidate | Whether to clear the Plan Cache when collecting statistics. Setting it to TRUE means not clearing the Plan Cache when collecting statistics. |
| force | Whether to forcibly collect statistics and ignore the lock status. The default is FALSE. If set to TRUE, statistics will be collected even if they are locked. |
| col_stat_type | The type of column-level statistics to delete. The parameter can be set to the following values:
|
Exceptions
| Error Code | Description |
|---|---|
| HY000 |
|
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.
Examples
Delete all statistics for the col1 column in the tbl1 table of the testUser01 user.
obclient> CALL DBMS_STATS.DELETE_COLUMN_STATS('testUser01', 'tbl1', 'col1',col_stat_type=>'ALL');
Query OK, 0 rows affected
