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
| 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 this column belongs. |
| colname | The name of the column or extension. |
| partname | The name of the partition of the table. If the table is partitioned and partname is NULL, both global and partition column statistics are exported. |
| stattab | The name of the table to store the user statistics. |
| statown | The 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