We reduce and optimize the times of our activities

Get system info in SQL

How many times have you had to quickly get the IBM i's system information?
The supplier asks me them for calculating a license, the support asks me them for carrying on with the ticket, the auditor asks me them for packaging a report...
Obviously the IBM i commands allow to obtain them, but do we always remember all of them?
Do you know that, from 7.2 version of the system I can have them all, instantly, executing some simple SQL queries?
Here is how to do and you will have all what you need in no time.

SYSTEM MODEL NUMBER - SYSTEM PROCESSOR FEATURE - SERIAL NUMBER
by ODBC:

SELECT system_value_name, cast(current_character_value as varchar(6)) FROM QSYS2.SYSTEM_VALUE_INFO WHERE system_Value_name in ('QMODEL','QPRCFEAT','QSRLNBR')

by STRSQL command:

SELECT system_value_name, cast(current_character_value as varchar(6)) FROM QSYS2/SYSTEM_VALUE_INFO WHERE system_Value_name in ('QMODEL','QPRCFEAT','QSRLNBR')

OS_NAME - OS_VERSION - OS_RELEASE - .....
by ODBC:

SELECT * FROM SYSIBMADM.ENV_SYS_INFO

by STRSQL command:

SELECT * FROM SYSIBMADM/ENV_SYS_INFO

and we obtain:
OS_NAME Operating system name
OS_VERSION Operating system version
OS_RELEASE Operating system release
HOST_NAME Name of the system
TOTAL_CPUS The maximum number of virtual processors defined within the LPAR configuration
CONFIGURED_CPUS The number of virtual processors currently available to the partition
CONFIGURED_MEMORY Total amount of configured memory on the system, in megabytes
TOTAL_MEMORY Total amount of memory on the system, in megabytes

Marco Moret Monitoring Project Manager at smeup ICS
 You can also find the article on LinkedIn


All articles
 Writers Manager: Monitor and manage printers with SQL
 Checking security on IBM i systems: the Audit Journal
 The first JDBC connection from C# to IBM i
 JTOpen, develop applications in .Net for IMB i
 DB2 for i: manage dates in SQL
 Get system info in SQL

Manage, analyze and control your Systems IBM i
Download, install and use in seconds
  IBM i Monitoring Facility - Check is completely free until the end of the month

Update cookies preferences