CREATE_STAT_TABLE

2025-11-14 07:33:32  Updated

The CREATE_STAT_TABLE procedure creates a table under the specified user to store statistics.

Applicability

This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.

Syntax

DBMS_STATS.CREATE_STAT_TABLE(
    ownname          VARCHAR2,
    stattab          VARCHAR2,
    tblspace         VARCHAR2 DEFAULT NULL,
    global_temporary BOOLEAN DEFAULT FALSE);

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 to be created.
tblspace The name of the tablespace where the user statistics table to be created resides. If you do not specify this parameter, the default tablespace is used.
global_temporary
Note The current version does not support this parameter.

Exceptions

Error code Description
OBE-20000 The table does not exist, or you do not have the required privileges.
OBE-20001 The tablespace does not exist.

Considerations

To call this procedure, you must have the privilege to create a table under the specified user.

Examples

Create a user statistics table named test_stat for the testUser01 user.

obclient> CALL DBMS_STATS.CREATE_STAT_TABLE('testUser01', 'test_stat');
Query OK, 0 rows affected

Contact Us