CREATE_STAT_TABLE procedure - Creates a table for statistics

The CREATE_STAT_TABLE procedure creates a table where statistics are stored.

Syntax

Read syntax diagramSkip visual syntax diagram DBMS_STATS.CREATE_STAT_TABLE ( ownname , stattab , tblspace

Parameters

ownname
An input argument of type VARCHAR(128) that specifies the schema of the table.
The argument is case-sensitive.
stattab
An input argument of type VARCHAR(128) that specifies the identifier of the table where the current user statistics are to be saved.
The default value is NULL.
The argument is case-sensitive.
tblspace
An input argument of type VARCHAR(128) that specifies the size of the table.
The default value is NULL.
The argument is case-sensitive.

Authorization

EXECUTE privilege on the DBMS_STATS module.

Example 1

BEGIN
CALL DBMS_STATS.CREATE_STAT_TABLE(CURRENT SCHEMA,'STATSTABLE1','USERSPACE');
END;

DB20000I  The SQL command completed successfully.

SELECT TABNAME FROM SYSSTAT.TABLES WHERE TABNAME = 'STATSTABLE1' AND TABSCHEMA = CURRENT SCHEMA

TABNAME
-----------------------------
STATSTABLE1

1 record(s) selected.

Example 2

BEGIN
CALL DBMS_STATS.CREATE_STAT_TABLE(CURRENT SCHEMA,'STATS\"TABLE1','USERSPACE');
END;

DB20000I  The SQL command completed successfully.

SELECT TABNAME FROM SYSSTAT.TABLES WHERE TABNAME = 'STATS\"TABLE1' AND TABSCHEMA = CURRENT SCHEMA

TABNAME
-----------------------------
STATS"TABLE1

1 record(s) selected.

Example 3

The name of the STATSTABLE is greater than 128 characters.

BEGIN
CALL DBMS_STATS.CREATE_STAT_TABLE(CURRENT SCHEMA,'STATSTABLE1STATSTABLE1STATSTABLE1STATSTABLE1
STATSTABLE1STATSTABLE1STATSTABLE1STATSTABLE1STATSTABLE1STATSTABLE1STATSTABLE1STATSTABLE1');
END;

Output:
SQL0433N  Value "STATSTABLE1STATSTABLE1STATSTABLE1STATSTABLE1STATSTABLE1STATS"
is too long.