DB2: 通过SQL语句查询操作系统信息/实例信息

DB2可以通过SQL语句查询操作系统信息,比如操作系统类型、主机名、操作系统版本、内存大小等。也可以通过SQL查询实例名、DB2版本等信息。

方法主要是通过 SYSIBMADM.ENV_SYS_INFO ,以及SYSIBMADM.ENV_INST_INFO等视图

1. SYSIBMADM.ENV_SYS_INFO

可以查询以下操作系统信息(表格源自DB2信息中心):

Column nameData typeDescription
OS_NAMEVARCHAR(256)Name of the operating system.
OS_VERSIONVARCHAR(256)Version number of the operating system.
OS_RELEASEVARCHAR(256)Release number of the operating system.
HOST_NAMEVARCHAR(256)host_name - Host name monitor element
TOTAL_CPUSINTEGERThe number of processors on this host.
CONFIGURED_CPUSINTEGERNumber of configured physical CPUs on the system.
TOTAL_MEMORYINTEGERTotal amount of memory on the system (in megabytes).
OS_FULL_VERSIONVARCHAR(256)os_full_version - Operating system full version monitor element
OS_KERNEL_VERSIONVARCHAR(256)os_kernel_version - Operating system kernel identifier monitor element
OS_ARCH_TYPEVARCHAR(256)os_arch_type - Operating system architecture type monitor element

 

2.  SYSIBMADM.ENV_INST_INFO

可以查询以下实例信息(表格源自DB2信息中心)

Column nameData typeDescription
INST_NAMEVARCHAR(128)Name of the current instance.
IS_INST_PARTITIONABLESMALLINTIndicates whether or not the current instance is a partitionable database server instance. Possible return values are 0 if it is not a partitionable database server instance, and 1 if it is a partitionable database server instance.
NUM_DBPARTITIONSINTEGERNumber of database partitions. If it is not a partitioned database environment, returns a value of 1.
INST_PTR_SIZEINTEGERBit size of the current instance (32 or 64).
RELEASE_NUMVARCHAR(128)Internal release number, as returned by the db2level command; for example, 03030106.
SERVICE_LEVELVARCHAR(128)service_level - Service Level monitor element
BLD_LEVELVARCHAR(128)Build level, as returned by the db2level command; for example, n041021.
PTFVARCHAR(128)Program temporary fix (PTF) identifier, as returned by the db2level command; for example, U498350.
FIXPACK_NUMINTEGERFix Pack number, as returned by the db2level command; for example, 9.
NUM_MEMBERSINTEGERThe number of members on this instance.

 

参考资料:

 

Environment routines and views

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值