If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Federation between two DB2 databases running on AIX

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-06-09, 18:25
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Federation between two DB2 databases running on AIX

Does anyone have an easy-to-follow example of setting up federation between two DB2 databases running on AIX (DB2 v9.1 in case it matters)?
Reply With Quote
  #2 (permalink)  
Old 08-06-09, 18:47
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Correction/Clarification:

There are two AIX servers, each has DB2 installed. The real tables are created on the server with DB2 v9.5. I need to setup federation from the server with DB2 v9.1.
Reply With Quote
  #3 (permalink)  
Old 08-07-09, 07:21
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Never used it, have been playing with it though.
Suppose you have server A and server B. Whenever you select data in server A, the database in server B is also accessed.
On the instance on A, set the DBM CFG FEDERATED to "YES" and re-start the instance.
On server B I created an userid "dbtest"
Then go to the control centre/federated database objects and let the widgets guide you thought the steps. I did it on windows and saved the SQL:
step 1: create the wrapper
Code:
CREATE WRAPPER DRDA LIBRARY 'db2drda.dll';
step 2: the server
Code:
CREATE SERVER C90BANK TYPE DB2/UDB VERSION '9.5' WRAPPER DRDA AUTHID "dbtest" PASSWORD "*****" OPTIONS( ADD DBNAME 'C90BANK');
step 3: the user mapping
Code:
CREATE USER MAPPING FOR myUserId SERVER C90BANK OPTIONS ( ADD REMOTE_AUTHID 'dbtest', ADD  REMOTE_PASSWORD '*****') ;
step 4: the nickname
Code:
CREATE NICKNAME NICKschema.tablename FOR C90BANK.schema.tablename ;
This worked for me and a nice side-effect: doyouDB2.com - What just happened to me - doyouDB2

This works for "free" when you connect 2 DB2 servers. When you want to connect to collegue-databases you must buy additional licenses.
Reply With Quote
  #4 (permalink)  
Old 08-07-09, 10:06
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Bella,

If I am not mistaken you have to use diff id's when you are creating nickname. If I find a script I will get it to you.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #5 (permalink)  
Old 08-07-09, 13:11
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
dr_te_z and Cougar, thx for responding. I was asked to setup federation and know almost nothing about it. So, this is Federation 101 for me. I'll RTFM on the weekend and see if I can find any other helpful info.

Alex, please send me the script if you find it. Thx
Reply With Quote
  #6 (permalink)  
Old 08-07-09, 14:56
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
you got mail. It has been a while. but it should work.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #7 (permalink)  
Old 08-07-09, 15:13
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Got it. Thx
Reply With Quote
  #8 (permalink)  
Old 08-10-09, 15:38
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
I completed my testing and asked my manager to post "federation setup info" on his blog page. I hope people who are new to federation will find this info helpful.

https://www.ibm.com/developerworks/m...luw_databases2
Reply With Quote
  #9 (permalink)  
Old 08-10-09, 16:01
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Nice job Bella, I'm sure I'm not the only one here to appreciate you sharing this information.
Reply With Quote
  #10 (permalink)  
Old 08-10-09, 22:59
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Thanks, Nick. I saved the setup info for myself so that I can repeat the same in the real env. I've decided to modify it for other DBAs since I couldn't find any good examples on the web and even the IBM team who supports federation could not provide with any helpful info.
Reply With Quote
  #11 (permalink)  
Old 08-11-09, 14:15
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Do not forget to monitor both databases with "db2top", there's a separate "federated" screen.
Reply With Quote
  #12 (permalink)  
Old 08-11-09, 14:34
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Thanks. I've been using snapshots to monitor non-federated env, but db2top is something I should look at. I don't know if snapshots capture any info for the federation env...

Someone mentioned to me that I should look at creating indexes on nicknames (specification only) and update statistics using the info from the server where actual tables are stored. Does anyone have any experience with indexes/stats on nicknames. Does it really make a difference if I won't be joining the actual tables and nicknames. The client will only be accessing nicknames located on the AIX server.
Reply With Quote
  #13 (permalink)  
Old 03-31-10, 14:40
rangupt rangupt is offline
Registered User
 
Join Date: Jan 2008
Posts: 96
Bella the blog has really good information about how to set up federation. On a side node, the hostname 'panipuri' is really funny. Did you know that panipuri is an Indian appetizer and tasty too? lol -
Reply With Quote
  #14 (permalink)  
Old 03-31-10, 15:15
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by rangupt View Post
Bella the blog has really good information about how to set up federation.
Thank you.


Quote:
Originally Posted by rangupt View Post
On a side node, the hostname 'panipuri' is really funny. Did you know that panipuri is an Indian appetizer and tasty too? lol -
Yes, my Indian colleagues told me the meaning of this hostname when I joined the company. I had some Indian food in the past but never tried panipuri...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On