CREATE_STAT_TABLE procedure - Creates a table for statistics
The CREATE_STAT_TABLE procedure creates a table where statistics are stored.
Syntax
Parameters
- ownname
- An input argument of type VARCHAR(128) that specifies the schema of the table.
- stattab
- An input argument of type VARCHAR(128) that specifies the identifier of the table where the current user statistics are to be saved.
- tblspace
- An input argument of type VARCHAR(128) that specifies the size of the table.
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.
