SYSTMPSTG view

The SYSTMPSTG view contains one row for every temporary storage bucket that is tracking some amount of temporary storage across the system.

Temporary storage is application working storage that does not persist across a restart of the operating system. Accounting for all the temporary storage being used on the system is implemented using the concept of temporary storage buckets.
There are two types of temporary storage buckets:
  • global buckets that are used to track temporary storage that is scoped to all jobs on the system.
  • job buckets that are used to track temporary storage that is scoped to a single job.

Each bucket has a bucket number. Global buckets managed by the licensed internal code have bucket numbers from 1 to 4095. Global buckets managed by IBM i Work Management have bucket numbers from 4096 to 65535. Job buckets have numbers greater than 65535.

A job temporary storage bucket is assigned when the job starts and does not change for the life of the job. A job temporary storage bucket will normally be empty after the associated job ends and all working storage for the job is deleted or freed. If the job temporary storage bucket is empty after the job ends, the bucket becomes available to be associated with a new job. If the job associated with the job buckets ends and some temporary objects tracked to that job are not deleted, the job bucket will show a status of *ENDED as well as the date and time that the job ended. These job buckets identify jobs that are not deleting all of their temporary storage when the job ends.

Statistics for each job bucket indicate the current amount of storage (in bytes) used for temporary storage tracked by the bucket, the storage limit (in bytes) for disk storage used for temporary storage tracked by the bucket, and the peak amount of disk storage (in bytes) used for temporary storage tracked by the bucket. A job bucket does not include any temporary storage used for SQL query execution. For job buckets, the storage limit will reflect the MAXTMPSTG value of the class (*CLS) object specified when the job was submitted; a null value is returned if the job has a MAXTMPSTG value of *NOMAX.

The following table describes the columns in the view. The schema is QSYS2.

Table 1. SYSTMPSTG view
Column Name System Column Name Data Type Description
BUCKET_NUMBER BKTNBR INTEGER Number that uniquely identifies the temporary storage bucket.
GLOBAL_BUCKET_NAME GLBBKTNAME
VARCHAR(30)
Nullable
For global buckets, the name of the bucket.

For job buckets, contains the null value.

JOBNAME JOBNAME
VARCHAR(10)
Nullable
For job buckets, the job name.

For global buckets, contains the null value.

JOB_USER_NAME JOBUSRNAME
VARCHAR(10)
Nullable
For job buckets, the user profile under which the job is run.

For global buckets, contains the null value.

JOB_NUMBER JOBNBR
CHAR(6)
Nullable
For job buckets, the job number assigned by the system.

For global buckets, contains the null value.

BUCKET_CURRENT_SIZE BKTCURSIZ DECIMAL(23,0) The current number of bytes of disk storage for this temporary storage bucket.
BUCKET_LIMIT_SIZE BKTLMTSIZ
DECIMAL(23,0)
Nullable
The current limit, in bytes, for the amount of disk storage for this temporary storage bucket. If the temporary storage bucket has no limit, contains the null value.
BUCKET_PEAK_SIZE BKTPEAKSIZ DECIMAL(23,0) The largest number of bytes of disk storage for this temporary storage bucket. For global buckets, this is the peak amount of disk storage since the last restart of the operating system. For job buckets, this is the peak amount of disk storage since the job was started.
JOB_STATUS JOBSTS
VARCHAR(7)
Nullable
For job buckets, indicates whether the bucket is associated with an active job or a job that ended without deleting all temporary objects associated with the job.
*ENDED
The job associated with this job bucket has ended.
*ACTIVE
The job associated with this job bucket is still active.

For global buckets, contains the null value.

JOB_ENDED_TIME JOBENDTIM
TIMESTAMP
Nullable
For job buckets associated with jobs that have ended, indicates the timestamp of when the associated job ended.

Contains the null value for global buckets and job buckets associated with active jobs.