Infrastructure at your Service

Franck Pachot

RAC to RON then RON to RAC and singleton service

By Franck Pachot

.
You will probably never do it, but let’s imagine you have a RAC database, policy managed, with singleton service. Then you convert it to RAC One Node and you change your mind and convert it back to RAC. Be careful, the singleton services are converted to uniform ones when converting to RAC

My RACDB database is running on two nodes:

[[email protected] ~]$ srvctl status database -db racdb
Instance RACDB_1 is running on node racp1vm1
Instance RACDB_2 is running on node racp1vm2

it is policy managed and in a server pool of two servers:


[[email protected] ~]$ srvctl config database -db racdb | grep pool
Server pools: pool1
[[email protected] ~]$ srvctl status srvpool -serverpool pool1
Server pool name: pool1
Active servers count: 2

I’m in RAC and have the singleton service ‘S’ running on first node


[[email protected] ~]$ srvctl config service -db racdb -service S
Service name: s
Server pool: pool1
Cardinality: UNIFORM
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
...

I want to go to RAC One Node so I need to have only one instance running


[[email protected] ~]$ srvctl stop instance -db racdb -instance RACDB_2 -f

and then convert


[[email protected] ~]$ srvctl convert database -db racdb -dbtype RACONENODE

Then I check the service:


[[email protected] ~]$ srvctl status service -db racdb -service s
Service s is running on nodes: racp1vm1

still running on one node of course, and still defined as SINGLETON


[[email protected] ~]$ srvctl  config service -db racdb -service s
Service name: s
Server pool: pool1
Cardinality: SINGLETON
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC

Let’s now convert back to RAC


[[email protected] ~]$ srvctl convert database -db racdb -dbtype RAC

and check the service:


[[email protected] ~]$ srvctl status service -db racdb -service s
Service s is running on nodes: racp1vm1,racp1vm2

Ouch. My service that was a singleton is now running on all nodes.


[[email protected] ~]$ srvctl config service -db racdb -service s
Service name: s
Server pool: pool1
Cardinality: UNIFORM
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC

It seems that the conversion from RAC One Node to RAC has modified all service cardinality to be UNIFORM.

You have to set it back to SINGLETON:


[[email protected] ~]$ srvctl modify service -db racdb -cardinality singleton -service s -f

Be careful with that.
A service for which the application has not be designed to be load balanced across several nodes may have horrible performance. It’s always a good idea to check the service config and where they are running.

One Comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Franck Pachot
Franck Pachot

Principal Consultant / Database Evangelist