Database Reference
In-Depth Information
The following command adds a new service: po to solrac database. This command also specifies that this service
should be preferred in solrac1 and solrac3 instances, and the service should fail over to solrac2 and solrac4 instances
if a preferred instance fails. Flag -r specifies preferred instances, and flag -a specifies available instances.
$ srvctl add service -d solrac -s po -r solrac1,solrac3 \
-a solrac2,solrac4 -m BASIC -j short -B service_time
In Oracle Database version 12c, the syntax to add a service is different and the options are more verbal. While the
command options in 11.2 will also work in version 12c, the abbreviated command options are deprecated in version 12c.
Earlier version 11.2 commands to add a service can be rewritten as follows using version 12c syntax.
$ srvctl add service -db solrac -service po
-preferred solrac1,solrac3 \
-available solrac2,solrac4 -failovermethod BASIC \
-clbgoal short -rlbgoal service_time
Adding a service using the srvctl command adds a resource in Clusterware, too. Whereas in 11.2 versions,
the user has to start the service manually after adding a service, in version 12c, the service is automatically started.
This cluster resource is a dependent of database and VIP resources. So, as soon as the database and VIP resources
are online, the service resource will be altered online.
$ crsctl stat res ora.solrac.po.svc -p |more
NAME=ora.solrac.po.svc
TYPE=ora.service.type
...
SERVICE_NAME=PO
START_DEPENDENCIES=hard(ora.solrac.db,type:ora.cluster_vip_net1.type)
weak(type:ora.listener.type) pullup(type:ora.cluster_vip_net1.type) pullup:always(ora.solrac.db)
Starting the database resource will recursively start dependent Clusterware resources. As the services are defined
as dependent resources, starting the Clusterware resource of a service enables the service in the database by implicitly
calling the dbms_service package.
You could explicitly start a service using the srvctl command, as well. Query the view v$active_services to see that
a new service has been created and started.
$ srvctl start service -d solrac -s po
SQL> select name, creation_date from v$active_services
where name='PO';
NAME CREATION_DATE
----------------------------------------- ---------------
PO 17-DEC-12
Service Metrics
The MMON (Memory Monitor) database background process calculates the service-level metrics using service
statistics, and these metrics are visible at v$activeservice dynamic performance view. Metrics are calculated at
intervals of 5 seconds and 1 minute. In the following output, the first line shows the metrics calculated at 1-minute
intervals, and the second line shows the metrics calculated at 5-second intervals.
SQL> select inst_id, begin_time, end_time from gv$servicemetric
where service_name='PO' order by 1, 2;
 
Search WWH ::




Custom Search