How to check db2 version on Z/OS using only SQL commands?
Thanks, Melita
How to check db2 version on Z/OS using only SQL commands?
Thanks, Melita
Both worked for me.
SELECT * FROM TABLE(SYSPROC.ENV_GET_INST_INFO());
or
SELECT * FROM SYSIBMADM.ENV_INST_INFO;
Another one in v11:
select CURRENT APPLICATION COMPATIBILITY from sysibm.sysdummy1
Result:
V11R1
It's not the current version, but the current configured level for the application.
In z/OS while on version 10, use of CURRENT APPLICATION COMPATIBILITY is not allowed. You will have to resort to:
SELECT GETVARIABLE('SYSIBM.VERSION') AS VERSION,
GETVARIABLE('SYSIBM.NEWFUN') AS COMPATIBILITY
FROM SYSIBM.SYSDUMMY1;
Here is a link to all the variables available: https://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/sqlref/src/tpc/db2z_refs2builtinsessionvars.html#db2z_refs2builtinsessionvars
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