Modify RAC Services. 28 January 2010Posted by David Alejo Marcos in RAC.
Tags: RAC, service
Today I had to redefine the services on our 3 nodes cluster.
The change has been triggered by a new database running on the cluster and a more logical distribution of the business as we noticed an increase on the load of data using the interconnect.
Batches were running on two different nodes, depending of the type of product. Some tables are specific to the product, but we still have many common tables and all the information retrieved from common tables were being transferred from node to node.
After this change, all batches but one will run on the same preferred node.
Redistribute existing services as per the following design:
Totem: PREF: qa1 qa2 qa3 AVAIL: TAF: NONE
CDS: PREF: qa2 AVAIL: qa3 TAF: NONE
Bonds: PREF: qa1 AVAIL: qa3 TAF: NONE
Totem: PREF: qa3 AVAIL: qa1 qa2 TAF: NONE
CDS: PREF: qa1 AVAIL: qa2 TAF: NONE
Bonds: PREF: qa1 AVAIL: qa2 TAF: NONE
The way we were going to implement it was by dropping the existing service and re-creating it. This is not a bad idea, but implies a reboot of our application server and the possibility of errors on the application if anything or anyone tries to connect to the database using that service at the time we were re-creating it (we are a 24*7 shop).
After having a look on the Oracle manuals (Oracle RAC Administrator guide, appendix B), I found a better way to do it.
srvctl modify service gives us the possibility of redefine the service without need of re-creating it or even stopping it.
Now we can upgrade available nodes to preferred, downgrade them or simply creating a new definition while the service is still running (Note.- Stop and start the service is recommended as there are some restrictions, i.e. newly added nodes will not be used until the service is restarted).
So, the syntax is as follows:
srvctl modify service -d db_unique_name -s service_name -n -i pref_inst_list [ -a avail_inst_list] [-f]
-n = Only uses the instances named for this service (unnamed instances already assigned to the service are removed).
-i = List of preferred instances.
-a = List of available instances.
-f = Disconnect all sessions during stop or relocate service operations.
In our case, the command I had to execute was:
srvctl modify service -s Totem -d qa -n -i qa3 -a qa1,qa2
to check the change:
[oracle ~]$ srvctl config service -s Totem -d qa -a
and the other services:
[oracle ~]$srvctl modify service -s CDS -d qa -n -i qa1 -a qa2
[oracle ~]$srvctl modify service -s bonds -d qa -n -i qa1 -a qa2
This will save us some typing and the potencial of making a mistake on the naming.
As always, comments are welcome.