5d6d网 发表于 2016-11-13 02:22:31

db2 catalog 编目

使用catalog,把远程的数据库信息加载到本地一般分为两步:
第一步,catalog server端的node ,命令如下:
db2 catalog tcpip node db2node remote hostname server service_port
其中db2node是由你任意起的一个结点名,结点名不能跟已有的结点名重复(可通过db2list node directory查看 ),hostname也可为IP address,service_port为端口号。节点目录用于存储远程数据库的所有连通性信息。
第二步,catalog 远端DB2 数据库,命令如下:
db2 catalog database db_name as alias_name at node db2node.
db_name是指远程数据库的名字,alias_name是客户端实例名,db2node是指上面你所指定的node!
举例:


1. db2 catalog tcpip node db2inst1 remote 192.168.6.102 server 5000   在客户端的机器上能够把远程的服务器能够识别出来
2.catalog db test1 at node db2inst1   把该实例下的数据库编目到本地
3. db2 connect to test1 user db2inst1 using db2inst1连接到远程数据库
4.返回Database Connection Information,试验成功。
页: [1]
查看完整版本: db2 catalog 编目