Service Commands
Use commands with the service keyword to add, modify, list the configuration of, enable, disable, start, stop, obtain the status of, relocate, and remove services.
srvctl add service
Adds services to a database and assigns them to instances.
Syntax
Use this command with one of the following syntax models.
Note:
The policy-managed database deployment option is desupported in Oracle AI Database 26ai.
To add a service to a database:
srvctl add service -db db_unique_name -service service_name_list [-true_cache_service true_cache_service_list]
[-cardinality {UNIFORM | SINGLETON | DUPLEX} | -preferred "preferred_list"
[-available "available_list"] [-tafpolicy {BASIC | NONE | PRECONNECT}] | [-cardinality {UNIFORM | SINGLETON}] ]
[-netnum network_number] [-role "[PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]"]
[-policy {AUTOMATIC | MANUAL}] [-notification {TRUE | FALSE}] [-dtp {TRUE | FALSE}]
[-clbgoal {SHORT | LONG}] [-rlbgoal {NONE | SMART_CONN | SERVICE_TIME | THROUGHPUT}] [-resetstate {NONE | LEVEL1 | LOGIN}]
[-failovertype {NONE|SESSION|SELECT|TRANSACTION|AUTO}] [-failovermethod {NONE | BASIC}] [-failoverretry failover_retries]
[-failoverdelay failover_delay] [-failover_restore {NONE|LEVEL2|LEVEL1|AUTO}] -template_timeout template_timeout [-failback {YES | NO}]
[-edition edition_name] [-pdb pdb_name] [-global {TRUE | FALSE}] [-maxlag max_lag_time]
[-sql_translation_profile sql_translation_profile] [-commit_outcome {TRUE|FALSE}] [-retention retention_time]
[-replay_init_time replay_initiation_time] [-session_state {DYNAMIC | AUTO}] [-importfile file_name]
[-gsmflags gsm_flags] [-tablefamilyid table_family_id]
[-drain_timeout timeout] [-stopoption {NONE|IMMEDIATE|TRANSACTIONAL}] [-css_critical {yes | no}]
[-force] [-verbose]
To update the preferred and available lists of an existing service:
srvctl add service -db db_unique_name -service "service_name_list"
-update {-preferred "preferred_list" | -available "available_list"} [-force]
[-verbose]
Parameters
The following table lists and describes all the srvctl add service parameters and whether they can be used when adding a service to either an Oracle RAC database or non-cluster database.
Table: srvctl add service Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Unique name for the database. |
-service service_name_list | The Note: The |
-true_cache_service true_cache_service_list | Specify this parameter to associate a primary service with the True Cache service. |
-cardinality {UNIFORM | SINGLETON | DUPLEX} | The cardinality of the service, which can be one of the following:
Note: This parameter can be used only with Oracle RAC. |
-preferred " preferred_list " | A comma-separated list of preferred instances on which the service runs. The list of preferred instances must be mutually exclusive with the list of available instances. Note: This parameter can be used only with Oracle RAC. |
-available " available_list " | A comma-separated list of available instances, in priority order, to which the service fails over. The list of available instances must be mutually exclusive with the list of preferred instances. Note: This parameter can be used only with Oracle RAC. |
-tafpolicy {BASIC|NONE} | Transparent Application Failover (TAF) policy specification. |
-netnum network_number | Use this parameter to determine on which network this service is offered. The service is configured to depend on VIPs from the specified network. Notes:
|
-role "[PRIMARY][,PHYSICAL_STANDBY] [,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]" | The service role. You can specify one or more roles in a comma-delimited list. Use this option to indicate that the service should only be automatically started upon database open when the Oracle Data Guard database role matches one of the specified service roles. Using SRVCTL to manually start a service is not affected by the service role. Note: The |
-policy {AUTOMATIC | MANUAL} | Service management policy. If If Note: Using CRSCTL to stop and start the Oracle Clusterware restarts the service in the same way that a failure does. |
-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 service will be a preferred service on a single node in an administrator-managed database. |
-clbgoal {SHORT | LONG} | Connection Load Balancing Goal. Use a value of SHORT for this parameter for run-time load balancing, or if using an integrated connection pool. Use a value of LONG for this parameter for long running connections, such as batch jobs, that you want balanced by the number of sessions per node for the service. |
-rlbgoal {NONE | SMART_CONN | SERVICE_TIME | THROUGHPUT} | Runtime Load Balancing Goal (for the Load Balancing Advisory). Set this parameter to SMART_CONN to enable Smart Connection Rebalance. Set this parameter to SERVICE_TIME to balance connections by response time. Set this parameter to THROUGHPUT to balance connections by throughput. |
-resetstate {NONE | LEVEL1 | LOGIN} | Specifies the session-state cleanup level for the service.
Use |
-failovertype {NONE | SESSION | SELECT | TRANSACTION | AUTO} | Set the failover type. To enable Application Continuity for Java, set this parameter to To enable TAF for OCI, set this parameter to Note: If you set |
-failovermethod {NONE | BASIC} | TAF failover method (for backward compatibility only). If the failover type ( Note: This parameter can be used only with Oracle RAC. |
-failoverretry failover_retries | For Application Continuity and TAF, this parameter determines the number of attempts to connect after an incident. |
-failoverdelay failover_delay | For Application Continuity and TAF, this parameter specifies the time delay (in seconds) between reconnect attempts per incident at failover. |
-failover_restore {NONE|LEVEL2|LEVEL1|AUTO} | For Application Continuity, when you set the Use
For OCI applications using TAF or Application Continuity, setting |
-template_timeout template_timeout | Specify the time, in seconds, for template timeout. For Application Continuity, You are recommended to set higher values so your pools are able to failover following the overnight maintenance. The default value is If |
-failback {YES | NO} | If a service fails over to an available instance after the list of preferred instances was exhausted, then, if this parameter is set to YES , the service automatically fails back to a preferred instance when one becomes available. |
-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 |
-pdb pluggable_database | The name of the Pluggable Database (PDB). 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 Note: Starting with Oracle Database 21c, before using the |
-global {TRUE | FALSE} | Indicates whether this is a Global Data Services service. Note: This parameter can only be used with Global Data Services. |
-maxlag maximum_lag_time | Maximum replication lag time in seconds for a global service. Must be a non-negative integer. The default value is ANY. You must also specify the -global option. |
-sql_translation_profile profile_name | Use this parameter to specify a SQL translation profile for a service that you are adding after you have migrated applications from a non-Oracle database to an Oracle AI Database. This parameter corresponds to the SQL translation profile parameter in the Notes:
|
-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 | If -commit_outcome is set to TRUE, then this parameter determines the amount of time (in seconds) that the commit outcome is retained in the database. |
-replay_init_time replay_initialization_time | For Application Continuity, this parameter specifies the difference between the time, in seconds, of original processing of the first operation of a request and the time that the replay is ready to start after a successful reconnect. Application Continuity will not replay after the specified amount of time has passed. This parameter is intended to avoid the unintentional processing of a transaction when a system is recovered after a long period. The default is 5 minutes ( 300 ). The maximum value is 24 hours ( 86400 ). If the -failover_type parameter is not set to TRANSACTION, then you cannot use this parameter. |
-session_state { DYNAMIC | AUTO} | For Application Continuity; this parameter describes how the non-transactional session state is changed by the application within a request. Examples of session state are NLS settings, optimizer preferences, event settings, PL/SQL global variables, and temporary tables. For Transparent Application Continuity, you can set This parameter is considered only if
Note: Use
If non-transactional values change after the request starts, then set this parameter to either |
-importfile file_name | Re-create the resources using the resource attributes specified in the file. |
-gsmflags gsm_flags | Set locality and region failover values for a global service. You must also specify the -global option. |
-tablefamilyid table_family_id | Set table family ID for a service. See "Shared Table Family" for more information. |
-drain_timeout timeout | Specify the time, in seconds, allowed for resource draining to be completed. Accepted values are an empty string (""), 0, or any positive integer. The default value is an empty string, which means that this parameter is not set. If it is set to 0, then draining occurs, immediately. The draining period is intended for planned maintenance operations. During the draining period, all current client requests are processed, but new requests are not accepted. When set on the service this value is used when the command line value is not set. Note: If the |
-stopoption {NONE|IMMEDIATE|TRANSACTIONAL} | Specify the default method of stopping the service. When set on the service, this value is used if you do not include the
|
-css_critical {yes | no} | You can add weight to a service by setting this parameter to YES. In the event of a node failure within the cluster, Oracle Clusterware will evict the node with the least amount of weight, ensuring that critical services remain available. |
-update {-preferred new_preferred_instance | -available new_available_instance } | Add a new preferred or available instance to the service configuration. -preferred specifies the name of the instance to add to the list of preferred instances for the service. -available specifies the name of the instance to add to the list of available instances for the service. |
-force | Force the add operation even though a listener is not configured for a network. |
-verbose | Display verbose output. |
Usage Notes
This command does not accept placement parameters for Oracle RAC One Node databases.
Examples
Use the following examples to create your services:
Basic Service
$ srvctl add service -db mydb -service MYSERVICE -preferred inst1 -available inst2
-pdb mypdb -notification TRUE -drain_timeout 300 -stopoption IMMEDIATE -role PRIMARY
Transparent Application Continuity Service
$ srvctl add service -db mydb -service TACSERVICE -pdb mypdb -preferred inst1 -available inst2
-failover_restore AUTO -commit_outcome TRUE -failovertype AUTO -replay_init_time 600 -retention 86400
-notification TRUE -drain_timeout 300 -stopoption IMMEDIATE -role PRIMARY
Application Continuity Service
$ srvctl add service -db mydb -service ACSERVICE -pdb mypdb -preferred inst1 -available inst2
-failover_restore LEVEL1 -commit_outcome TRUE -failovertype TRANSACTION -session_state dynamic
-replay_init_time 600 -retention 86400 -notification TRUE -drain_timeout 300 -stopoption IMMEDIATE -role PRIMARY
TAF Select Plus Service
$ srvctl add service -db mydb -service TAFSERVICE -pdb mypdb -preferred inst1 -available inst2
-failover_restore LEVEL1 -commit_outcome TRUE -failovertype SELECT -notification TRUE -drain_timeout 300
-stopoption TRANSACTIONAL -role PRIMARY
Service Attribute Validation Matrix
The following table describes service attribute dependency for FAILOVER_TYPE and COMMIT_OUTCOME driver attributes.
Table: Service Attribute Dependency Validation
| Parent Attribute | Value | Dependent Attribute | Valid Value |
|---|---|---|---|
failover_type | AUTO | failover_restore | AUTO | LEVEL1 |
failover_type | AUTO | session_state_consistency | AUTO |
failover_type | AUTO | commit_outcome | TRUE |
failover_type | TRANSACTION | failover_restore | LEVEL1 | NONE | LEVEL2 |
failover_type | TRANSACTION | session_state_consistency | DYNAMIC |
failover_type | TRANSACTION | commit_outcome | TRUE |
failover_type | SELECT | failover_restore | LEVEL1 | NONE |
failover_type | SELECT | failover_method | BASIC | NONE |
failover_type | SELECT | commit_outcome | TRUE | FALSE |
failover_type | SESSION | failover_restore | NONE |
failover_type | SESSION | failover_method | BASIC | NONE |
failover_type | SESSION | commit_outcome | FALSE |
failover_type | NONE | failover_restore | NONE |
failover_type | NONE | failover_method | NONE |
failover_type | NONE | commit_outcome | FALSE | TRUE |
commit_outcome | FALSE | commit_outcome_fastpath | FALSE |
commit_outcome | TRUE | commit_outcome_fastpath | TRUE | FALSE |
Related Topics
srvctl config service
Displays the configuration for a service.
Syntax
srvctl config service {-db db_unique_name [-service service_name | -pdb pdb_name [-brief]]
| [-db db_unique_name]} [-exportfile file_name] [-verbose]
Parameters
Table: srvctl config service Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Unique name for the database. |
-service service_name | Optionally, you can specify the name of a service. If you do not use this parameter, then SRVCTL displays the configuration information for all services configured for the database. |
-pdb pdb_name | Name of the PDB for which you want to show configured services. |
-exportfile file_name | Specify the output file to which the resource configuration will be exported in JSON format for backup or resource re-creation purposes. |
-verbose | Displays verbose output. |
Usage Notes
The srvctl config service command shows exactly the string value you specified for the edition using the srvctl add | modify service commands. If you specified the edition in upper case, then srvctl config service displays upper case. If it is surrounded by double quotation marks (""), then the command displays the double quotation marks. Otherwise, the command displays an empty string.
Examples
This command returns information similar to the following for a database:
$ srvctl config service -db crm -service webapps
Service name: webapps
Service is enabled
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
Preferred instances: crm_1
Available instances:
Edition: "my Edition"
Service configuration for administrator-managed Oracle RAC One Node databases displays the one instance as preferred.
srvctl disable service
Disables a service.
Disabling an entire service affects all of the instances, disabling each one. If the entire service is already disabled, then running this command on the entire service returns an error. This means that you cannot always use the entire set of service operations to manipulate the service indicators for each instance.
Syntax
srvctl disable service -db db_unique_name -services "service_name_list"
[-instance instance_name]
Parameters
Table: srvctl disable service Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Specify a unique name for the database for which you want to disable the service. |
-services " service_name_list " | Specify a comma-delimited list of service names enclosed in double quotation marks ( "" ), or a single service name, that you want to disable. |
-instance instance_name | Optionally, you can specify the name of the instance for which you want to disable the service. Notes:
|
Examples
The following example globally disables two services for the CRM database:
$ srvctl disable service -db crm -service "crm,marketing"
The following example disables a service for the CRM database that is running on the CRM1 instance, resulting in the service still being available for the database, but on one less instance:
$ srvctl disable service -db crm -service crm -instance crm1
srvctl enable service
Enables a service for Oracle Clusterware.
Enabling an entire service also affects the enabling of the service over all of the instances by enabling the service on each one. If the entire service is already enabled, then running this command does not affect all of the instances and enable them but, instead, returns an error. Therefore, you cannot always use the entire set of service operations to manipulate the service indicators for each instance.
Syntax
srvctl enable service -db db_unique_name -service "service_name_list"
[-instance instance_name | -node node_name]
Parameters
Table: srvctl enable service Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Specify a unique name for the database for which you want to enable the service. |
-service " service_name_list " | Specify a single service name or a comma-delimited list of service names enclosed in double quotation marks ( "" ) that you want to enable. |
-instance instance_name | Optionally, you can use this parameter to specify the name of the database instance where you want the service to run. Notes:
|
Examples
The following example globally enables a service:
$ srvctl enable service -db crm -service crm
The following example enables a service to use a preferred instance:
$srvctl enable service -db crm -service crm -instance crm1
srvctl modify service
Modifies a service configuration.
Note:
The policy-managed database deployment option is desupported in Oracle AI Database 26ai.
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
Caution:
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.
Syntax and Parameters
Use one of the following forms of the srvctl modify service command, depending on the task you want to perform, 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: srvctl modify service Parameters for Moving a Service
| Parameter | Description |
|---|---|
-db db_unique_name | Specify the unique name for the database. |
-service service_name | Specify a service name. If you do not specify a service name, then SRVCTL moves all services. |
-oldinst old_instance_name | Specify the name of the instance from which you want to move the service. |
-newinst new_instance_name | Specify the name of the instance to which you want to move the service. |
-force | Force the modify operation, stopping the service on some nodes, as necessary. |
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 [-failback {YES|NO}] -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. This command also does not move or otherwise disconnect the service but only modifies the service attributes.
Table: srvctl modify service Parameters for Changing to a Preferred Instance
| Parameter | Description |
|---|---|
-db db_unique_name | Specify the unique name for the database. |
-service service_name | Specify the name of the service you want to modify. |
-available available_inst_name | Specify the name of the available instance you want to change. |
-failback {YES|NO} | If a service fails over to an available instance after the list of preferred instances was exhausted, then, if this parameter is set to YES , then the service automatically fails back to a preferred instance when one becomes available. |
-toprefer | Specify this parameter to change the instance status to preferred. |
-force | Force the modify operation. For planned operations, the user experience is best if using an Oracle Connection Pool with FAN. 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. This command also does not move or otherwise disconnect the service but only modifies the service attributes.
Table: srvctl modify service Parameters for Changing Status of Multiple Instances
| Parameter | Description |
|---|---|
-db db_unique_name | Specify the unique name for the database. |
-service service_name | Specify the name of the service you want to modify. |
-modifyconfig | This parameter directs SRVCTL to use only the instances named for this service (unnamed instances already assigned to the service are removed). |
-preferred " preferred_instance_list " | Specify a comma-delimited list of preferred instances enclosed within double quotation marks (""). |
-available " available_instance_list " | Specify a comma-delimited list of available instances enclosed within double quotation marks (""). |
-force | Force the modify operation. For planned operations, the user experience is best if using an Oracle Connection Pool with FAN. 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
[-true_cache_service true_cache_service_list]
[-cardinality {UNIFORM|SINGLETON|DUPLEX}] [-tafpolicy {BASIC|NONE}]
[-role "[PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]"]
[-policy {AUTOMATIC|MANUAL}] [-notification {TRUE|FALSE}] [-dtp {TRUE|FALSE}]
[-clbgoal {SHORT|LONG}] [-rlbgoal {NONE | SMART_CONN | SERVICE_TIME | THROUGHPUT}]
[-resetstate {NONE | LEVEL1 | LOGIN}] [-failovertype {NONE|SESSION|SELECT|TRANSACTION|AUTO}]
[-failoverretry failover_retries] [-failoverdelay failover_delay]
[-failover_restore [NONE|LEVEL2|LEVEL1|AUTO]] [-template_timeout template_timeout] [-failback {YES|NO}]
[-edition edition_name] [-pdb pluggable_database]
[-sql_translation_profile profile_name] [-commit_outcome {TRUE|FALSE}]
[-retention retention_time] [-replay_init_time replay_initiation_time]
[-session_state {DYNAMIC|AUTO}] [-maxlag max_lag_time]
[-gsmflags gsm_flags] [-tablefamilyid table_family_id]
[-drain_timeout timeout] [-stopoption {NONE|IMMEDIATE|TRANSACTIONAL}]
[-global_override] [-css_critical {YES | NO}] -hubsvc <hub_service>]} [-verbose] [-force]
Table: srvctl modify service Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name for the database. |
-service service_name | The name of the service you want to modify. |
-true_cache_service true_cache_service_list | Specify this parameter to associate a primary service with the True Cache service. |
-cardinality {UNIFORM|SINGLETON|DUPLEX} | The cardinality of the service, which can be one of the following:
Note: This parameter can be used only with Oracle RAC. |
-tafpolicy {BASIC|NONE} | Transparent Application Failover (TAF) policy specification. |
-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 |
-policy {AUTOMATIC|MANUAL} | The service management policy. If If |
-notification {TRUE|FALSE} | Use TRUE to enable Fast Application Notification (FAN) for Oracle Call Interface (OCI) connections. |
-dtp {TRUE|FALSE} | Use Note: This parameter can be used only with Oracle RAC. |
-clbgoal {SHORT|LONG} | Connection Load Balancing Goal. Set to SHORT if using runtime load balancing, or set to LONG for long running connections, such as batch jobs, that you want balanced by the number of sessions per node for the service. |
-rlbgoal {NONE | SMART_CONN | SERVICE_TIME | THROUGHPUT} | Runtime Load Balancing Goal (for the Load Balancing Advisory). Set this parameter to SMART_CONN to enable Smart Connection Rebalance. Set this parameter to SERVICE_TIME to balance connections by response time. Set this parameter to THROUGHPUT to balance connections by throughput. |
-resetstate {NONE | LEVEL1 | LOGIN} | Specifies the session-state cleanup level for the service.
Use |
-failovertype {NONE|SESSION|SELECT|TRANSACTION|AUTO} | Use this parameter to set the failover type. To enable Application Continuity, set this parameter to To enable TAF, set this parameter to |
-template_timeout template_timeout | Specify the time, in seconds, for template timeout. For Application Continuity, If |
-failoverretry failover_retries | For Application Continuity and TAF, specify the number of attempts to connect after an incident. |
-failoverdelay failover_delay | For Application Continuity and TAF, specify the time delay (in seconds) between reconnect attempts per incident at failover. |
-failover_restore {NONE|LEVEL2|LEVEL1|AUTO} | For Application Continuity, when you set the Set this parameter to
For OCI applications using TAF or Application Continuity, setting |
-failback {YES | NO} | If a service fails over to an available instance after the list of preferred instances was exhausted, then, if this parameter is set to YES , the service automatically fails back to a preferred instance when one becomes available. |
-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 |
-pdb pluggable_database | The name of a Pluggable Database (PDB). 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 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 AI Database. If you want to set the SQL translation profile to a NULL value, then you must enter an empty string after the Note: Before using the SQL translation feature, you must migrate all server-side application objects and data to the Oracle AI Database. |
-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 (with the -commit_outcome parameter 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_initiation_time | For Application Continuity; this parameter specifies the time, in seconds, from when the original request started. 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 {DYNAMIC|AUTO} | For Application Continuity; this parameter describes how the non-transactional session state is changed by the application within a request. Examples of session state are NLS settings, optimizer preferences, event settings, PL/SQL global variables, and temporary tables. For Transparent Application Continuity, you can set This parameter is considered only if
Note: Use
Oracle recommends a value of |
-maxlag maximum_lag_time | Maximum replication lag time in seconds for a global service. Must be a non-negative integer. The default value is ANY. You must also specify the -global option. |
-gsmflags gsm_flags | Set locality and region failover values for a global service. You must also specify the -global option. |
-tablefamilyid table_family_id | Set table family ID for a service. See Sharded Table Family for more information. |
-drain_timeout timeout | Specify the time, in seconds, allowed for resource draining to be completed. Accepted values are an empty string (""), 0, or any positive integer. The default value is an empty string, which means that this parameter is not set. If it is set to 0, then draining occurs, immediately. The draining period is intended for planned maintenance operations. During the draining period, all current client requests are processed, but new requests are not accepted. When set on the service this value is used when the command line value is not set. Note: If the |
-stopoption {NONE|IMMEDIATE|TRANSACTIONAL} | Specify the method of stopping the service. If this attribute was previously set for the service, then that value is used as the default value if you do not include the
Note: You must use the |
-global_override | Override value to modify the global service attributes. Use this parameter with the |
-css_critical {yes | no} | You can add weight to a service by setting this parameter to YES. In the event of a node failure within the cluster, Oracle Clusterware will evict the node with the least amount of weight, ensuring that critical services remain available. |
-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 servicecommand 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"
Related Topics
srvctl predict service
Predicts the consequences of service failure.
Syntax
srvctl predict service -db db_unique_name -service service_name [-verbose]
Parameters
Table: srvctl predict service Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Specify the unique name for the database on which the service operates that you want to check. |
-service service_name | Specify a single service name or a comma-delimited list of service names enclosed in double quotation marks ( "" ) that you want to check. |
-verbose | Optionally, you can use this parameter to display detailed output. |
srvctl relocate service
Temporarily relocates the specified service names from one specified instance to another specified instance.
This command works on only one source instance and one target instance at a time, relocating a service or all services from a single source instance to a single target instance.
Syntax
To relocate a service from one instance to another instance or from one node to another node:
srvctl relocate service -db db_unique_name [-service service_name | -pdb pluggable_database]
{-oldinst old_inst_name [-newinst new_inst_name] | -currentnode current_node [-targetnode target_node]}
[-drain_timeout timeout] [-wait {YES | NO}] [-pq] [-force [-noreplay]] [-stopoption stop_option]] [-eval] [-verbose]
Parameters
Table: srvctl relocate service Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name for the database on which the service currently runs. |
-service service_name | The name of the service you want to relocate. If you do not specify any services, then all services that can be relocated, are relocated. Those that cannot be relocated remain in place. |
-pdb pluggable_database | The name of the Pluggable Database in which the service you want to relocate is currently running. |
-oldinst old_inst_name | The name of the instance from which you are relocating the service. |
-newinst new_inst_name | The name of the instance to which you are relocating the service. This parameter is optional. If you do not specify an instance, then Oracle Clusterware chooses a new one. The policy-managed database deployment option is desupported in Oracle AI Database 26ai. |
-currentnode source_node | Name of the node where the service is currently running. |
-targetnode target_node | Name of node where the service is to be relocated. If you do not specify a target node, then Oracle Clusterware chooses a new location. The policy-managed database deployment option is desupported in Oracle AI Database 26ai. |
-drain_timeout timeout | Specify the time, in seconds, allowed for resource draining to be completed. Accepted values are an empty string (""), 0, or any positive integer. The default value is an empty string, which means that this parameter is not set. If it is set to 0, then draining occurs, immediately. The draining period is intended for planned maintenance operations. During the draining period, all current client requests are processed, but new requests are not accepted. When set on the service this value is used when the command line value is not set. Note: If the |
-wait YES | NO | Choose YES to wait until service draining is completed on the node from which you are relocating the service. |
-stopoption option | Specify the method of stopping the service. If this attribute was previously set for the service, then that value is used as the default value if you do not include the
Note: You must use the |
-pq | Performs the action on a parallel query service. |
-force [-noreplay] | Disconnect all sessions during stop or relocate service operations. Optionally, you can specify the |
-eval | Use this parameter to hypothetically evaluate the impact of the command on the system. |
-verbose | Verbose output. |
Example
To temporarily relocate a named service member for the crm service from the database instance crm1 to the database instance crm3:
$ srvctl relocate service -db crm -service crm -oldinst crm1 -newinst crm3
Related Topics
srvctl remove service
Removes the service from Oracle Clusterware management.
Syntax
srvctl remove service -db db_unique_name {-service service_name |
-pdb pdb_name}[-global_override] [-force]
Parameters
Table: srvctl remove service Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | The unique name of the database or Container Database (CDB). |
-service service_name | The name of the service you want to remove. You must specify either the service name or the Pluggable Database (PDB) name. |
-pdb pdb_name | The name of the PDB that offers the service. You must specify either the service name or the PDB name. |
-global_override | Indicates you are modifying global services. SRVCTL ignores this parameter for a non-global service. |
-force | Ignore any dependencies when removing the service. |
Usage Notes
If you use the -pdb option with this command, then SRVCTL removes all service resources for the specified PDB, but does not remove the PDB resource. If you specify the PDB service name using the -service option, then you do not have to also include the -pdb option because the PDB service name is unique within the Container Database (CDB).
Examples
This following example removes the sales service from all instances of the clustered database named crm:
$ srvctl remove service -db crm -service sales
The following example removes the services from the crmeast PDB:
$ srvctl remove service -db crm -pdb crmeast
srvctl start service
Starts a service or multiple services on a database, Pluggable Database (PDB) , or instance.
Syntax
srvctl start service { -node node_list | -db db_unique_name [-node node_list | -instance instance_name]
[-service "service_name_list" | -pdb pluggable_database] [-global_override] [-startoption start_options] [-eval]}
[-role | -all] [-verbose]
Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Specify a unique name for the database. |
-service " service_list " | Specify a service name or a comma-delimited list of service names enclosed in double quotation marks (""). If you do not include this parameter, then SRVCTL starts all of the services for the specified database. Note: All manual service startup must specify the name of the service to be started by the user. |
-role | Start services for the local database role. |
-pdb pluggable_database | Specify the name of a Pluggable Database. Optionally, you can specify either the name of a node or the name of an instance to restrict the starting of services to that particular object on the Pluggable Database. |
-instance instance_name | Specify the name of an instance where the services reside that you want to start. Use this parameter for administrator-managed databases. |
-global_override | Override value to operate on a global service. Use this parameter only with global services; this parameter is ignored if specified for a non-global service. |
-startoption start_options | Specify startup options used when service startup requires starting a database instance. Options include Note: For multi-word startup options, such as |
-role | Start services for the local database role. |
-verbose | Display verbose output. |
Usage Notes
- The
srvctl start servicecommand will fail if you attempt to start a service that is already running. - The
srvctl start servicecommand will fail if you attempt to start a service on an instance, if that service is already running on its maximum number of instances, that is, its number of preferred instances. - The
srvctl start servicewithout the-roleparameter or a list of services, will start all the services configured for the database, regardless of the actual database role. - You can move a service or change the status of a service on an instance with the
srvctl modify serviceandsrvctl relocate servicecommands.
Examples
The following example starts all services on a specific database:
$ srvctl start service -db myDB
The following examples start a list of services (optionally restricted to a parallel query services in the latter example) regardless of the Pluggable Database on which they may reside:
$ srvctl start service -db myDB -service "myServ01,myServ02"
$ srvctl start service -db myDB -service "myServ01,myServ02" -pq
The following examples start all services on a given Pluggable Database, optionally restricted to a single node or a single instance in the latter two examples, repectively:
$ srvctl start service -db myDB -pdb myPDB1
$ srvctl start service -db myDB -pdb myPDB1 -node myRACNode01
$ srvctl start service -db myDB -pdb myPDB1 -instance myDB01
The following example starts all services, for a given database, on a given instance (for all Pluggable Databases):
$ srvctl start service -db myDB -instance myDB01
The following example start all services for a given database on a given node (for all Pluggable Databases):
$ srvctl start service -db myDB -node myRACNode01
The following examples start a list of services on a given node or given instance:
$ srvctl start service -db myDB -service "myService01,myService02" -node myRACNode01
$ srvctl start service -db myDB -service "myService01,myService02" -instance myDB01
srvctl status service
Displays the status of a service.
For Oracle RAC One Node databases, if there is an online database relocation in process, then this command displays the source and destination nodes and the status of the relocation, whether it is active or failed.
Syntax
srvctl status service {-db db_unique_name [-service "service_name_list" | -pdb pdb_name]
| [-db db_unique_name]} [-force] [-verbose]
Parameters
Optionally, you can use this parameter to include disabled applications.
Table: srvctl status service Command Parameters
| Parameter | Description |
|---|---|
-db db_unique_name | Specify the unique name of the database on which the service operates for which you want to check the status. |
-pdb pdb_name | Specify the name of the PDB on which the service operates for which you want to check the status. |
-service " service_name_list " | Optionally, you can specify a comma-delimited list of service names for which you want to check status. If you do not use this parameter, then SRVCTL lists the status of all services for the specified database. |
-force | Optionally, you can use this parameter to include disabled applications. |
-verbose | Optionally, you can use this parameter to display detailed output. |
srvctl stop service
Stops one or more services globally across the cluster database, or on the specified instance.
Syntax
To stop services for a particular node in the cluster:
srvctl stop service -node node_list [-stopoption IMMEDIATE|TRANSACTIONAL|NONE]
[-drain_timeout timeout] [-wait {YES | NO}] [-force] [-noreplay] [-global_override] [-verbose]
To stop services for a database:
srvctl stop service -db db_unique_name [-pdb pluggable_database |
-service "service_list" [-eval]] [-node node_list | -instance instance_name] [-relocate]
[-stopoption IMMEDIATE|TRANSACTIONAL|NONE] [-drain_timeout timeout] [-wait {YES | NO}] [-force] [-noreplay]
[-global_override] [-verbose]
Parameters
Note:
The policy-managed database deployment option is desupported in Oracle AI Database 26ai.
Table: srvctl stop service Command Parameters
| Parameter | Description |
|---|---|
-node node_list | Optionally, you can specify a comma-separated list of node names. Use this parameter without the -db parameter to stop all services on the specified nodes. If you use the -db parameter, then only the services on the specified nodes for that database are stopped. |
-db db_unique_name | Specify a unique name for the database. |
-pdb pluggable_database | Alternatively, use this parameter to stop services running on a specific Pluggable Database. |
-service " service_list " | Specify a particular service or a comma-delimited list of service names enclosed in double quotation marks ( If you do not provide a service name list, then SRVCTL stops all services on the database or on a specific instance. |
-instance instance_name | Optionally, you can specify the name of the instance for which you want to stop services. |
-eval | Use this parameter to hypothetically evaluate the impact of the command on the system. |
-stopoption IMMEDIATE|TRANSACTIONAL|NONE | Specify the method of stopping the service. If this attribute was previously set for the service, then that value is used as the default value if you do not include the
Note: You must use the |
-drain_timeout timeout | Specify the time, in seconds, allowed for resource draining to be completed. Accepted values are an empty string (""), 0, or any positive integer. The default value is an empty string, which means that this parameter is not set. If it is set to 0, then draining occurs, immediately. The draining period is intended for planned maintenance operations. During the draining period, all current client requests are processed, but new requests are not accepted. When set on the service this value is used when the command line value is not set. Note: If the |
-wait {YES | NO} | Choose YES to wait until service draining is completed on the node to stop the service. |
-force [-noreplay] | Force SRVCTL to stop the service; this causes SRVCTL to disconnect all of the sessions using the stop option you specify ( Notes:
|
-global_override | Override value to operate on a global service. SRVCTL ignores this parameter if the service is not a global service. |
-verbose | Use this parameter to display verbose output. |
Examples
The following example command stops services running on the crmeast PDB in the crm database on instance crm1 using the IMMEDIATE method, allowing 60 seconds for services to transfer to another node:
$ srvctl stop service -db crm -pdb crmeast -instance crm1 -drain_timeout 60 -force
- stopoption immediate -verbose
The following example command stops all services running on the node node1 that are managed by Oracle Clusterware using the default stop option specified for each service and waiting until all sessions have drained from that node.
$ srvctl stop service -node node1 -wait yes