db2安裝完成後,tcp/ip連接端口默認爲50000,可通過下面的方法確認:
1、使用命令 db2 get dbm cfg
找到"SVCENAME" 查找到TCP/IP 服務名
2、到系統配置文件裏找到service name 對應的 port number
windows:查看 c:\windows\system32\drivers\etc\services
aix: 查看 /etc/services
如下:
DB2_DB2 60000/tcp
DB2_DB2_1 60001/tcp
DB2_DB2_2 60002/tcp
DB2_DB2_END 60003/tcp
db2c_DB2 50000/tcp
3、使用 netstat -an 命令查找tcp/ip 服務的端口
4、修改端口號
直接修改services文件中當前服務名對應的端口號
如:db2c_DB2 50000/tcp
然後重啓數據庫即OK db2stop db2start
5、另外附上一個關於linux系統下的查找方法(摘抄帖子):
In JDBC configurations for WPA, you have to specify the port that DB2 is listening on. I usually look for /etc/services or try one of 50000/50001 and it usually works. In SUSELinux, both the solutions did not work and there was another process (Multithreaded routing toolkit aka mrt) was listening on port 50000.
So how do we find out the DB2 port in a reliable way? Read on...
Step 1: Set the DB2 environment.
$ . ~db2inst1/sqllib/db2profile
Step 2: Find the service name for DB2 instance. It basically involves running "db2 get dbm cfg" command and finding a line containing SVCENAME.
$ svc=`db2 get dbm cfg | grep SVCENAME | cut -d= -f2 | awk '{print $1}'`
Step 3: Find the service name that you got from Step 2 in /etc/services or %SYSTEMROOT%\system32\drivers\etc\services. That is the port DB2 is listening on. $ grep $svc /etc/services
Hope you find this useful.
db2查看修改端口號
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
NBU備份DB2
gaolei07828
2019-02-23 00:41:40
DB2 存儲過程開發最佳實踐
zhaocz_chenly
2019-02-23 00:17:46
修改收藏夾的默認路徑
zongxn
2019-02-23 13:41:43
mysql修改用戶密碼
13714409232
2019-02-23 00:32:36
線段樹的應用(最大值,區間求和)
wuzhizhan
2019-02-23 00:27:21
修改oracle數據庫字符集
mytour2009
2019-02-23 00:21:41
tomcat 修改默認訪問項目路徑
Barron1
2019-02-22 23:56:59
更改ORACLE歸檔路徑及歸檔模式
spider1983
2019-02-22 23:55:04
oracle修改用戶名
辣條香蕉
2019-02-22 23:44:11
修改docker默認網橋
九月朦朧
2019-02-22 23:14:23
那些年幹過的事(六)—無源碼修改版本號
JamFang
2019-02-22 22:51:23
克隆服務器網卡eth1 改爲 eth0
SuperAuspicious
2019-02-22 22:23:38
Centos7.4修改網卡爲eth0
jason_125
2019-02-22 22:17:49
查看Linux版本信息
陳哥啊
2019-02-23 00:06:40
如何查看指定端口.(win)
q70740930
2019-02-22 23:32:11