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:
Therefore, you have different ways to create a service, depending on your configuration.
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
srvctl add service -db db_unique_name -service service_name [-eval] -serverpool server_pool [-cardinality {UNIFORM | SINGLETON}] [-edition edition_name] [-netnum network_number] [-role "[PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]" [-policy {AUTOMATIC (default) | MANUAL}] [-notification {TRUE | FALSE}] [-clbgoal {SHORT | LONG}] [-failovertype {NONE|SESSION|SELECT|TRANSACTION}] [-rlbgoal {NONE | SERVICE_TIME | THROUGHPUT}] [-dtp {TRUE | FALSE}] [-failovermethod {NONE | BASIC}] [-failoverretry failover_retries] [-failoverdelay failover_delay] [-pdb pluggable_database] [-sql_translation_profile sql_translation_profile] [-global {TRUE | FALSE}] [-maxlag max_lag_time] [-commit_outcome {TRUE|FALSE}] [-retention retention_time] [-replay_init_time replay_initiation_time (default 5 minutes, 300 seconds)] [-session_state {STATIC | DYNAMIC}] [-pqservice pq_service] [-pqpool pq_pool_list] [-force]
Let us break down each parameter here, except the obvious ones (db_unique_name, service_name, server_pool, pdb)
Phew, that was something. I am sure, I am missing something, for a complete list you can check: here
Now let's check the administer based. I will discuss only the missing / different parameters
The command to add a service in admin managed database is pretty similiar:
Add Admin Managed Service
-preferred preferred_list -available available_list] [-netnum network_number] [-tafpolicy {BASIC | NONE | PRECONNECT}] [-edition edition_name] [-role "[PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]" [-policy {AUTOMATIC | MANUAL}] [-notification {TRUE | FALSE}] [-clbgoal {SHORT | LONG}] [-failovertype {NONE|SESSION|SELECT|TRANSACTION}] [-rlbgoal {NONE | SERVICE_TIME | THROUGHPUT}] [-dtp {TRUE | FALSE}] [-failovermethod {NONE | BASIC}] [-failoverretry failover_retries] [-failoverdelay failover_delay] [-pdb pluggable_database] [-sql_translation_profile sql_translation_profile] [-global {TRUE | FALSE}] [-maxlag max_lag_time] [-commit_outcome {TRUE|FALSE}] [-retention retention_time] [-replay_init_time replay_initiation_time] [-session_state {STATIC|DYNAMIC}] [-pqservice pq_service] [-pqpool pq_pool_list] [-force] [-verbose]
These parameters are exclusive for a service on a admin managed database. The rest of the parameters are the same as the policy managed. If it will help you understand services better. You have to answer yourself the following questions.
There are more, but these 3 are the main ones. Good luck.
Services are instrument through which we allow access to our database. These services can behave in different ways and it is up to us as DBAs to set them correct, so the client will be able to access his data.