How to check db2 version on Z/OS using only SQL commands?
Thanks, Melita
To find out the fixpak information using command prompt: db2level
To find out the version and license information using command prompt: db2licm -l
C:\Users\Administrator>db2level
DB21085I This instance or install (instance name, where applicable: "DB2")
uses "64" bits and DB2 code release "SQL10051" with level identifier
"0602010E".
Informational tokens are "DB2 v10.5.100.63", "s130816", "IP23521", and Fix Pack
"1".
Product is installed at "C:\SQLLIB" with DB2 Copy Name "DB2COPY1".
C:\Users\Administrator>db2licm -l
Product name: "IBM Data Server Client"
Product identifier: "db2client"
Version information: "10.5"
In AIX you can try:
db2level
Example output:
db2level
DB21085I This instance or install (instance name, where applicable:
"db2inst1") uses "64" bits and DB2 code release "SQL09077" with level
identifier "08080107".
Informational tokens are "DB2 v9.7.0.7", "s121002", "IP23367", and Fix Pack
"7".
Product is installed at "/db2_09_07".
You can try the following query:
SELECT service_level, fixpack_num FROM TABLE
(sysproc.env_get_inst_info())
as INSTANCEINFO
It works on LUW, so I can't guarantee that it'll work on z/OS, but it's worth a shot.
I used
SELECT * FROM TABLE(SYSPROC.ENV_GET_INST_INFO());
from tyranitar and that worked on Z/OS. Here's what I got:
SERVICE_LEVEL
DB2 v9.7.0.6
I'd vote up if I could! Thanks!!
SELECT GETVARIABLE('SYSIBM.VERSION') FROM SYSIBM.SYSDUMMY1
Try the first or the second:
SELECT * FROM TABLE(SYSPROC.ENV_GET_INST_INFO());
SELECT * FROM TABLE(SYSPROC.ENV_GET_PROD_INFO());
SELECT * FROM TABLE(SYSPROC.ENV_GET_SYS_INFO());