Example: Modifying PERM, SPOOL, and TEMPORARY Space Using Constant Expression - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

This example creates PERM space for a user with a size based on the constant expression 2,000,000 (HASHAMP()+1), SPOOL space with a size based on the same constant expression, 2,000,000 (HASHAMP()+1), and TEMPORARY space with a size based on the constant expression 2,000,000 (HASHAMP()+1). The expressions calculate the number of AMPs in the current system and scale the PERM, SPOOL, and TEMPORARY space for the sls120639 user to that size.

This is the original definition of user sls120639.

     CREATE USER sls120639 AS
       DEFAULT DATABASE = it_dev,
       PASSWORD = (EXPIRE = 0),
       PERM = 2000000*(HASHAMP()+1),
       SPOOL = 2000000*(HASHAMP()+1),
       TEMPORARY = 2000000*(HASHAMP()+1);

The following MODIFY USER statement changes the PERM, SPOOL, and TEMPORARY space allocations for this user as follows.

     MODIFY USER sls120639 AS
       DEFAULT DATABASE = it_dev,
       PASSWORD = (EXPIRE = 0),
       PERM = 3000000*(HASHAMP()+1),
       SPOOL = 3000000*(HASHAMP()+1)
       TEMPORARY = 3000000*(HASHAMP()+1);