Skip to main content
Version: V1.0.0

EXPORT_SCHEMA_STATS

The EXPORT_SCHEMA_STATS procedure is used to export statistics for all tables in a schema.

Syntax

DBMS_STATS.EXPORT_SCHEMA_STATS (
ownname VARCHAR2,
stattab VARCHAR2,
statown VARCHAR2 DEFAULT NULL);

Parameters

ParameterDescription
ownnameThe name of the schema.
stattabThe name of the user table where the statistics are stored.
statownThe name of the user who owns the user table where the statistics are stored.

Exceptions

The error code HY000 indicates that the object does not exist or 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 statistics for all tables in the hr schema owned by the user testUser01 to the test_stat table.

CALL DBMS_STATS.EXPORT_SCHEMA_STATS('hr', stattab=>'test_stat', statown=>'testUser01');
Query OK, 0 rows affected