The EXPORT_INDEX_STATS procedure retrieves statistics on the specified index and stores them in a statistics table.
Syntax
DBMS_STATS.EXPORT_INDEX_STATS (
ownname VARCHAR2,
indname VARCHAR2,
partname VARCHAR2 DEFAULT NULL,
stattab VARCHAR2,
statown VARCHAR2 DEFAULT NULL),
tabname VARCHAR2 DEFAULT NULL;
Parameters
| Parameter | Description |
|---|---|
| ownname | The username. If the username is set to NULL, the current login username is used by default. |
| indname | The name of the index. |
| partname | The name of the index partition. If the index is partitioned and partname is NULL, global statistics and partition index statistics are exported. |
| stattab | The name of the user statistics table for storing statistics. |
| statown | The username of the user statistics table for storing statistics. |
| tabname | The name of the table. |
Exceptions
The error code HY000 indicates that the object does not exist, or that you do not have the required privileges.
Considerations
To call this procedure, you must be the owner of the table. If the object is in the
systenant, you must be the owner of the table or have theSYSDBAprivilege.You cannot export or import statistics across databases that use different character sets.
Examples
Export the statistics on the idx1 index in the tbl1 table of the testUser01 user to the test_stat table.
obclient> CALL DBMS_STATS.EXPORT_INDEX_STATS('testUser01', 'idx1',stattab=>'test_stat', tabname=>'tbl1');
Query OK, 0 rows affected
Note
In the Oracle-compatible mode of OceanBase Database, you do not need to specify tabname because indexes are unique in the current user. However, in the MySQL mode, you must explicitly specify the table name because indexes are not unique in the current user.