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 -> The matching rules of client/server connection

The matching rules of client/server connection

From: Dino Hsu <dino1_at_ms1.hinet.net>
Date: Wed, 30 May 2001 11:38:09 +0800
Message-ID: <5oq8htk6c0595jh4uajq2ljk716q7bklrn@4ax.com>

Dear all,

After some studies and experiments, I have figuered out most, if not all, of the matching rules of client/server connection now. I will try to present the relations in pairs as follows:

1.connect string (client side) vs. tnsnames.ora (client side): 1-1.a connect string is in this format:
userid/password_at_connect_descriptor, which is universal to all client tools in the logging-in process, such as SQL*PLUS or OEM, etc. 1-2.a tnsnames.ora entry is typically like these: T1:

O8I_TEST.WORLD = 
  (DESCRIPTION = 

(ADDRESS = (PROTOCOL = TCP)(HOST = dino-c2)(PORT = 1521))
(CONNECT_DATA = (SID = orcl))
)

or T2:
O8I_TEST.WORLD = 
  (DESCRIPTION = 

(ADDRESS = (PROTOCOL = TCP)(HOST = dino-c2)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = o8i_test.renjubridge.com))
)

Let the part before the first eaqual sign (i.e., o8i_test.world) be the L-part, and that after it the R-part. 1-3.the connect_descriptor has to match an L-part in tnsnames.ora, except for the optional L-part domain name (world in this case). The L-part domain name can be omitted in a connect_descriptor if the following setting is shown in the client side sqlnet.ora: names.default_domain = <domain> (world in this case) 1-4.Normally, 'world' is used as L-part domain name in Oracle 8, but none is used in Oracle 8i.

2.tnsnames.ora (client side) vs. listener.ora (server side): 2-1.a listner.ora entry is typically like this: (in the SID_LIST_LISTENER section)
L1:

    (SID_DESC =
(GLOBAL_DBNAME = o8i_test.renjubridge.com)
(ORACLE_HOME = D:\oracle\ora81)
(SID_NAME = orcl)

    )
2-2.tnsnames.ora can match listener.ora either with T1 or T2 style. T1 style: the SID value in tnsnames.ora has to match the SID_NAME value in listener.ora
T2 style: the SERVICE_NAME value has to match the GLOBAL_DBNAME value in listener.ora

3.listner.ora (server side) vs. init.ora (server side): 3-1.init.ora is typically like this: (relavant part only) I1: <begin>
db_name = "o8i_test"
db_domain = mydomain.com
instance_name = orcl
service_names = (o8i_sn1, o8i_sn2)
I1: <end>
3-2.the SID_NAME value in listener.ora has to match the instance_name value in init.ora
3-3.When <service_names> in init.ora is marked out, <SERVICE_NAME> in tsnames.ora can match <db_name>.<db_domain> in init.ora directly. In I1 example with service_names marked out, a SERVICE_NAME=o8i_test.mydomain.com in tnsnames.ora also works. 3-4.When <service_names> is present, <SERVICE_NAME> in tnsnames.ora can match <any service_name>.<db_domain> in init.ora. In I1 example, a SERVICE_NAME=o8i_sn1.mydomain.com or o8i_sn2.mydomain.com in tnsnames.ora also work.

4.Note that both Oracle 8 & 8i tnsnames.ora support the SERVICE_NAME syntax, so no distinction has to be made between 8 & 8i in the above discussion.

I don't know the explanation about 3-3 and 3-4, but that's my test result. Hope someone can make things more clear. Thanks in advance.

Dino Received on Tue May 29 2001 - 22:38:09 CDT

Original text of this message

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