The DELETE_COLUMN_STATS procedure is used to drop 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 |
Explanation |
|---|---|
| ownname | Username. If the username is set to NULL, the current logged-in username will be used by default. |
| tabname | The name of the table to which this column belongs. |
| colname | Column name or extension. |
| partname | The name of the partition where the table storing statistics resides. If the table is partitioned and partname is NULL, the statistics are stored at the global table level. |
| cascade_parts | Whether to delete partition-level and subpartition-level statistics simultaneously. Default value: TRUE. |
| no_invalidate | Whether to flush the plan cache during statistics collection. Valid values: TRUE Indicates that the plan cache is not flushed during statistics collection. |
| force | Whether to forcibly collect the data, ignoring the lock status. Default is FALSE. If set to TRUE Statistics collection continues even when statistics locks are acquired. |
| col_stat_type | Specifies the types of column-level statistics to be deleted. Valid values:
|
Exceptions
Error Code |
Description |
|---|---|
| HY000 |
|
Usage instructions
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
Drops all statistics for the col1 column in table tbl1 of user testUser01.
obclient> CALL DBMS_STATS.DELETE_COLUMN_STATS('testUser01', 'tbl1', 'col1',col_stat_type=>'ALL');
Query OK, 0 rows affected