How to check db2 version on Z/OS using only SQL commands?
Thanks, Melita
There is a typo in your SQL. Fixed version is below:
SELECT GETVARIABLE('SYSIBM.VERSION') FROM SYSIBM.SYSDUMMY1;
I ran this on the IBM Mainframe under Z/OS in QMF and got the following results. We are currently running DB2 Version 8 and upgrading to Ver 10.
DSN08015 -- Format seems to be DSNVVMMM
-- PPP IS PRODUCT STRING 'DSN'
-- VV IS VERSION NUMBER E.G. 08
-- MMM IS MAINTENANCE LEVEL E.G. 015
You can query for the built-in session variables with SQL. To identify the version of DB2 on z/OS, you need the SYSIBM.VERSION variable. This will return the PRDID - the product identifier. You can look up the human-readable version in the Knowledge Center.
SELECT GETVARIABLE('SYSIBM.VERSION')
FROM SYSIBM.SYSDUMMY1;
-- for example, the above returns DSN10015
-- DSN10015 identifies DB2 10 in new-function mode (see second link above)
db2ls command will display the db2level along with the install path and install date.
To determine the specific product installed:
db2ls -p -q -b <installpath>
on db2ls command.
The following will appear:
Install Path Level Fix Pack Special Install Number Install Date Installer UID
--------------------------------------------------------------------------------------------
/opt/ibm/db2/V9.7 9.7.0.7 7 Thu Aug 1 12:25:53 2013 CDT 0
visit IBM Website