Tag Archives: service

Create, disable, enable, and drop services in the Oracle RAC Environment

Managed Services in RAC Oracle

Services are used for managing the workload in the Oracle database and simplifying the way of connection with applications and groups of applications.
Divide the workload with the help of services like OLTP, Batch, and Reporting to simplify the bottleneck when issues occur.
srvctl command is used to manage the services. Services integrated with resource manager
Services also control parallel operations in RAC, by default all instance is used for parallel operations in RAC.

Characteristics for service
Service Name
Service Edition
Service management policy – Manual when service does not start when the database is started, Automatic when the database starts service automatic start
Database role
Instance preference – Specify the instance preference
Server pool Assignment
Load balancing advisory – Run time connection load balancing to choose the
Connection load balancing goal –

Note: Default database name service identified by db_unique_name if not set then db_name or pdb_name is as default service.

Creating and Managing the Services in RAC Environment Oracle

Create a new Service for the ORCL database.

srvctl add service -db orcl -service GL  -preferred NODE1,NODE2,NODE3

Check the Configuration of the Service created.

srvclt config service -db orcl -service GL

Create a service with available and preferred options

srvctl add service -db orcl -service AL -preferred NODE1,NODE2 -available NODE3

Create a service “ETL” with a server pool with a singleton option so that it will work only on one instance. Policy is manual means it does not start or stop automatically administrator does it manually to stop and start the service.

srvctl add service -db orcl -service ETL -serverpool SP1 -cardinality SINGLTON -policy MANUAL

Create a service “TRAN” with uniform cardinality so that it runs all the nodes present in the server pool. Choose a policy to automatic so it automatically starts or stops with the database

srvctl add service -db orcl -service TRAN -serverpool SP2 -cardinality UNIFORM -policy AUTOMATIC

Start the service in RAC

srvctl start service -db orcl -service GL

srvctl start service -db orcl -service AL

Check the status of the service in RAC

srvctl status service -db orcl -service AL

Service AL is running on instance(s) node1

Stop the Service in RAC

srvctl stop service -db orcl -service AL

-- Stop service on particular instance only

srvctl stop service -db orcl -service GL -instance NODE1

Disable the service in RAC environment

srvctl disable service -db orcl -service AL -instance NODE1

Changing the preferred and available instance

srvctl modify service -db orcl -service AL -modifyconfig -perferred NODE1, NODE2 -available NODE3

Relocate the service from NOde1 to Node3

srvctl relocate service -db orcl -service AL -oldinst NODE1 -newinst Node3

Manage Service for PDB database in RAC Environment

It is a dynamic service we created, The default service is the service that is created when the PDB database is created, its name is the same PDB name or PDB name plus the domain name.

Create a Service for the PDB database

Note: you create it with policy automatic then you do not need to start the PDB database every time the instance starts

srvctl add service -db contdb -pdb pdb1 -service pdb1srv -serverpool sp1 -cardinality singleton -policy manual


serctl add service -db contdb -pdb pdb2 -service pdb2srv -serverpool sp1 -cardinality uniform -policy automatic

Note: automatic is the default

Start the service of the PDB database:

srvctl start service -db contdb -service pdb1srv

Check the Status of the Service

srvctl status service -db contdb

Service pdb1srv is running on nodes: NODE1

Service pdb2srv is running on nodes: NODE1,NODE2

Check Service from sqlplus

select name, con_id from cdb_services;

Remove the service

srvctl remove service -db contdb -service pdb1srv

Restricted Service Registration

Restricted Service Registration is only for local IP address/network. (subnet address is same). valid node checking is enabled by default.

Check the default setting for SCAN Listener when configured

srvctl config scan_listener

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:

Restricted Service to registered nodes on scan listener:

srvctl modify scan_listener -update -invitednodes host1,host2,host3

Restricted Service with Registered Subnet on Scan Listener:

srvclt modify scan_listener -update -invitedsubnets 192.168.0.0/24,10.10.10.0/24

Check again the Scan listener setting:

#srvctl config scan_listener

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
Registration invited nodes: host1,host2,host3
Registration invited subnets: 192.168.0.0/24,10.10.10.0/24
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
Registration invited nodes: host1,host2,host3
Registration invited subnets: 192.168.0.0/24,10.10.10.0/24
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
Registration invited nodes: host1,host2,host3
Registration invited subnets: 192.168.0.0/24,10.10.10.0/24
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:

Note: when you add register nodes and subnet then listener.ora file is updated with parameters REGISTRATION_INVITED_NODES_LISTENER_SCAN