Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> The matching rules of client/server connection
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))
)
O8I_TEST.WORLD = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dino-c2)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = o8i_test.renjubridge.com))
)
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