db2 怎么修改端口号
db2吧
全部回复
仅看楼主
level 1
麦油菜05 楼主
db2 update database manager configuration using svcename DB2_db2inst1,执行这条语句后,svcename变成DB2_db2inst1,但是查看etc/services,找不到对应的服务名.我试图自己写上,可是在客户端还是显示端口号不正确,大神,这个该如何解决
2013年12月24日 01点12分 1
level 1
麦油菜05 楼主
求大神
2013年12月24日 01点12分 2
level 12
转载:db2查看修改端口号2012-11-01 09:46:42 我来说两句 作者:阿拉丁没有神灯收藏
我要投稿
db2查看修改端口号 db2安装完成后,tcp/ip连接端口默认为50000,可通过下面的方法确认: 1、使用命令 db2 get dbm cfg找到"SVCENAME" 查找到TCP/IP 服务名 www.2cto.com 2、到系统配置文件里找到service name 对应的 port numberwindows:查看 c:\windows\system32\drivers\etc\services aix: 查看 /etc/services如下:DB2_DB2 60000/tcpDB2_DB2_1 60001/tcpDB2_DB2_2 60002/tcpDB2_DB2_END 60003/tcpdb2c_DB2 50000/tcp 3、使用 netstat -an 命令查找tcp/ip 服务的端口 4、修改端口号 直接修改services文件中当前服务名对应的端口号如:db2c_DB2 50000/tcp然后重启数据库即OK db2stop db2start www.2cto.com 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 SUSE Linux, 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/db2profileStep 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.
2013年12月26日 08点12分 3
亲,百度上的方法不给力啊
2013年12月26日 10点12分
回复 麦油菜05 :netstat -a的结果能截个图吗?
2013年12月26日 10点12分
回复 gsls200808 :改了之后netstat -an |grep 50000,可以找到这个端口号,可就是连客户端的时候,总是报错
2013年12月26日 10点12分
回复 麦油菜05 :试试重启一下这个端口的服务
2013年12月26日 10点12分
level 12
2013年12月26日 08点12分 4
1