On the Oracle Real Application Clusters (Oracle RAC) 11G you can create services for clients use to connect to one or several instances using either Oracle Enterprise Manager or SRVCTL. Moreover, it is important you know the managed methods for configure the services and what are the activities that you can do in a service.The activities are show bellow:
- Delete a service
- Check the status of a service
- Start or stop a service for a database or an instance
- Map a service to a consumer group
- Enable or disable a service for a database or an instance
- Relocate a service to a different instance
The managed methods are Administrator-managed (manual) or Policy-managed. Using Administrator-managed database for a service you define the instance that will support the service by the command SRVCTL with -r option (preferred instances) and SRVCTL with -a option (available instances). Therefore, using Policy-managed you define the service to a server pool through command SRVCTL with -g option and can define weather the service will run in all instance (Uniform) or in an unique instance (Singleton) through the server pool.
Then, in this post I will show an example creating a service with Administrator-managed (manual).
Set the environment variable to your database(in my case instance bd2 ) and run the command below to show the actual managed method:
srvctl config database -d unique_name
Was showed that the database is Administrator-managed. Then, we will create a service called techdatabasket and start him through the follow command:
srvctl add service -d unique_name -s service_name -r preferred_instance_name -a available_instance_name srvctl start service -d unique_name -s service_name
As root user, check the status for the service: $GRID_HOME/crsctl status resource
Stop the database where the service was created killing the process for the database and check weather failover was successful.
Run the command ps -ef|grep smon and kill the database process showed (3302)
Check the service in another node (bd1)…
The faiolver was successful. The database bd2 will return, but you have to relocate the service to preferred instance using the command SRVCTL with relocate:
srvctl relocate service -d unique_name -s service_name -i available_instance -t preferred_instance
Ok, now we finish the example about Administrator-managed. If you want, you can drop the service through command srvctl remove service -d unique_name -s service_name, after you stop the service .
References:
Oracle® Real Application Clusters Administration and Deployment Guide 11g Release 2 (11.2) E41960-03 5 Introduction to Automatic Workload Management