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

Home -> Community -> Usenet -> c.d.o.server -> Re: [8i] priority rules between database

Re: [8i] priority rules between database

From: Howard J. Rogers <dba_at_hjrdba.com>
Date: Wed, 27 Mar 2002 08:56:22 +1100
Message-ID: <a7qqsa$v3e$1@lust.ihug.co.nz>


You can't. The "@INST_1" bit is the alias that's mentioned in the tnsnames.ora file (or the equivalent in a non-local naming method, such as names server). It's the tnsnames that then says, "Ah! INST_1 means go to machine X, port Y... there'll be a Listener there that can connect me."

Aliases must be unique within the tnsnames file. So you can't have two identical aliases pointing to different databases. If you *do* have two identical aliases (and it's a text file after all, so there's nothing to police the uniqueness rule, apart from commonsense), the it's always the last one that gets used to resolve the address.

For example, if your tnsnames looked like this:

db8= mozart, port 1521, service=db9
db9= mozart, port 1521, service=db9
db8=monteverdi, port 1521, service=db8

...then a connect blah/blah_at_db8 would result in a connection to the db8 database. But if it looked like this:

db8= mozart, port 1521, service=db8
db9= mozart, port 1521, service=db9
db8=monteverdi, port 1521, service=db9

...then the same connection string would connect you to the db9 database. It's the last mention of the alias that counts. Alias do therefore have to be unique.

It is, however, possible to have two aliases pointing to one database. For example:

USR =
(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =
mozart)(PORT = 1521)))

 (CONNECT_DATA =
 (SERVICE_NAME = db9.aldeburgh.local)
 (SERVER=SHARED)))

DBA =
(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = mozart)(PORT
= 1521)))
(CONNECT_DATA = (SERVICE_NAME = db9.aldeburgh.local)
(SERVER=DEDICATED)))
Meaning that "db9" can be accessed either with a shared or with a dedicated server process, depending on whether I type "connect blah/blah_at_usr" or "connect blah/blah_at_dba".

It should also be clear from this example that it would be perfectly possible to have two Instances on different machines called INST_1, but that your tnsnames would point to each with a different alias. The details of each alias would indicate what machine is to be connected to, and hence which example of INST_1 you were talking about. In other words:

INST1A =
(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = SUN_A) (PORT = 1521)))

 (CONNECT_DATA =
 (SERVICE_NAME = INST1))) INST1B =
(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)
(HOST = SUN_B)(PORT = 1521)))
(CONNECT_DATA = (SERVICE_NAME = INST1)))
Regards
HJR

--
------------------------------------------
Resources for Oracle : www.hjrdba.com
============================

"Frederic Payant" <fpayant_at_club-internet.fr> wrote in message
news:ssn1ausv3nb8b4opdjo2g31r9lvb44l8sv_at_4ax.com...
> Hi,
>
> With Oracle 8i under SunOs 8 (but I suppose this question is generic):
>
> How does Oracle to distinguish between two database, on 2 distinct
> servers but with the same name ?
>
> To be more precise :
> On SERVER_A, I have an instance INST_1 that I can reach via listener
> from SERVER_B by an "sqlplus scott/tiger_at_INST_1"
>
> If on SERVER_B I create an instance INST_1, what must happen if I type
> "sqlplus scott/tiger_at_INST_1" ?
> In fact, I've seen that I reach INST_1 of SERVER_B, but :
> a) Is this an established rule or just random  ?
> b) How can I reach my INST_1 on SERVER_A from SERVER_B ?
>
> c) Is there a cleaner way to handle that sort of cases ?
>
> Thanks for advices
>
>
> Regards
> Frederic PAYANT - junior DBA ;-)
Received on Tue Mar 26 2002 - 15:56:22 CST

Original text of this message

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