Skip to main content

EXPORT_INDEX_STATS

The EXPORT_INDEX_STATS procedure is used to retrieve the statistics of 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

ParameterDescription
ownnameThe username. If the username is set to NULL, the current login username is used by default.
indnameThe index name.
partnameThe name of the index partition. If the index is partitioned and partname is NULL, the global and partition index statistics are exported.
stattabThe name of the user table where the statistics are stored.
statownThe username of the user who stores the statistics.
tabnameThe table name.

Exceptions

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

Usage

  • 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 idx1 index on the tbl1 table of the testUser01 user to test_stat.

CALL DBMS_STATS.EXPORT_INDEX_STATS('testUser01', 'idx1',stattab=>'test_stat', tabname=>'tbl1');
Query OK, 0 rows affected
info

seekdb requires the table name to be explicitly specified because the index is not unique under the current user.