Database services
Database services are logical grouping of database sessions used for managing workloads. Services represent groups of
sessions with common attributes and priorities. Each database connection can specify
a service name. If no service is specified a default database service is used.
Creating a database service on Oracle RAC or single instance managed by Oracle Restart
To create a database service (hr_service) on Oracle RAC or single instance database managed by Oracle Restart
srvctl
tool needs to be used:
srvctl add service -d sapprod -s hr_service -preferred "sapprod1,sapprod2" -tafpolicy basic -notification true -failovertype select -failovermethod basic -failoverretry 180 -failoverdelay 5
This created service but did not start it. To start it on all nodes:
srvctl start service -db sapprod -service hr_service
To check the service status:
srvctl status service -db sapprod -verbose
Service hr_service is running on instance(s) sapprod1,sapprod2
Service SALES_SERVICE is running on instance(s) sapprod1
Service PAYROLL_SERVICE is running on instance(s) sapprod2
Creating a database service on single instance Oracle database
To create a database service (hr_service) on a single instance Oracle database all that is needed is to append new service name to existing value of
service_name database parameter and restart the database:
SQL> alter system set service_names=sapprod,hr_service scope=spfile;