SQL 如何检查 db2 版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3821795/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to check db2 version
提问by gizmo
How to check db2 version on Z/OS using only SQL commands?
如何仅使用 SQL 命令检查 Z/OS 上的 db2 版本?
Thanks, Melita
谢谢,梅丽塔
回答by CanSpice
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.
它适用于 LUW,所以我不能保证它适用于 z/OS,但值得一试。
回答by bugs
SELECT GETVARIABLE('SYSIBM.VERSION') FROM SYSIBM.SYSDUMMY1
回答by Christian Maslen
There is also the env_inst_info admin view. As with CanSpice I can only vouch for LUW, but there should at least be a similar view available for Z/OS.
还有 env_inst_info 管理视图。与 CanSpice 一样,我只能保证 LUW,但至少应该有类似的视图可用于 Z/OS。
SELECT * FROM SYSIBMADM.ENV_INST_INFO
回答by CCRDad
I used
我用了
SELECT * FROM TABLE(SYSPROC.ENV_GET_INST_INFO());
from tyranitar and that worked on Z/OS. Here's what I got:
来自 tyranitar 并且在 Z/OS 上工作。这是我得到的:
SERVICE_LEVEL
DB2 v9.7.0.6
I'd vote up if I could! Thanks!!
如果可以,我会投票!谢谢!!
回答by Ramesh John
To find out the fixpak information using command prompt: db2level
使用命令提示符查找修订包信息: db2level
To find out the version and license information using command prompt: db2licm -l
使用命令提示符查找版本和许可证信息: 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"
回答by Shariq A
There is a typo in your SQL. Fixed version is below:
您的 SQL 中存在拼写错误。固定版本如下:
SELECT GETVARIABLE('SYSIBM.VERSION') FROM SYSIBM.SYSDUMMY1;
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.
我在 QMF 中 Z/OS 下的 IBM 大型机上运行它并得到以下结果。我们目前正在运行 DB2 版本 8 并升级到版本 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
回答by orbanbalage
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.
您可以使用 SQL 查询内置会话变量。要识别 z/OS 上的 DB2 版本,您需要SYSIBM.VERSION 变量。这将返回PRDID - 产品标识符。您可以在知识中心 中查找人类可读的版本。
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)
回答by ramit girdhar
Both worked for me.
两者都对我来说有效。
SELECT * FROM TABLE(SYSPROC.ENV_GET_INST_INFO());
or
或者
SELECT * FROM SYSIBMADM.ENV_INST_INFO;
回答by Alberto
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());
回答by Sarang Golwalkar
For DB2
:
对于DB2
:
"SELECT * FROM SYSIBMADM.ENV_INST_INFO" - SERVICE_LEVEL