Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old May 27th, 2004, 09:16 AM
AngieB AngieB is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 AngieB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face Optimizing searches on 2 databases

Hi Guys...
I am relatively new at Oracle and have been trying to find a way of accomplishing this for a bit... I'm hoping someone can point me in the right direction...

I have 2 databases set up...
DB1
Employee_Id - from E0001 to E0099

DB2
Employee_Id - from E0100 to E1000.

When I issue an SQL statement - Select Employee_Id where Employee_Id is > E0100, it goes out and searches both databases (accross the network) obviously not returning any values from DB1, only the ones from DB2 that fit the criteria. How would I prevent this? Is there a way to specify to only go to the one database since I know the Emp_Id ranges on both?

Any help/tip/link would be appreciated!

AngieB

Reply With Quote
  #2  
Old May 30th, 2004, 04:35 AM
galith_haham galith_haham is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 64 galith_haham User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 25 m 17 sec
Reputation Power: 5
dblink

Hi,

you can define a dblink in db1 connecting to the emp table in db2:

create database link db2 connect to user identified by password using 'db2';

after that you can:

select * from emp@db2;

you have to define the connect string in the tnsnames under the db1 machine.

good luck.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Optimizing searches on 2 databases


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway