Overview

Database services (services) are logical abstractions for managing workloads in Oracle Database. Services divide workloads into mutually disjoint groupings. Furthermore, services in Oracle are a way to direct a traffic. In the past a user connected directly to the database, that was knows as 2 tier architecture. For a lot of reasons that is not the norm anymore. A part from the security risks that created, direct connections were also hard to organize and load-balance. Especially if you have multiple instances in terms of RAC or you need READ-ONLY operation which you can push to the Data Guard. Services in either are mostly used in conjuction with the Grid Infrastructure and are separated in two groups depending on your database configuration. As we know, Oracle RAC database can be either:

Policy Managed

Admin Managed

Therefore, you have different ways to create a service, depending on your configuration.

Policy Managed

Police Managed RAC database is divided into server pools. For example you can have the following configuration in which each database has multiple instances divided into server pools:

In that case, the syntax for adding a service is as follows:

Add Policy Managed Service

Let us break down each parameter here, except the obvious ones (db_unique_name, service_name, server_pool)

cardinality - Uniform (run the server on ALL instances), Singleton (run it only on one instance at a time)

edition - When an edition is specified for a service, all subsequent connections that specify the service use this edition as the initial session edition. However, if a session connection specifies a different edition, then the edition specified in the session connection is used for the initial session edition.

netnum (RAC / RAC One node only) - Specifies over which network interface the service is provided

role (used with Data Guard) - Specifies the condition for automatic starting of the service. If set to PRIMARY and the database role is PHYSICAL_STANDBY, the service WON'T start automatically.

policy - Specified if the service will be authomatic started, of course depending on the “role” condition. But if set to Manual, the service will NEVER be automatically started.

notification - Enables / Disables Fast Application Notifications (FAN) for OCI Connections.

failovertype - Enables Application Continuity, if set to “TRANSACTION” and TAF (for OCI) if set to “SELECT” or “SESSION”.

If you set -failovertype to TRANSACTION, then you must set -commit_outcome to TRUE.

clbgoal (Connection Load Balancing Goal) - Indicates to Oracle for what kind of connections this service will handle. Specify SHORT if you will do short transactions and LONG if you will use this service for BATCH jobs.

rlbgoal (Runtime Load Balance Goal) - Used by the Load Balance advisor, set to SERVICE_TIME to balance connections by response time. Set THROUGHPUT to balance connections by throughput.

failovermethod (Oracle RAC Only) - Specifies the TAF Failover method (backward Compatibility).