Skip to main content

EXPORT_COLUMN_STATS

The EXPORT_COLUMN_STATS procedure is used to export column-level statistics.

Syntax

DBMS_STATS.EXPORT_COLUMN_STATS (
ownname VARCHAR2,
tabname VARCHAR2,
colname VARCHAR2,
partname VARCHAR2 DEFAULT NULL,
stattab VARCHAR2,
statown VARCHAR2 DEFAULT NULL);

Parameters

ParameterDescription
ownnameThe username. If ownname is set to NULL, the current login username is used by default.
tabnameThe name of the table to which this column belongs.
colnameThe name of the column or extension.
partnameThe name of the partition of the table. If the table is partitioned and partname is NULL, both global and partition column statistics are exported.
stattabThe name of the table to store the user statistics.
statownThe username of the user who stores the statistics user table.

Exceptions

The error code HY000 indicates that the object does not exist or that the user does not have sufficient privileges.

Usage notes

  • To call this procedure, you must be the owner of the table.

  • Statistics cannot be exported or imported between databases with different character sets.

Examples

Export the statistics of the col1 column in the tbl1 table of the testUser01 user to test_stat.

CALL DBMS_STATS.EXPORT_COLUMN_STATS('testUser01', 'tbl1','col1',null, stattab=>'test_stat',
statown=>'testUser01');
Query OK, 0 rows affected