When you create new services for your database, you should define the automatic workload management characteristics for each service. The characteristics of a service include:
See Also:
"Creating Services with SRVCTL" for more information
"SRVCTL Command Reference" for more information about using SRVCTL to create or modify services and descriptions of the various options
Each service has a service name. The service name is used by clients to connect to one or more instances. The service name must be unique throughout your system.
Edition-based redefinition of database objects enables you to upgrade an application's objects while these objects are in use. You can set the edition attribute of a database service when you create it, or modify an existing service to set the edition. When you set the service edition, connections that use this service use this edition as the initial session edition. If the service does not specify the edition name, then the initial session edition is the database default edition.
You can set the service edition using SRVCTL, as follows:
$ srvctl modify service –db hr –s crmsrv –edition e2
When you use Oracle Clusterware to manage your database, you can configure startup options for each individual database service when you add the service using the srvctl add service
command with the -policy
parameter. If you set the management policy for a service to AUTOMATIC
(the default), then the service starts automatically when you start the database with SRVCTL. If you set the management policy to MANUAL
, then the service does not automatically start, and you must manually start it with SRVCTL. A MANUAL
setting does not prevent Oracle Clusterware from monitoring the service when it is running and restarting it if a failure occurs. Before Oracle RAC 11g release 2 (11.2), all services worked as though they were defined with a MANUAL
management policy.
See Also:
"srvctl add service"
for more usage information
Using CRSCTL to stop and restart Oracle Clusterware is treated as a failure and the service is restarted if it was previously running.
Note:
When you use automatic services in an administrator-managed database, during planned database startup, services may start on the first instances to start rather than their preferred instances.
If you configured Oracle Data Guard in your environment, then you can define a role for each service using SRVCTL with the -l
parameter. When you specify a role for a service, Oracle Clusterware automatically starts the service only when the database role matches the role you specified for the service. Valid roles are PRIMARY
, PHYSICAL_STANDBY
, LOGICAL_STANDBY
, and SNAPSHOT_STANDBY
and you can specify more than one role for a service.
Note:
The service role only controls automatic startup of services. Using SRVCTL to manually start a service will succeed even if the roles do not match.
If multiple databases in the cluster offer the same service name, then Oracle RAC balances connections to that service across all such databases. This is useful for standby and active Oracle Data Guard databases, but if you want client connections to a service to be directed to a particular database, then the service name must be unique within the cluster (not offered by any other database).
See Also:
Oracle Data Guard Concepts and Administration for more information about database roles
When you define a service for an administrator-managed database, you define which instances normally support that service using SRVCTL with the -preferred
parameter. These are known as the preferred instances. You can also define other instances to support a service if the service's preferred instance fails using SRVCTL with the -available
parameter. These are known as available instances.
When you specify preferred instances, you are specifying the number of instances on which a service normally runs. This is the maximum cardinality of the service. Oracle Clusterware attempts to ensure that the service always runs on the number of instances for which you have configured the service. Afterwards, due to either instance failure or planned service relocations, a service may be running on an available instance.
If an instance fails, then you cannot control to which available instance Oracle Clusterware relocates the services if there are multiple instances in the list. During a planned operation, however, you can manually direct the service to any instance in either the preferred or the available list not currently offering the service.
When a service moves to an available instance, Oracle Database does not move the service back to the preferred instance when the preferred instance restarts because:
The service is running on the desired number of instances.
Maintaining the service on the current instance provides a higher level of service availability.
Not moving the service back to the initial preferred instance prevents a second outage.
You can, however, easily automate fail back to the preferred instance by using FAN callouts.
See Also:
"Tools for Administering Oracle RAC" for more information about policy-managed and administrator-managed databases
When you define services for a policy-managed database, you assign the service to a server pool in which the database is hosted using SRVCTL with the -serverpool
parameter. You can define the service as either UNIFORM
(running on all instances in the server pool) or SINGLETON
(running on only one instance in the server pool) using the -cardinality
parameter. For singleton services, Oracle RAC chooses on which instance in the server pool the service is active. If that instance fails, then the service fails over to another instance in the server pool. A service can only run in one server pool and Oracle recommends that every server pool has at least one service.
Note:
Oracle Database Quality of Service Management (Oracle Database QoS Management) manages singleton services in a server pool, if the maximum size of that server pool is one.
See Also:
"Tools for Administering Oracle RAC" for more information about policy-managed and administrator-managed databases
With run-time connection load balancing, applications can use load balancing advisory events to provide better service to users. Oracle JDBC, Oracle Universal Connection Pool for Java, OCI session pool, ODP.NET, and Oracle WebLogic Server Active GridLink for Oracle RAC clients are automatically integrated to take advantage of load balancing advisory events. The load balancing advisory informs the client about the current service level that an instance is providing for a service. To enable the load balancing advisory, use SRVCTL with the -rlbgoal
parameter when creating or modifying the service.
The load balancing advisory also recommends how much of the workload should be sent to that instance. The goal determines whether connections are made to the service based on best service quality (how efficiently a single transaction completes) or best throughput (how efficiently a complete job or long-running query completes).
Oracle Net Services provides connection load balancing to enable you to spread user connections across all of the instances that are supporting a service. For each service, you can use SRVCTL to define the method you want the listener to use for load balancing by setting the connection load balancing goal, specified with the -clbgoal
parameter. Connections are classified as LONG
(such as connection pools and SQL*FORMS), which tells the listener to use session count, or SHORT
, which tells the listener to use response-time or throughput statistics. If the load balancing advisory is enabled, then its information is used to balance connections; otherwise, CPU utilization is used to balance connections.
Oracle XA applications have unique requirements. To make it easier to use Oracle RAC with global transactions, use SRVCTL and set the distributed transaction processing parameter (-dtp
) to TRUE
for the service so that all tightly coupled branches of a distributed transaction processing transaction are run on the same instance. This is a requirement only if you are suspending and resuming the same Oracle XA branch, but may improve performance if separate branches use the same instance.
See Also:
"Distributed Transaction Processing in Oracle RAC" for more information about distributed transaction processing in Oracle RAC