2.2 Understanding Database Services

An Oracle database is represented to clients as a service. A database can have one or more services associated with it.

The following figure shows two databases, each with its own database service for clients. One service, sales.us.example.com, enables salespersons to access the sales database. Another service, finance.us.example.com, enables financial analysts to access the finance database.

Figure 2-3 One Service for Each Database

Description of Figure 2-3 follows
Description of "Figure 2-3 One Service for Each Database"

The sales and finance databases are each identified by a service name, sales.us.example.com and finance.us.example.com, respectively. A service name is a logical representation of a database. When an instance starts, it registers itself with a listener using one or more service names. When a client program or database connects to a listener, it requests a connection to a service.

A service name can identify multiple database instances, and an instance can belong to multiple services. For this reason, the listener acts as a mediator between the client and instances and routes the connection request to the appropriate instance. Clients connecting to a service need not specify which instance they require.

The service name is specified by the SERVICE_NAMES initialization parameter in the server parameter file. The server parameter file enables you to change initialization parameters with ALTER SYSTEM commands, and to carry the changes across a shutdown and startup. The DBMS_SERVICE package can also be used to create services. The service name defaults to the global database name, a name comprising the database name (DB_NAME initialization parameter) and domain name (DB_DOMAIN initialization parameter). In the case of sales.us.example.com, the database name is sales and the domain name is us.example.com.

Note:

Starting with Oracle Database 19c, customer use of the SERVICE_NAMES parameter is deprecated. To manage your services, Oracle recommends that you use the SRVCTL or GDSCTL command line utilities, or the DBMS_SERVICE package.

The following figure shows clients connecting to multiple services associated with one database.

Figure 2-4 Multiple Services Associated with One Database

Description of Figure 2-4 follows
Description of "Figure 2-4 Multiple Services Associated with One Database"

Associating multiple services with one database enables the following functionality:

  • A single database can be identified different ways by different clients.

  • A database administrator can limit or reserve system resources. This level of control enables better allocation of resources to clients requesting one of the services.

See Also: