Understanding of SERVICE_NAME and SID in TNSNAMES. ORA
SID specifies only one instance, while SERVICE_NAME specifies multiple instances in the RAC environment.
The configuration specifies the HOST of a node as follows:
RAC1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.122.12.16) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = RAC)
)
)
As follows, the instance running on 10.122.12.16 is rac1:
[Oracle @ RAC01 ~] $> 64 bytes from RAC01 (10.122.12.16): icmp_seq = 2 ttl = 64 time = 0.026 MS
--- RAC01> [oracle @ RAC01 ~] $ Ps-ef | grep ora _
Oracle 1981 1 0 Jun19? 00:02:01>
Below have more detailed explanation, Reprinted from http://www.dba-oracle.com/t_oracle_sid_instance_name_service_name.htm
Question: What> (DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP)
(PROTOCOL = TCP)
(HOST = 123.45.6789)
(PORT = 1521)
)
)
(CONNECT_DATA =
(SERVER = dedicated)
(SERVICE_NAME => (DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP)
(PROTOCOL = TCP)
(HOST =>)
)
(CONNECT_DATA = (SID =>
NAME VALUE
-----------------------------------------------------
Db_name>
Select
> (DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST =>)
(CONNECT_DATA =
(SERVICE_NAME => (SID_LIST =
(SID_DESC =
(SID_NAME =>)
(SID_DESC =
(GLOBAL_DBNAME => (SID_NAME = mysid)
)
)
)
Global_name-If>
Select *
From
Global_name;
GLOBAL_NAME
---------------------------------------
MYSID. REMOTE. DBA. NET