The EXPORT_SCHEMA_STATS procedure exports the statistics on all tables of the specified user.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_STATS.EXPORT_SCHEMA_STATS (
ownname VARCHAR2,
stattab VARCHAR2,
statid VARCHAR2 DEFAULT NULL,
statown VARCHAR2 DEFAULT NULL);
Parameters
| Parameter | Description |
|---|---|
| ownname | The username. If the parameter is set to NULL, the current login username is used by default. |
| stattab | The name of the user statistics table for storing statistics. |
| statid | Note The current version does not support this parameter. |
| statown | The username of the user statistics table for storing statistics. |
Exceptions
The error code OBE-20000 indicates that the object does not exist, or you do not have the required privileges.
Considerations
To call this procedure, you must be the owner of the table. To call this procedure on a table object owned by the
SYSuser, you must be the table owner or have theSYSDBAprivilege.You cannot export or import statistics across databases that use different character sets.
Examples
Export the statistics on all tables of the hr user to the test_stat table of the testUser01 user.
obclient> CALL DBMS_STATS.EXPORT_SCHEMA_STATS('hr', stattab=>'test_stat', statown=>'testUser01');
Query OK, 0 rows affected