Oracle RAC and services, crsctl, srvctl (again)

Here the Oracle documentation explains what the srvctl command can do with the services=>

https://docs.oracle.com/database/121/RACAD/GUID-6BC01F04-C46F-47BD-9AAC-CFA88F3D5911.htm#RACAD5013

But the service can also be a clustered resource so it can be modified with the command crsctl =>

https://docs.oracle.com/database/121/CWADD/GUID-AB5857CB-70F8-4655-B2A4-1C9629809675.htm#CWADD91551

What can be done with one and what with the other command exactly ?
Let’s see the syntax:

srvctl add service -db db_unique_name -service service_name [-eval] 
   -serverpool server_pool [-cardinality {UNIFORM | SINGLETON}] 
   [-edition edition_name] [-netnum network_number]
   [-role "[PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]"
   [-policy {AUTOMATIC | MANUAL}] [-notification {TRUE | FALSE}] 
   [-clbgoal {SHORT | LONG}] [-failovertype {NONE|SESSION|SELECT|TRANSACTION}]
   [-rlbgoal {NONE | SERVICE_TIME | THROUGHPUT}] [-dtp {TRUE | FALSE}]
   [-failovermethod {NONE | BASIC}] [-failoverretry failover_retries]
   [-failoverdelay failover_delay] [-pdb pluggable_database] 
   [-sql_translation_profile sql_translation_profile] 
   [-global {TRUE | FALSE}] [-maxlag max_lag_time] [-commit_outcome {TRUE|FALSE}]
   [-retention retention_time] [-replay_init_time replay_initiation_time]
   [-session_state {STATIC | DYNAMIC}] [-pqservice pq_service] 
   [-pqpool pq_pool_list] [-force]

crsctl modify resource resource_name -attr "attribute_name=attribute_value"

So let’s say we want to create a service called Sales_srv for our database called Sales_D

srvctl add service -db Sales_D -service Sales_srv

But we also want this service to be managed by the clusterware, so what should we do?

First of all, try to see what is the output of the following command:

crsctl status resource ora.db.Sales_D.Sales_srv -f ?

NAME=ora.mydatabase.Sales_D.Sales_srv.svc
TYPE=ora.service.type
STATE=ONLINE
TARGET=ONLINE
ACL=owner:oracle:rwx,pgrp:system:r-x,other::r--,group:oinstall:r-x,user:oracle:rwx
ACTIONS=isJavaService,group:"dba",group:"oper",user:"oracle"
ACTION_SCRIPT=
ACTION_TIMEOUT=60
ACTIVE_PLACEMENT=0
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
AGENT_PARAMETERS=
AQ_HA_NOTIFICATION=0
AUTO_START=restore
CARDINALITY=1
CARDINALITY_ID=0
CHECK_INTERVAL=0
CHECK_TIMEOUT=30
CLB_GOAL=LONG
CLEAN_TIMEOUT=60
COMMIT_OUTCOME=0
CONFIG_VERSION=1
CSS_CRITICAL=no
DEGREE=1
DELETE_TIMEOUT=60
DESCRIPTION=Oracle Service resource
DRAIN_ID=
DRAIN_TIMEOUT=
DTP=0
EDITION=
ENABLED=1
FAILOVER_DELAY=0
FAILOVER_METHOD=
FAILOVER_RESTORE=NONE
FAILOVER_RETRIES=
FAILOVER_TYPE=
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
GEN_SERVICE_NAME=Sales_D.Sales_srv
GLOBAL=false
GSM_FLAGS=0
HOSTING_MEMBERS=
ID=ora.mydatabase.Sales_D.Sales_srv.svc
IGNORE_TARGET_ON_FAILURE=no
INSTANCE_COUNT=1
INSTANCE_FAILOVER=1
INTERMEDIATE_TIMEOUT=0
LOAD=1
LOGGING_LEVEL=1
MANAGEMENT_POLICY=AUTOMATIC
MAX_LAG_TIME=ANY
MODIFY_TIMEOUT=60
NLS_LANG=
OFFLINE_CHECK_INTERVAL=0
OS_CRASH_THRESHOLD=0
OS_CRASH_UPTIME=0
OXR_SECTION=0
PLACEMENT=balanced
PLUGGABLE_DATABASE=
RELOCATE_BY_DEPENDENCY=1
RELOCATE_KIND=online
REPLAY_INITIATION_TIME=300
RESOURCE_GROUP=
RESTART_ATTEMPTS=2
RESTART_DELAY=0
RETENTION=86400
RF_SERVICE=0
RLB_GOAL=NONE
ROLE=PRIMARY
SCRIPT_TIMEOUT=60
SERVER_CATEGORY=
SERVER_POOLS=
SERVICE_NAME=myservice
SERVICE_NAME_PQ=
SERVICE_TYPE=MAIN
SESSION_NOREPLAY=false
SESSION_STATE_CONSISTENCY=DYNAMIC
SQL_TRANSLATION_PROFILE=
START_CONCURRENCY=0
START_DEPENDENCIES=hard(ora.mydatabase.db) weak(type:ora.listener.type) pullup:always(ora.mydatabase.db)
START_DEPENDENCIES_RTE_INTERNAL=MAINFalseora.mydatabase.dbTrueFalseFalse
START_DEPENDENCIES_TEMPLATE= hard(global:{mainService}) weak(type:ora.listener.type)   hard(global:{service})hard({database})exclusion({service}) pullup:always(global:{service}) pullup(global:{service})  hard({database})   dispersion(type:ora.service.type)    pullup:always({database})  pullup({database})    pullup({cluster_vip_net})   hard({cluster_vip_net}) hard({database}) pullup:always({database})  pullup({database})    pullup({cluster_vip_net})    dispersion(type:ora.service.type)  
START_TIMEOUT=600
STOP_CONCURRENCY=0
STOP_DEPENDENCIES=hard(intermediate:ora.mydatabase.db)
STOP_DEPENDENCIES_RTE_INTERNAL=Falseora.mydatabase.db
STOP_DEPENDENCIES_TEMPLATE=  hard(global:{service})  hard(intermediate:{database}) hard({cluster_vip_net}) 
STOP_OPTION=
STOP_TIMEOUT=600
TAF_FAILOVER_DELAY=
TAF_POLICY=NONE
TARGET_DEFAULT=default
TYPE_VERSION=3.2
UPTIME_THRESHOLD=1h
USER_WORKLOAD=yes
USE_STICKINESS=0
USR_ORA_DISCONNECT=false
USR_ORA_ENV=
USR_ORA_FLAGS=
USR_ORA_OPEN_MODE=
USR_ORA_OPI=false
USR_ORA_STOP_MODE=
WORKLOAD_CPU=0
WORKLOAD_CPU_CAP=0
WORKLOAD_MEMORY_MAX=0
WORKLOAD_MEMORY_TARGET=0

Some options seem redundant, existing in both crsctl and srvctl, like load balancing goals (RLB_GOAL…) or configurations related to failover (failovermethod…).

To be continued …

http://www.lyticsware.com

Leave a comment