Re: Referring to a table in another database

From: Magnus Lonnroth <mloennro_at_se.oracle.com>
Date: Sun, 6 Mar 1994 13:02:27 GMT
Message-ID: <MLOENNRO.94Mar6140228_at_ramses.se.oracle.com>


In article <1994Mar5.155206.1_at_corp02.d51.lilly.com> jl34778_at_corp02.d51.lilly.com writes:
> In article <CM5Gnv.JL_at_uceng.uc.edu>, pbalakri_at_uceng.uc.edu (Purushothaman Balakrishnan) writes:
> > Pardon me for this silly question.
> >
> > I have two instances of two different databases running on one
> > server. I have a parent table in one database and a child table in another
> > database. I want to create triggers for maintaining referential integrity
> > between these two tables.
> >
> > Every time I try to create a database link and then a synonym for the
> > table in the link, it assumes the database to be a remote database.
> >
> > How can I refer to the table in the other database?
> >
> > Thanks in advance for any suggestions/help.
>
> As I understand it, any database accessed through a db link is considered to be
> 'remote', even if it is on the same machine. ORACLE will retrieve the data
> using SQL*net.
>
> Your note doesn't say if you are having a problem, or if you are just confused.
> It sounds to me that you are doing it right.
>
> Instance A
>
> CREATE TABLE FRED (TESTFIELD VARCHAR2(10);
>
> Instance B
>
> CREATE DATABASE LINK A
> CONNECT TO userid IDENTIFIED BY password
> USING 'T:ip_address:A';
> CREATE SYNONYM FRED FOR FRED_at_A;
>
> --
> Bob Swisshelm | swisshelm_at_Lilly.com | 317 276 5472
> Eli Lilly and Company | Lilly Corporate Center | Indianapolis, IN 46285

The database-string may use any 2-task protocol, including pipe-2-task, fast-2-task (shared memory), VMS mailboxes, etc, etc. See your Installation and User's guide for the complete syntax of these connect-strings. The mandatory parameters for the pipe- and fast-drivers are the ORACLE_SID. So the USING clause of the CREATE DATABASE LINK statement above could be:

USING 'P:A' or

USING 'F:A'

--

Magnus Lonnroth
Tech.Sales & Consultant
Oracle Sweden
Mail: mloennro_at_se.oracle.com
Received on Sun Mar 06 1994 - 14:02:27 CET

Original text of this message