Database Identification by Service Name
An Oracle database is represented to clients as a service, that is, the database performs work on behalf of clients. A database can have one or more services associated with it.
Up to Oracle8i, an Oracle database service was uniquely identified by an Oracle System Identifier (SID). The SID was also used internally by the database as pointer to the System Global Area (SGA). Clients connected to a database instance by specifying the SID in the connect descriptor. This naming scheme did not distinguish services from instances.
Because an Oracle database can span over multiple computers, both the service as a whole and each of its instances are specified in Oracle9i and Oracle8i.
Service Name
A database is now identified by its service name. The service name is specified by the SERVICE_NAMES parameter in the initialization parameter file. SERVICE_NAMES specifies the name of the highest-level view of Oracle database service, that may span instances and/or nodes. SERVICE_NAMES is defaulted to the global database name, a name comprised of the database name and domain name.
Instance Name
Database instances are identified by an instance name with the INSTANCE_NAME parameter in the initialization parameter file. INSTANCE_NAME corresponds to the SID of the instance.
Connect Descriptors
Configure connect descriptors with the SERVICE_NAME (without an S) parameter to connect to an Oracle9i or Oracle8i database. For example, the following connect descriptor contains the address of a listener located on sales1-sun listening for connection requests for a database service called sales.us.acme.com:
sales=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-sun1)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com)))
Optionally, connect descriptors can be configured with the INSTANCE_NAME parameter to connect to a particular instance of the database. This may be necessary if you have an Oracle9i Real Application Clusters with multiple instances.
For example, the following connect descriptor contains the address of a listener located on sales-sun1 listening for connection requests for an instance called sales1 associated with the sales.us.acme.com database:
sales=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-sun1)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com)
(INSTANCE_NAME=sales1)))