Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

DB2 Federation (See related posts)

Server A configuration:
OS: WinXP
Instance name: TMINST
Instance user and password: db2admin/db2admin
Required nickname for remote table: DB2ADMIN.R_CUSTOMERS

Server B configuration:
OS: Linux
IP: 10.60.100.21
DB2 service port: 50000
Instance user and password: db2inst1/db2inst1
Database name: TM_ON
Table name to be linked: CUSTOMERS

CLP Commands @Server A:
db2set DB2INSTDEF=TMINST
SET DB2INSTANCE=TMINST
db2 UPDATE DATABASE MANAGER CONFIGURATION USING FEDERATED YES IMMEDIATE
db2 CATALOG TCPIP NODE RTMINST REMOTE 10.60.100.21 SERVER 50000 REMOTE_INSTANCE db2inst1 OSTYPE Linux
db2 CATALOG DATABASE TM_ON AS RTM_ON AT NODE RTMINST 
db2start
db2 CONNECT TO TM_ON USER db2admin USING db2admin
db2 CREATE WRAPPER DRDA
db2 "CREATE SERVER RTM_ON TYPE DB2/UDB VERSION '9.1' WRAPPER DRDA AUTHORIZATION \"db2inst1\" PASSWORD \"db2inst1\" OPTIONS( ADD DBNAME 'RTM_ON')"
db2 CREATE USER MAPPING FOR DB2ADMIN SERVER RTM_ON OPTIONS ( ADD REMOTE_AUTHID 'db2inst1', ADD  REMOTE_PASSWORD 'db2inst1') 
db2 CREATE NICKNAME DB2ADMIN.R_CUSTOMERS FOR RTM_ON.DB2INST1.CUSTOMERS
db2 SELECT * FROM R_CUSTOMERS

You need to create an account or log in to post comments to this site.


Click here to browse all 4857 code snippets

Related Posts