The EXPORT_SCHEMA_STATS procedure is used to export the statistics of all tables under a schema.
Syntax
DBMS_STATS.EXPORT_SCHEMA_STATS (
ownname VARCHAR2,
stattab VARCHAR2,
statown VARCHAR2 DEFAULT NULL);
Parameters
Parameter |
Description |
|---|---|
| ownname | The name of the schema. |
| stattab | Specifies the table name of the user table for storing statistics. |
| statown | Specifies the username of the user table for storing statistics. |
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 all tables for user testUser01 under the hr schema to the test_stat file.
obclient> CALL DBMS_STATS.EXPORT_SCHEMA_STATS('hr', stattab=>'test_stat', statown=>'testUser01');
Query OK, 0 rows affected