如何查看DB2数据库所用的端口号

来源:互联网 发布:行知外国语学校怎么样 编辑:程序博客网 时间:2024/05/21 07:05

转自 http://esc3721.blog.51cto.com/2366253/491979

假设你已经用db2start启动了数据库管理器,并且通讯方式配置为TCP/IP。
#首先切换到db2inst1用户
  1. su - db2inst1 
#查找TCP/IP Service name
  1. db2 get dbm cfg | grep -i service 
#通过上一句命令的输出(如db2c_db2inst1)在/etc/services文件中找对应的端口号
  1. grep db2c_db2inst1 /etc/services 
#这是你将会看到这么一行从上一句的输出 db2c_db2inst1   50000/tcp
#其中50000就是db2数据库所占用的端口号
 
 下面再贴上如何在Windows下查看DB2端口号的:
一般来讲,Windows都会将端口的映射关系存放在 c:\windows\system32\drivers\etc\services
到里面,你可以查看相应的端口号