Skip to main content

CREATE_STAT_TABLE

The CREATE_STAT_TABLE procedure is used to create a table in the specified schema to store statistics.

Syntax

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

Parameters

ParameterDescription
ownnameThe username. If the username is set to NULL, the current login username will be used by default.
stattabThe name of the statistics user table to be created.
tblspaceThe name of the tablespace where the newly created statistics user table is located. If this parameter is not specified, the default tablespace of the user will be used.
global_temporary
Description This parameter is not supported in the current version.

Exceptions

Error CodeDescription
HY000
  • The table does not exist or the user does not have sufficient privileges.
  • The tablespace does not exist.

Usage

You need to have the necessary privileges to create a table in the specified schema.

Examples

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

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