如何查看db2 产品是否有root 安装的,安装的什么db2的那个产品呢?

今天看到群友问了两个问题:

1 怎么确认我的db2是否由root安装的呢?


其实从DB2UDB V9.1有了db2ls这个命令后,这个问题就简单多了,我们只需要简单的跑下db2ls,然后看输出的Installer UID是否为0rootuid),如下图所示:

[db2v975@db2udb ~]$ db2ls
InstallPath                   Level   Fix Pack  Special Install Number   InstallDate                 Installer UID
---------------------------------------------------------------------------------------------------------------------
/opt/ibm/db2/V10.1              10.1.0.2       2                           edNov 20 02:27:07 2013PST             0
/opt/ibm/db2/V9.1                9.1.0.8       8                           Sun Dec  1 23:14:06 2013PST             0
/opt/ibm/db2/V9.5                9.5.0.6       6a                          Sun Dec  1 23:17:40 2013PST             0
/opt/ibm/db2/V9.7                9.7.0.5       5                           Sun Dec  1 23:21:11 2013PST             0

[db2v975@db2udb install]$ id root

uid=0(root)gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

[db2v975@db2udb install]$


可以看到我虚拟机上的四个db2都是有root安装的。

 

2 怎么知道我装的是db2的什么产品(db2ese,connect,client,aese…etc)呢?

这个问题同样可以用db2ls来解决,这次我们需要用到db2ls的几个参数:

-q

Signifies that the query is to list installed DB2 productsand features. By default, only the visible components (features) are displayedunless the -a parameter is also specified.

-p

Lists products only. This will give a brief list of whichproducts the customer has installed rather than listing the features.

-b base-install-path

When using the global db2ls command in /usr/local/bin, youneed to specify which directory you are querying. The global db2ls command willsimply call the db2ls from that install path and pass in the rest of theparameters.

DB2的db2ls能列指定安装目录下的db2是什么产品。


Example :

[db2v975@db2udb install]$ db2ls-q -p -b /opt/ibm/db2/V10.1

Install Path : /opt/ibm/db2/V10.1

Product Response File ID                  Level   Fix Pack  Product Description

---------------------------------------------------------------------------------------------------------------------

ENTERPRISE_SERVER_EDITION               10.1.0.2          2  DB2 EnterpriseServer Edition

[db2v975@db2udb install]$


 

附:db2ls- List installed DB2 products and features command

http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.cmd.doc%2Fdoc%2Fr0023668.html&resultof%3D%2522%2564%2562%2532%256c%2573%2522%2520%2522%2564%2562%2532%256c%2522%2520

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值