The EXPORT_INDEX_STATS procedure is used to retrieve statistics for a specified index and store them in the 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 | Username. If the username is set to NULL, the current logged-in username will be used by default. |
| indname | Index name. |
| partname | The name of the index partition. If the index is already partitioned and partname For NULL, global and partitioned index statistics are exported. |
| stattab | Specifies the table name of the user table for storing statistics. |
| statown | Specifies the username of the user table for storing statistics. |
| tabname | Table name. |
Exceptions
Error code HY000 indicates that the object does not exist or the permission is insufficient.
Usage instructions
To call this procedure, you must be the owner of the table. For objects owned by
SYS, you must be the table owner or have theSYSDBAprivilege to call this procedure.Exporting or importing statistics is not supported across databases with different character sets.
Examples
Export the statistics of index idx1 on table tbl1 for user testUser01 to test_stat.
obclient> CALL DBMS_STATS.EXPORT_INDEX_STATS('testUser01', 'idx1',stattab=>'test_stat', tabname=>'tbl1');
Query OK, 0 rows affected
Note
The table name must be explicitly specified in OceanBase AI Database because indexes are not unique under the current user.