Working with Services

Check service status

NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.grac4.grac41.svc           ONLINE     ONLINE          grac41        
ora.grac4.grac42.svc           ONLINE     ONLINE          grac42    

Lets check the resources: 
[oracle@grac41 trace]$ srvctl config service -d grac4 -s grac41
Service name: grac41
Service is enabled
Server pool: grac4_grac41
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition: 
Preferred instances: grac41
Available instances: 

[oracle@grac41 trace]$  srvctl config service -d grac4 -s grac42
Service name: grac42
Service is enabled
Server pool: grac4_grac42
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition: 
Preferred instances: grac42
Available instances:
-->  The current services are  designed to run only on their related instances - no failover 

Init.ora reports during instance startup :
gract1: ALTER SYSTEM SET service_names='grac41' SCOPE=MEMORY SID='grac41';
gract2: ALTER SYSTEM SET service_names='grac42' SCOPE=MEMORY SID='grac42';

Add a global service

[oracle@grac42 trace]$ srvctl add service -d grac4 -s grac4s -r grac41,grac42

[root@grac41 Desktop]#  crs | egrep 'NAME|---|svc'
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.grac4.grac41.svc           ONLINE     ONLINE          grac41        
ora.grac4.grac42.svc           ONLINE     ONLINE          grac42        
ora.grac4.grac4s.svc           OFFLINE    OFFLINE         grac41        
ora.grac4.grac4s.svc           OFFLINE    OFFLINE         grac42     

Init.ora ( no change as services are not started )
gract1: ALTER SYSTEM SET service_names='grac41' SCOPE=MEMORY SID='grac41';
gract2: ALTER SYSTEM SET service_names='grac42' SCOPE=MEMORY SID='grac42';

Check the service 
[oracle@grac41 trace]$ srvctl config service -d grac4 -s grac4s
Service name: grac4s
Service is enabled
Server pool: grac4_grac4s
Cardinality: 2
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition: 
Preferred instances: grac41,grac42
Available instances: 

Start service 
[oracle@grac41 trace]$  srvctl start  service -d grac4 -s grac4s
[root@grac41 Desktop]# crs | egrep 'NAME|---|svc'
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.grac4.grac41.svc           ONLINE     ONLINE          grac41        
ora.grac4.grac42.svc           ONLINE     ONLINE          grac42        
ora.grac4.grac4s.svc           ONLINE     ONLINE          grac41        
ora.grac4.grac4s.svc           ONLINE     ONLINE          grac42     

Init.ora
gract1: ALTER SYSTEM SET service_names='grac41','grac4s' SCOPE=MEMORY SID='grac41';
gract2: ALTER SYSTEM SET service_names='grac42','grac4s' SCOPE=MEMORY SID='grac42';

 

Create a preferred service

[oracle@grac42 trace]$ srvctl add service  -d grac4 -s  report  -r grac41 -a grac42
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.grac4.grac41.svc           ONLINE     ONLINE          grac41        
ora.grac4.grac42.svc           ONLINE     ONLINE          grac42        
ora.grac4.grac4s.svc           ONLINE     ONLINE          grac41        
ora.grac4.grac4s.svc           ONLINE     ONLINE          grac42        
ora.grac4.report.svc           OFFLINE    OFFLINE         grac41 

Start that service 
[oracle@grac42 trace]$ srvctl add service  -d grac4 -s  report 
 
Init.ora
gract1: ALTER SYSTEM SET service_names='grac4s','grac41','report' SCOPE=MEMORY SID='grac41';
gract2: ALTER SYSTEM SET service_names='grac42','grac4s' SCOPE=MEMORY SID='grac42'; ( unchanged )

Relocate a service

[oracle@grac42 trace]$ srvctl relocate service  -d grac4 -s  report -i grac41 -t grac42
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.grac4.grac41.svc           ONLINE     ONLINE          grac41        
ora.grac4.grac42.svc           ONLINE     ONLINE          grac42        
ora.grac4.grac4s.svc           ONLINE     ONLINE          grac41        
ora.grac4.grac4s.svc           ONLINE     ONLINE          grac42        
ora.grac4.report.svc           ONLINE     ONLINE          grac42   

Init.ora
gract1: ALTER SYSTEM SET service_names='grac4s','grac41' SCOPE=MEMORY SID='grac41';
gract2: ALTER SYSTEM SET service_names='grac4s','grac42','report' SCOPE=MEMORY SID='grac42';

Services are tracked in following CW trace files

TraceFileName: ./crsd/crsd.log
2014-08-29 16:50:12.360: [   CRSPE][3598661376]{2:8924:603} Parsed and validated SERVERPOOL: ora.grac4_xxxxx [min:0][max:1][importance:0] [Server Names: grac41 ][Parent Pools: ora.grac4 ]NO SERVERS ASSIGNED
2014-08-29 16:50:12.360: [   CRSPE][3598661376]{2:8924:603} Parsed and validated SERVERPOOL: ora.grac4_xxxxx [min:0][max:1][importance:0] [Server Names: grac41 ][Parent Pools: ora.grac4 ]NO SERVERS ASSIGNED
..
 -------------------------------------------------------------------- 
TraceFileName: ./agent/crsd/oraagent_oracle/oraagent_oracle.log
2014-08-29 16:50:27.104: [    AGFW][3881805568]{2:8924:671} Agent received the message: RESOURCE_ADD[ora.grac4.xxxxx.svc 1 1] ID 4356:5068
2014-08-29 16:50:27.105: [    AGFW][3881805568]{2:8924:671} Added new resource: ora.grac4.xxxxx.svc 1 1 to the agfw
2014-08-29 16:50:27.105: [    AGFW][3881805568]{2:8924:671} Agent sending last reply for: RESOURCE_ADD[ora.grac4.xxxxx.svc 1 1] ID 4356:5068
..
 -------------------------------------------------------------------- 
TraceFileName: ./agent/ohasd/oraagent_grid/oraagent_grid.log
2014-08-29 16:50:27.769: [ USRTHRD][885479168]{2:8928:671} EVM UsrcoEventForwarder::postMyEvent posting event "SERVICEMEMBER VERSION=1.0 i
     service=xxxxx database=grac4 instance=grac41 host=grac41 status=up reason=USER card=1 timestamp=2014-08-29 16:50:27 "
2014-08-29 16:50:27.769: [ USRTHRD][885479168]{2:8928:671} EVM UsrcoEventForwarder::postMyEvent posting event "SERVICE VERSION=1.0 
     service=xxxxx database=grac4 instance= host=grac41 status=up reason=USER timestamp=2014-08-29 16:50:27 "
..
 -------------------------------------------------------------------- 
TraceFileName: ./cssd/ocssd.log
2014-08-29 16:50:27.573: [    CSSD][1708140288]clssgmJoinGrock: global grock IGGRAC4xxxxx new client 0x7f575040d710 with con 0x7f570003e7b6, requested num 1, flags 0x0
2014-08-29 16:50:27.573: [    CSSD][1708140288]clssgmGetGrock: Created grock IGGRAC4xxxxx, type 2, ct 0 gid-gin(48-0) at creation time
..

Leave a Reply

Your email address will not be published. Required fields are marked *