Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Querying across more than one database

Querying across more than one database

From: Ivan K. <ivan_521521_at_yahoo.com>
Date: Tue, 28 Feb 2006 17:47:00 -0600
Message-ID: <4404E0F4.2070004@yahoo.com>


Possibly this is a dumb question.

Can one query across more than one Oracle databases?

For example, as defined in the listener.ora file, one might have the following databases:

(GLOBAL_DBNAME = GEN2.leland.nwu.edu)
(GLOBAL_DBNAME = GEN3.leland.nwu.edu)
(GLOBAL_DBNAME = GEN4.leland.nwu.edu)
(GLOBAL_DBNAME = GEN5.leland.nwu.edu)

and then could a query be written which
uses joins between tables of these different databases? Perhaps the SQL
would look something like this:

   select

     asg_qry.aa_sequence_group_id q_group_id,
     sss_query.aa_sequence_id q_id,
     sss_subj.aa_sequence_id s_id,
     sim.score score
   from
     (GEN3).AASeq sss_query
     join (GEN3).AASeqSequenceGroup assg_qry on
        sss_query.aa_sequence_id = assg_qry.aa_sequence_id
     join (GEN3).AASeqGroup asg_qry on
     (
       assg_qry.aa_sequence_group_id = asg_qry.aa_sequence_group_id and

(
asg_qry.aa_sequence_group_id = 1554 or asg_qry.aa_sequence_group_id = 3339 ) ) join (GEN3).Similarity sim on sim.query_id = sss_query.aa_sequence_id join (GEN4).AASeq sss_subj on sss_subj.aa_sequence_id = sim.subject_id order by asg_qry.aa_sequence_group_id, sss_query.aa_sequence_id;

so that I am joining tables from
databases GEN3.leland.nwu.edu and GEN4.leland.nwu.edu.

Is such a thing possible with Oracle?

Thank you for your help. Received on Tue Feb 28 2006 - 17:47:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US