Solved

How do we join 2 DB2 databases within the same instance.

Posted on 2008-10-20
2
313 Views
Last Modified: 2012-05-05
We have a need to join tables across two DB2 databases in the same instance.  Is a federated system our only option?  How do we set it up ... both databases are in the same instance. Are there performance implications?
0
Comment
Question by:ausrs
2 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 125 total points
ID: 22764527
if the two databases are in the same instance you don't need federated systems
you just add the database name as a prefix for your object, for example, if you have table schema1.table1 in db1 and table schema2.table2 in db2 you perform

select *
from db1.schema1.table1 inner join db2.schema2.table2 on ....
0
 

Author Comment

by:ausrs
ID: 22956910
Thanks ... I understand this works for DBMSs other than DB2.  In DB2 you must set up a nickname to the remote database, even if it is in the same instance and then you can perform the joins.  I was hoping this was not the case because I underatnd that performance may be impacted with federated systems.  
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tools to Output documents from DB based on selections 8 110
ORA-12560: TNS:protocol adapter error 8 80
Insert with SET how to handle join 6 57
Sql Join Problem 2 25
Read about achieving the basic levels of HRIS security in the workplace.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now