DELETE_COLUMN_STATS

2023-10-24 09:23:03  Updated

The DELETE_COLUMN_STATS procedure deletes column-level statistics.

Syntax

DBMS_STATS.DELETE_COLUMN_STATS (
    ownname            VARCHAR2,
    tabname            VARCHAR2,
    colname            VARCHAR2,
    partname           VARCHAR2 DEFAULT NULL,
    cascade_parts      BOOLEAN  DEFAULT TRUE);

Parameters

Parameter Description
ownname The username. If the username is set to NULL, the current logon 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 sub-partition level. Default value: TRUE.

Exceptions

Error code Description
ORA-20000 The object does not exist, or you do not have the required privileges.
ORA-20005 Statistics on the object are locked.

Usage notes

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 all statistics on the col1 column in the tbl1 table of the testUser01 user.

obclient> CALL DBMS_STATS.DELETE_COLUMN_STATS('testUser01', 'tbl1', 'col1');
Query OK, 0 rows affected

Contact Us