Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Using database links to connect to a local database
On 15 Mar 1998 05:23:46 GMT, "Dick Willis" <rmw_at_synchrony.com> wrote:
[...]
>Whenever I reference the local database in my SQL string, I receive the
>error:
> ORA-2085 database link TREND02.World connects to TREND.WORLD.
>
>I have defined the link TREND02 to be the local database. What is TREND?
>(local instance is called TRND (not TREND), but INTERNAL does have the
>password TREND, can't think of other places where TREND is used) and, more
>importantly, how do I construct a database link to the local database so
>that my general-purpose query can be used?
TREND is the name of the database; it is specified in the CREATE DATABASE statement and optionally in the init.ora parameter file. Apparently you are running with init.ora parameter GLOBAL_NAMES set to TRUE, which imposes a requirement that a database link name exactly match the database name. You can change the parameter, change the dblink name, or change the database name to get rid of your ORA-2085.
By the way, last time I checked there were no special optimizations for "loopback" dblinks such as you are using. Since dblinks involve extra processing (due to transaction coordinating requirements) you might want to look at designs that avoid them for the local case.