DB2远程登录配置

1.服务器端操作

[db2inst2@xifenfei ~]$ netstat -nap | grep db2sysc
(Not all processes could be identified, non-owned process info
  will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:55554               0.0.0.0:*                   LISTEN      8072 /db2sysc 0     
[db2inst2@xifenfei ~]$  db2 list db directory
 
  System Database Directory
 
  Number of entries in the directory = 1
 
Database 1 entry:
 
  Database alias                       = XIFENFEI
  Database name                        = XIFENFEI
  Local database directory             = /home/db2inst2/xifenfei
  Database release level               = c.00
  Comment                              =
  Directory entry type                 = Indirect
  Catalog database partition number    = 0
  Alternate server hostname            =
  Alternate server port number         =
 
--配置监听协议
[db2inst2@xifenfei ~]$ db2set db2comm=tcpip
 
--配置实例端口
[db2inst2@xifenfei ~]$ db2 update dbm cfg using svcename 5000
DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
 
--重启生效
[db2inst2@xifenfei ~]$ db2stop
04 /02/2012 12:33:36     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful.
[db2inst2@xifenfei ~]$ db2start
04 /02/2012 12:33:41     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
[db2inst2@xifenfei ~]$ netstat -nap | grep db2sysc
(Not all processes could be identified, non-owned process info
  will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:50000               0.0.0.0:*                   LISTEN      8462 /db2sysc 0

2.客户端配置

C:\Windows\system32>db2 catalog tcpip node vm_xff remote 192.168.1.90 server 50000
DB21061E  未初始化命令行环境。
 
--DB21061E错误解决
C:\Windows\system32>db2cmd
 
--编目节点
C:\Windows\system32>db2 catalog tcpip node vm_xff remote 192.168.1.90 server 50000
DB20000I  CATALOG TCPIP NODE命令成功完成。
DB21056W  直到刷新目录高速缓存之后,目录更改才生效。
 
--编目数据库
C:\Windows\system32>db2 catalog db xifenfei as xifenfei at node vm_xff
DB20000I  CATALOG DATABASE命令成功完成。
DB21056W  直到刷新目录高速缓存之后,目录更改才生效。
 
C:\Windows\system32> db2 list node directory
 
  节点目录
 
  目录中的条目数 = 1
 
节点 1 条目:
 
  节点名                            = VM_XFF
  注释                            =
  目录条目类型                    = LOCAL
  协议                            = TCPIP
  主机名                          = 192.168.1.90
  服务名称             = 50000
 
--terminate使操作生效
C:\Windows\system32>db2 terminate
DB20000I  TERMINATE命令成功完成。

3.验证登陆

[db2inst2@xifenfei sqldbdir]$ db2 connect to xifenfei user db2inst2 using xifenfei
 
    Database Connection Information
 
  Database server        = DB2 /LINUX 9.5.0
  SQL authorization ID   = DB2INST1
  Local database alias   = XIFENFEI
 
[db2inst1@xifenfei ~]$ db2 list applications
 
Auth Id  Application    Appl.      Application Id                                                 DB       # of
          Name           Handle                                                                    Name    Agents
-------- -------------- ---------- -------------------------------------------------------------- -------- -----
DB2INST2 db2bp.exe      45         192.168.1.1.38849.120411160214                                 XIFENFEI   1   
DB2INST2 db2bp          50         *LOCAL.db2inst1.120402072313                                   XIFENFEI   1  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值