USER_STORAGE view

The USER_STORAGE view contains details about storage Start of changeand authority entriesEnd of change for user profiles.

Start of changeEvery user profile contains information used for managing ownership and authority of objects. This view returns information about consumption of these authority-related entries, including different categories of usage.End of change

The information returned is similar to the detail from the Retrieve User Information (QSYRUSRI) API.

Information is broken down by SYSBAS and independent auxiliary storage pool (IASP). To see information for IASPs, the IASP must be varied on.

Authorization: The caller must have *OBJOPR and *READ authorities to the *USRPRF.

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

Table 1. USER_STORAGE view
Column Name System Column Name Data Type Description
AUTHORIZATION_NAME USER_NAME VARCHAR(10) User profile name.
ASPGRP ASPGRP VARCHAR(10) Name of the independent ASP or *SYSBAS.
MAXIMUM_STORAGE_ALLOWED MAXSTG BIGINT
Nullable
The maximum amount of auxiliary storage, in kilobytes, that can be assigned to store permanent objects owned by the user.

Contains the null value if the user does not have a maximum amount of allowed storage.

STORAGE_USED STGUSED BIGINT The amount of auxiliary storage, in kilobytes, occupied by the user's owned objects for this ASP group.
Start of changeAVAILABLE_PROFILE_ENTRIESEnd of change Start of changeAVAIL_ENTEnd of change Start of changeBIGINTEnd of change Start of changeThe number of authority-related entries available to the user for this ASP group.End of change
Start of changeTOTAL_PROFILE_ENTRIESEnd of change Start of changeTOTAL_ENTEnd of change Start of changeBIGINTEnd of change Start of changeThe total number of authority-related entries used by the user for this ASP group. This is the total of owner, private authority, authorized user, and primary group entries used.End of change
Start of changeOWNER_ENTRIESEnd of change Start of changeOWN_ENTEnd of change Start of changeBIGINTEnd of change Start of changeThe number of owner entries used by the user for this ASP group. This is the number of entries for objects for which this user is the owner.End of change
Start of changePRIVATE_AUTHORITY_ENTRIESEnd of change Start of changePRIV_ENTEnd of change Start of changeBIGINTEnd of change Start of changeThe number of private authority entries used by the user for this ASP group. This is the number of entries for objects for which this user has a private authority.End of change
Start of changeAUTHORIZED_USER_ENTRIESEnd of change Start of changeUSER_ENTEnd of change Start of changeBIGINTEnd of change Start of changeThe number of authorized user entries used by the user for this ASP group. This is the number of entries for other users that have private authorities to objects for which this user is the owner.End of change
Start of changePRIMARY_GROUP_ENTRIESEnd of change Start of changePGP_ENTEnd of change Start of changeBIGINTEnd of change Start of changeThe number of primary group entries used by the user for this ASP group. This is the number of entries for objects for which this user is the primary group.End of change
Start of change
TEMP_AVAILABLE_PROFILE_
ENTRIES
End of change
Start of changeAVAIL_TEMPEnd of change Start of changeBIGINT
Nullable
End of change
Start of changeThe number of authority entries available to the user for temporary objects in a user-defined file system (UDFS).

Contains the null value if ASPGRP is not *SYSBAS or if the user has no UDFS temporary authority entries.

End of change
Start of changeTEMP_TOTAL_PROFILE_ENTRIESEnd of change Start of changeTOTAL_TEMPEnd of change Start of changeBIGINT
Nullable
End of change
Start of changeThe total number of authority entries used by the user for temporary objects in a UDFS. This is the total of owner, private authority, authorized user, and primary group entries used.

Contains the null value if ASPGRP is not *SYSBAS or if the user has no UDFS temporary authority entries.

End of change
Start of changeTEMP_OWNER_ENTRIESEnd of change Start of changeOWN_TEMPEnd of change Start of changeBIGINT
Nullable
End of change
Start of changeThe number of owner entries used by the user for temporary objects in a UDFS. This is the number of entries for objects for which this user is the owner.

Contains the null value if ASPGRP is not *SYSBAS or if the user has no UDFS temporary authority entries.

End of change
Start of change
TEMP_PRIVATE_AUTHORITY_
ENTRIES
End of change
Start of changePRIV_TEMPEnd of change Start of changeBIGINT
Nullable
End of change
Start of changeThe number of private authority entries used by the user for temporary objects in a UDFS. This is the number of entries for objects for which this user has a private authority.

Contains the null value if ASPGRP is not *SYSBAS or if the user has no UDFS temporary authority entries.

End of change
Start of changeTEMP_AUTHORIZED_USER_ENTRIESEnd of change Start of changeUSER_TEMPEnd of change Start of changeBIGINT
Nullable
End of change
Start of changeThe number of authorized user entries used by the user for temporary objects in a UDFS. This is the number of entries for other users that have private authorities to objects for which this user is the owner.

Contains the null value if ASPGRP is not *SYSBAS or if the user has no UDFS temporary authority entries.

End of change
Start of changeTEMP_PRIMARY_GROUP_ENTRIESEnd of change Start of changePGP_TEMPEnd of change Start of changeBIGINT
Nullable
End of change
Start of changeThe number of primary group entries used by the user for temporary objects in a UDFS. This is the number of entries for objects for which this user is the primary group.

Contains the null value if ASPGRP is not *SYSBAS or if the user has no UDFS temporary authority entries.

End of change

Examples

  • Determine how much storage user SCOTTF has consumed.
    SELECT * FROM QSYS2.USER_STORAGE
      WHERE USER_NAME = 'SCOTTF';
  • Start of changeFind user profiles that have reached at least 80% of their authority-related entry consumption.
    WITH HIGH_USAGE_PROFILES AS (
         SELECT AUTHORIZATION_NAME, DECIMAL(
                       (DECIMAL(AVAILABLE_PROFILE_ENTRIES,21,2)/
                          (DECIMAL(AVAILABLE_PROFILE_ENTRIES,21,2) + 
                           DECIMAL(TOTAL_PROFILE_ENTRIES,21,2))) *100 ,5,2) AS PERCENT_USED 
            FROM QSYS2.USER_STORAGE)
    SELECT AUTHORIZATION_NAME, PERCENT_USED FROM HIGH_USAGE_PROFILES
      WHERE PERCENT_USED >= 80;
    End of change