The EXPORT_COLUMN_STATS procedure is used to export column-level statistics.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this.
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 the username 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 column name or extension name. |
| partname | The name of the partition of the table. If the table is partitioned and partname is NULL, then global and partition column statistics are exported. |
| stattab | The name of the table where user statistics are stored. |
| statown | The username of the user who stores the statistics. |
Exceptions
Error code OBE-20000 indicates that the object does not exist or the user does not have sufficient privileges.
Considerations
To call this procedure, you must be the owner of the table. For objects owned by
SYS, you must be the owner or have theSYSDBAprivilege to call this procedure.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.
obclient> CALL DBMS_STATS.EXPORT_COLUMN_STATS('testUser01', 'tbl1','col1',null, stattab=>'test_stat',
statown=>'testUser01');
Query OK, 0 rows affected
