DELETE_COLUMN_STATS
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 ownname is set to NULL, the current login username is used by default. |
| tabname | The name of the table to which the column belongs. |
| colname | The column name or alias. |
| 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 value is TRUE. |
| no_invalidate | Whether to clear the Plan Cache when collecting statistics. If set to TRUE, the Plan Cache will not be cleared when collecting statistics. |
| force | Whether to forcibly collect statistics and ignore the lock status. The default value 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 |
|
Usage
To call this procedure, you must be the owner of the table.
Examples
Delete all statistics for the col1 column in the tbl1 table of user testUser01.
CALL DBMS_STATS.DELETE_COLUMN_STATS('testUser01', 'tbl1', 'col1',col_stat_type=>'ALL');
Query OK, 0 rows affected