ENV_SYS_RESOURCES administrative view - Return system information
The ENV_SYS_RESOURCES administrative view returns operating system, CPU, memory and other information related to the system.
Note: The ENV_SYS_RESOURCES administrative view
and the associated ENV_GET_SYS_RESOURCES table function are
deprecated and have been replaced by the ENV_GET_SYSTEM_RESOURCES
table function.
The ENV_SYS_RESOURCES administrative view returns operating system, CPU, memory, and other information related to the system.
The schema is SYSIBMADM.
Authorization
One of the following authorizations
is required:
- SELECT privilege on the ENV_SYS_RESOURCES administrative view
- CONTROL privilege on the ENV_SYS_RESOURCES administrative view
- DATAACCESS authority
Default PUBLIC privilege
In a non-restrictive database, SELECT privilege is granted to PUBLIC when the view is automatically created.
Example
SELECT SUBSTR(NAME,1,20) AS NAME, SUBSTR(VALUE,1,10) AS VALUE,
SUBSTR(DATATYPE,1,10) AS DATATYPE, DBPARTITIONNUM
FROM SYSIBMADM.ENV_SYS_RESOURCES
WHERE SUBSTR(NAME,1,8)='CPU_LOAD' OR NAME='CPU_USAGE_TOTAL'The following is an example of output from this query.
NAME VALUE DATATYPE DBPARTITIONNUM
----------------------- ---------- ---------- --------------
CPU_LOAD_SHORT 0.044052 DECIMAL 0
CPU_LOAD_MEDIUM 0.087250 DECIMAL 0
CPU_LOAD_LONG 0.142059 DECIMAL 0
CPU_USAGE_TOTAL 7 SMALLINT 0
4 record(s) selected.
Usage Notes
To return accurate results, the ENV_SYS_RESOURCES administrative view takes more than 1 second on AIX, HP, and Windows operating systems.
ENV_SYS_RESOURCES administrative view metadata
| Column name | Data type | Description |
|---|---|---|
| NAME | VARCHAR(128) | Name of the attribute. See Table 2 for possible values. Note: Some
attributes might not be available depending on the operating system
and hardware configuration at the server.
|
| VALUE | VARCHAR(1024) | The value of the attribute. |
| DATATYPE | VARCHAR(128) | Attribute data type. |
| UNIT | VARCHAR(128) | Unit used for the VALUE column if applicable. NULL is returned if not applicable. |
| DBPARTITIONNUM | SMALLINT | dbpartitionnum - Database partition number monitor element |
| Information type | Name | Data types | Description | Platforms that return this information | UNIT |
|---|---|---|---|---|---|
| Operating system | OS_NAME | VARCHAR(256) | Name of the operating system software. | All | NULL |
| HOST_NAME | VARCHAR(256) | Host name of the system. | All | NULL | |
| OS_VERSION | VARCHAR(256) | Version of the operating system. For example, AIX®: 4.3 version = 4. | All | NULL | |
| OS_RELEASE | VARCHAR(256) | Release of the operating system. For example, AIX: 4.3 release = 3. | All | NULL | |
| MACHINE_IDENTIFICATION | VARCHAR(256) | Machine hardware identification. | All | NULL | |
| OS_LEVEL | VARCHAR(256) | Maintenance level of the current version and release. For example, LINUX: 2.4.9, level = 9. | Linux® | NULL | |
| CPU | CPU_TOTAL | BIGINT | Total number of CPUs. | All | NULL |
| CPU_ONLINE | BIGINT | Number of CPUs online. | All | NULL | |
| CPU_CONFIGURED | BIGINT | Number of CPUs configured. | All | NULL | |
| CPU_SPEED | BIGINT | Speed of CPUs. | All | MHz | |
| CPU_TIMEBASE | BIGINT | Frequency of timebase register increment. | Linux PowerPC® | Hz | |
| CPU_HMT_DEGREE | BIGINT | On systems that support hardware multithreading (HMT), this is the number of processors that a physical processor will appear to the operating system as. On non-HMT systems, this value is 1. On HMT systems, "total" will reflect the number of logical CPUs. To get the number of physical CPUs, divide the "total" by "threadingDegree". | All | NULL | |
| CPU_CORES_PER_SOCKET | BIGINT | Number of CPU cores per socket. On single core systems this value is 1. | All | NULL | |
| Physical memory | MEMORY_TOTAL | BIGINT | Total size of physical memory. | All | MB |
| MEMORY_FREE | BIGINT | Amount of free physical memory. | All | MB | |
| MEMORY_SWAP_TOTAL | BIGINT | Total amount of swap space. | All | MB | |
| MEMORY_SWAP_FREE | BIGINT | Amount of free swap space. | All | MB | |
| Virtual memory | VIRTUAL_MEM_TOTAL | BIGINT | Total amount of virtual memory on the system. | All | MB |
| VIRTUAL_MEM_RESERVED | BIGINT | Amount of reserved virtual memory. | All | MB | |
| VIRTUAL_MEM_FREE | BIGINT | Amount of virtual memory free. | All | MB | |
| CPU load | CPU_LOAD_SHORT | DECIMAL | Shortest period duration. For example, load samples over last 5 minutes. | All except Windows operating systems | NULL |
| CPU_LOAD_MEDIUM | DECIMAL | Medium period duration. For example, load samples over last 10 minutes. | All except Windows operating systems | NULL | |
| CPU_LOAD_LONG | DECIMAL | Long period duration. For example, load samples over last 15 minutes. | All except Windows operating systems | NULL | |
| CPU_USAGE_TOTAL | SMALLINT | Percentage of overall CPU usage of the machine. | All | Percent |