1.Creating Service in Oracle RAC :
Step 1: To create a service in Oracle RAC
[oracle@rac1 ~]$ srvctl add service -d orcl -s myservice -r orcl1 -a orcl2 -P BASIC
Here I have created service named myservice with preferred instance orcl1 and available instance orcl2.
To check all available parameters of service creation :
[oracle@rac1 ~]$ srvctl add service -h Adds a service configuration to the Oracle Clusterware. Usage: srvctl add service -d <db_unique_name> -s <service_name> {-r "<preferred_list>" [-a "<available_list>"] [-P {BASIC | NONE | PRECONNECT}] | -g <pool_name> [-c {UNIFORM | SINGLETON}] } [-k <net_num>] [-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]] [-y {AUTOMATIC | MANUAL}] [-q {TRUE|FALSE}] [-x {TRUE|FALSE}] [-j {SHORT|LONG}] [-B {NONE|SERVICE_TIME|THROUGHPUT}] [-e {NONE|SESSION|SELECT}] [-m {NONE|BASIC}] [-z <failover_retries>] [-w <failover_delay>] [-t <edition>] [-f] -d <db_unique_name> Unique name for the database -s <service> Service name -r "<preferred_list>" Comma separated list of preferred instances -a "<available_list>" Comma separated list of available instances -g <pool_name> Server pool name -c {UNIFORM | SINGLETON} Service runs on every active server in the server pool hosting this service (UNIFORM) or just one server (SINGLETON) -k <net_num> network number (default number is 1) -P {NONE | BASIC | PRECONNECT} TAF policy specification -l <role> Role of the service (primary, physical_standby, logical_standby, snapshot_standby) -y <policy> Management policy for the service (AUTOMATIC or MANUAL) -e <Failover type> Failover type (NONE, SESSION, or SELECT) -m <Failover method> Failover method (NONE or BASIC) -w <integer> Failover delay -z <integer> Failover retries -t <edition> Edition (or "" for empty edition value) -j <clb_goal> Connection Load Balancing Goal (SHORT or LONG). Default is LONG. -B <Runtime Load Balancing Goal> Runtime Load Balancing Goal (SERVICE_TIME, THROUGHPUT, or NONE) -x <Distributed Transaction Processing> Distributed Transaction Processing (TRUE or FALSE) -q <AQ HA notifications> AQ HA notifications (TRUE or FALSE) Usage: srvctl add service -d <db_unique_name> -s <service_name> -u {-r "<new_pref_inst>" | -a "<new_avail_inst>"} [-f] -d <db_unique_name> Unique name for the database -s <service> Service name -u Add a new instance to service configuration -r <new_pref_inst> Name of new preferred instance -a <new_avail_inst> Name of new available instance -f Force the add operation even though a listener is not configured for a network -h Print usage
Step 2: Check the status of service :
[oracle@rac1 ~]$ srvctl status service -d orcl -s myservice Service myservice is not running.
We can see here service is not running. By default, service is not started. We need to start it
[oracle@rac1 ~]$ srvctl start service -d orcl -s myservice
Now, lets check the status of service :
[oracle@rac1 ~]$ srvctl status service -d orcl -s myservice Service myservice is running on instance(s) orcl1 [oracle@rac1 ~]$
Check service configuration :
[oracle@rac1 ~]$ srvctl config service -d orcl -s myservice Service name: myservice Service is enabled Server pool: orcl_myservice 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: BASIC Edition: Preferred instances: orcl1 Available instances: orcl2
2. Modifying service
[oracle@rac1 ~]$ srvctl modify service -d orcl -s myservice -P NONE
Now let’s check service with config command
[oracle@rac1 ~]$ srvctl config service -d orcl -s myservice Service name: myservice Service is enabled Server pool: orcl_myservice 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: orcl1 Available instances: orcl2
We can see here TAF policy specification is changed to NONE from BASIC
3. Deleting Service :
[oracle@rac1 ~]$ srvctl remove service -d orcl -s myservice PRCR-1025 : Resource ora.orcl.myservice.svc is still running
We got an error while deleting service, as service is still running on the orcl1 instance. So we need to first stop it and then try removing it.
[oracle@rac1 ~]$ srvctl stop service -d orcl -s myservice [oracle@rac1 ~]$ srvctl remove service -d orcl -s myservice
Stay tuned for More articles on Oracle 18c
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
Anuradha’s LinkedIn: Anuradha’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp