从 DB2 客户机编目 TCP/IP 节点
在已经安装DB2客户端的机器上添加server编目:语法
db2 => catalog tcpip node node_name remote hostname|ip_address
server service_name|port_number
然后添加上面的database:
CATALOG DATABASE database-name
[AUTHENTICATION {SERVER | CLIENT | DCS | DCE SERVER PRINCIPAL principalname
| KERBEROS TARGET PRINCIPAL principalname | SERVER_ENCRYPT | DCS_ENCRYPT
| DATA_ENCRYPT | GSSPLUGIN}]
测试:
--catalog node
$ db2 "catalog tcpip node tower06 remote 172.21.21.21 server 50000"
--catalog database,后来补充
$ db2 catalog db sample at node LOCAL1
DB20000IThe CATALOG DATABASE command completed successfully.
DB21056WDirectory changes may not be effective until the directory cache is
refreshed.
注意使用username:
$ db2 connect to bitest user etl
Enter current password for etl:
Database Connection Information
Database server = DB2/AIX64 8.2.3
SQL authorization ID = ETL----------已经变更
Local database alias = BITEST
其实在服务器端还需要做如下设置:
--检查/etc/services
# cat /etc/services |grep -i db2
ibm-db2 523/tcp # IBM-DB2
ibm-db2 523/udp # IBM-DB2
questdb2-lnchr5677/tcp # Quest Central DB2 Launchr
questdb2-lnchr5677/udp # Quest Central DB2 Launchr
db2inst1 50000/tcp
db2c_db2inst2 50001/tcp #DB2 connection service port
db2inst3 50003/tcp
--检查DB2COMM
$ db2set -all
DB2PROCESSORS=0,1
DB2COMM=TCPIP,NETBIOS
DB2AUTOSTART=YES
DB2SYSTEM=localhost.localdomain
DB2INSTDEF=db2inst1
DB2ADMINSERVER=db2das1
--检查SVCENAME
$ db2 get dbm cfg |grep -i svc
TCP/IP Service name (SVCENAME) = 50000
这样,客户端才可以连上
页:
[1]