srvctl modify service

This command supports some online modifications to the service, such as:

  • Moving a service member from one instance to another

  • Performing online changes to service attributes from DBMS_SERVICE (for example, failover delay, runtime load balancing goal, and so on)

  • Adding a new preferred or available instance

  • Removing preferred or available instances for a service

WARNING:

Oracle recommends that you limit configuration changes to the minimum requirement and that you not perform other service operations while the online service modification is in progress.

Use one of the following forms of the srvctl modify service command with the specified syntax:

To move a service from one instance to another:

srvctl modify service -db db_unique_name -service service_name 
      -oldinst old_instance_name -newinst new_instance_name [-force]

Note:

This form of the command is only available with Oracle Clusterware.

Table A-91 srvctl modify service Parameters for Moving a Service

Parameter Description
-database db_unique_name

Unique name for the database

-service service_name

Service name

-oldinst old_instance_name

Old instance name

-newinst new_instance_name

New instance name

-force

Disconnect all sessions during stop or relocate service operations

To change an available instance to a preferred instance for a service:

srvctl modify service -db db_unique_name -service service_name 
      -available avail_inst_name -toprefer [-force]

Note:

This form of the command is only available with Oracle Clusterware and does not accept placement parameters for Oracle RAC One Node databases.

Table A-92 srvctl modify service Parameters for Changing to a Preferred Instance

Parameter Description
-db db_unique_name

Unique name for the database.

-service service_name

Specify the name of the service you want to modify.

-available available_inst_name

Name of the available instance to change.

-toprefer

Change instance status to preferred.

-force

Disconnect all sessions during stop or relocate service operations. For planned operations, the user experience is best if using an Oracle Connection Pool with FAN, and not forcing disconnect. The FAN planned event causes the Oracle pool to drain the requests with no interruption to the users.

To change the available and preferred status for multiple instances:

srvctl modify service -db db_unique_name -service service_name 
     -modifyconfig -preferred "preferred_list" [-available "available_list"]
     [-force]

Note:

This form of the command is only available with Oracle Clusterware and does not accept placement parameters for Oracle RAC One Node databases.

Table A-93 srvctl modify service Parameters for Changing Status of Multiple Instances

Parameter Description
-db db_unique_name

Unique name for the database

-service service_name

Service name

-modifyconfig

Uses only the instances named for this service (unnamed instances already assigned to the service are removed)

-preferred "preferred_instance_list"

Comma-delimited list of preferred instances

-available "available_instance_list"

Comma-delimited list of available instances

-force

Disconnect all sessions during stop or relocate service operations.

For planned operations, the user experience is best if using an Oracle Connection Pool with FAN, and not forcing disconnect. The FAN planned event causes the connection pool to drain the requests with no interruption to the users.

To modify other service attributes or to modify a service for Oracle Clusterware:

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

Table A-94 srvctl modify service Parameters

Parameter Description
-db db_unique_name

Unique name for the database

-service service_name

Service name

-eval

Use this parameter to hypothetically evaluate the impact of the command on the system.

Note: You can only use this parameter with a policy-managed service.

-serverpool pool_name

The name of a server pool used when the database is policy managed.

Note: This parameter can be used only with Oracle RAC and only for policy-managed databases.

-cardinality {UNIFORM |
 SINGLETON}

The cardinality of the service, either UNIFORM (offered on all instances in the server pool) or SINGLETON (runs on only one instance at a time)

Note: This parameter can be used only with Oracle Clusterware.

-pqservice pqsvc_name

Comma-delimited list of parallel query service names

-pqpool pq_pool_list

Comma-delimited list of parallel query server pool names

-tafpolicy
 {BASIC|NONE}

TAF policy specification (for administrator-managed databases only).

-edition edition_name

The initial session edition of the service.

When an edition is specified for a service, all subsequent connections that specify the service use this edition as the initial session edition. However, if a session connection specifies a different edition, then the edition specified in the session connection is used for the initial session edition.

SRVCTL does not validate the specified edition name. During connection, the connect user must have USE privilege on the specified edition. If the edition does not exist or if the connect user does not have USE privilege on the specified edition, then an error is raised.

-role "[PRIMARY]
 [,PHYSICAL_STANDBY]
 [,LOGICAL_STANDBY]
 [,SNAPSHOT_STANDBY]"

The database modes for which the service should be started automatically. You can specify one or more roles in a comma-delimited list.

Note:

The -role parameter is only used at database startup and by the Oracle Data Guard Broker. All manual service startup must specify the name of the service to be started by the user.

See Also:

Oracle Data Guard Broker if you specify -role

-notification {TRUE | FALSE}

Enable Fast Application Notification (FAN) for OCI connections

-dtp {TRUE | FALSE}

Indicates whether Distributed Transaction Processing should be enabled for this service. This ensures that the service is offered at exactly one instance at a time for XA affinity.

-clbgoal {SHORT | LONG}

For connection load balancing goal: set to SHORT if using runtime load balancing, set to LONG for long running connections such as batch jobs or older SQL*Forms style.

-rlbgoal {NONE |
 SERVICE_TIME | THROUGHPUT}

Runtime Load Balancing Goal. Set this parameter to SERVICE_TIME to balance connections by response time. Set this parameter to THROUGHPUT to balance connections by throughput.

-failovertype {NONE |
 SESSION | SELECT | TRANSACTION}

Failover type

To enable Application Continuity for Java, set this parameter to TRANSACTION. To enable Transparent Application Failover (TAF) for OCI, set this parameter to SELECT or SESSION.

-failovermethod {NONE | BASIC}

TAF failover method (for backward compatibility only).

-failoverretry
 failover_retries

For Application Continuity and TAF, the number of attempts to connect after an incident.

-failoverdelay
 failover_delay

For Application Continuity and TAF, the time delay (in seconds) between reconnect attempts per incident at failover.

-policy {AUTOMATIC | MANUAL}

Service management policy.

-pdb pluggable_database

Pluggable database (PDB) name.

Note: You can specify a PDB property when you create or modify a service. The PDB property associates the service with the specified PDB. You can view the PDB property for a service by querying the ALL_SERVICES data dictionary view or, when using the SRVCTL utility, by running the srvctl config service command.

When create or modify a service with the specified PDB, SRVCTL does not check if the PDB exists.Before running this command, you must ensure that the PDB exists.

-sql_translation_profile
 profile_name

Use this parameter to specify a SQL translation profile for a service that you are modifying after you have migrated applications from a non-Oracle database to an Oracle database.

If you want to set the SQL translation profile to a NULL value, then you must enter an empty string after the -p flag.

Note: Before using the SQL translation feature, you must migrate all server-side application objects and data to the Oracle database.

See Also: Oracle Database Migration Guide for more information about SQL translation

-commit_outcome {TRUE|FALSE}

Enable Transaction Guard; when set to TRUE, the commit outcome for a transaction is accessible after the transaction's session fails due to a recoverable outage.

-retention retention_time

For Transaction Guard (commit_outcome set to TRUE), this parameter determines the amount of time (in seconds) that the commit outcome is retained in the database.

-replay_init_time
 replay_init_time

For Application Continuity, this parameter specifies the time, in seconds, from when the original request started execution. Application Continuity will not replay after the specified amount of time has passed. This attribute avoids the unintentional replay of a request when a system is recovered after a long period. The default value is 300 (5 minutes).

-session_state
 {STATIC|DYNAMIC}

For Application Continuity, this parameter specifies whether the session state that is not transactional is changed by the application. Oracle recommends a value of DYNAMIC for most applications. If you are unsure which value to use or you can customize the application, then use DYNAMIC. STATIC mode is on request for database-agnostic applications, that never change non-transactional state inside a request.

-global_override
 global_override

Override value to modify the global service attributes.

This parameter is used with the -role, -policy, -notification, -failovertype, -failovermethod, -failoverdelay, -failoverretry and -edition parameters.

-verbose

Display verbose output.

-force

Force the modify operation, stopping the service on some nodes as necessary.

Usage Notes

  • When performing online changes to service attributes (for example, failover delay, Runtime Load Balancing Goal, and so on), the changes take effect only when the service is next (re)started.

  • When a service configuration is modified so that a new preferred or available instance is added, the running state of the existing service is not affected. However, the newly added instances will not automatically provide the service, until a srvctl start service command is issued.

  • When there are available instances for the service, and the service configuration is modified so that a preferred or available instance is removed, the running state of the service may change unpredictably:

    • The service is stopped and then removed on some instances according to the new service configuration.

    • The service may be running on some instances that are being removed from the service configuration.

    • These services will be relocated to the next free instance in the new service configuration.

Because of these considerations, when the online service is being modified, users may experience a brief service outage on some instances even if the instances are not being removed. Or users may experience a brief service outage on instances that are being removed from the service.

Examples

An example of moving a service member from one instance to another is:

$ srvctl modify service -db crm -service crm -oldinst crm1 -newinst crm2

An example of changing an available instance to a preferred instance is:

$ srvctl modify service -db crm -service crm -available crm1 -toprefer

The following command exchanges a preferred and available instance:

$ srvctl modify service -db crm -service crm -modifyconfig -preferred "crm1" \
-available "crm2"