The DELETE_COLUMN_STATS procedure deletes column-level statistics.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
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 parameter 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 the extension name. |
| partname | The name of the partition where the table for storing statistics resides. If the table is partitioned and partname is NULL, statistics are stored at the table level. |
| cascade_parts | Specifies whether to delete statistics at the partition level and the subpartition level. The default value is TRUE. |
| no_invalidate | Specifies whether to refresh the plan cache during statistics collection. If you set the value to TRUE, the plan cache will not be refreshed during statistics collection. |
| force | Specifies whether to perform forced collection and ignore the lock status. The default value is FALSE. If you set the value to TRUE, statistics will be collected even if statistics are locked. |
| col_stat_type | The type of the column-level statistics to be deleted. Valid values:
|
Exceptions
| Error code | Description |
|---|---|
| OBE-20000 | The object does not exist, or you do not have the required privileges. |
| OBE-20005 | Statistics on the object are locked. |
Considerations
To call this procedure, you must be the owner of the table. To call this procedure on a table object in the sys tenant, you must be the table owner or have the SYSDBA privilege.
Examples
Delete all statistics on the col1 column of 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