Skip Headers

Oracle® Real Application Clusters Administrator's Guide
10g Release 1 (10.1)

Part Number B10765-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

B Server Control (SRVCTL) Reference

This chapter describes how to administer Oracle Real Application Clusters (RAC) databases and instances using the Server Control (SRVCTL) utility. The topics in this chapter include:

Overview of SRVCTL for Administering Real Application Clusters

The Server Control (SRVCTL) utility is installed on each node by default. You can use SRVCTL to start and stop the database and instances, manage configuration information, and to delete or move instances and services. SRVCTL also manages configuration information.

Some SRVCTL operations store configuration information in the Oracle Cluster Registry (OCR). SRVCTL performs other operations, such as starting and stopping instances, by sending requests to the Cluster Ready Services daemon (CRSD), which then starts or stops the Cluster Ready Services (CRS) resources.

To use SRVCTL, enter the srvctl command and its options in case sensitive syntax as described under the heading "SRVCTL Command Reference".

Guidelines for Using SRVCTL in Real Application Clusters

Guidelines for using SRVCTL are:

  • To use SRVCTL to change your RAC database configuration, log in to the database as the oracle user. Members of the DBA group can start and stop the database.

  • Only use the version of SRVCTL that is provided with Oracle Database 10g on RAC databases that are created or upgraded for Oracle Database 10g.

  • Always use SRVCTL from the ORACLE_HOME of the database that you are administering.

  • SRVCTL does not support concurrent executions of commands on the same object. Therefore, only run one SRVCTL command at a time for each database, service, or other object.

Obtaining Command Line Help for SRVCTL

To see help for all SRVCTL commands, from the command line enter:

srvctl -h

To see the command syntax and a list of options for each SRVCTL command, from the command line enter:

srvctl <command> (or verb) <object> (or noun) -h

To see the SRVCTL version number enter:

srvctl -V

Caution:

Although you may be able to cancel running SRVCTL commands by entering Control-C at the command line, you may corrupt your configuration data by doing this. You are strongly advised not to attempt to terminate SRVCTL in this manner.

SRVCTL Command Syntax and Options

SRVCTL commands, objects, and options are case sensitive. Database, instance, and service names are case insensitive and case preserving. SRVCTL interprets the following command syntax:

srvctl command object [options]

In SRVCTL syntax:

SRVCTL Cluster Database Configuration Tasks

The database configuration tasks are:

SRVCTL General Cluster Database Administration Tasks

The general database administration tasks are:

SRVCTL Node-Level Tasks

The node-level tasks are:

SRVCTL Command Reference

This section presents the SRVCTL command reference:

SRVCTL Commands

This section summarizes the SRVCTL commands, objects, and options. Oracle recommends that you use the DBCA to create your RAC database as well as your initial service configurations. This is because the DBCA configures both the CRS resources and the Net Service entries for each service.

SRVCTL Commands Summary

Table B-1 summary the SRVCTL commands. Execute SRVCTL commands from the command line and specify one or more objects with the appropriate options for the command and its objects.

Table B-1 SRVCTL Commands Summary

Command Description
srvctl add
Adds the node applications, database, database instance, ASM instance, or service.
srvctl remove
Removes the node applications, database, database instance, ASM instance, or service.
srvctl config
Lists the configuration for the node applications, database, ASM instance, or service.
srvctl enable
Enables the database, database instance, ASM instance, or service.
srvctl disable
Disables the database, database instance, ASM instance, or service.
srvctl start
Starts the node applications, database, database instance, ASM instance, or service.
srvctl stop
Stops the node applications, database, database instance, ASM instance, or service.
srvctl modify
Modifies the node applications, database, database instance, or service configuration.
srvctl relocate
Relocates the service from one instance to another.
srvctl status
Obtains the status of the node applications, database, database instance, ASM instance, or service.
srvctl getenv
Displays the environment variable in the configuration for the node applications, database, database instance, or service.
srvctl setenv and unsetenv
Sets and unsets the environment variable in the configuration for the node applications, database, database instance, or service.

SRVCTL Objects Summary

Table B-2 lists the SRVCTL objects for SRVCTL commands. Use the full name or the abbreviation for the purpose described.

Table B-2 SRVCTL Objects (Nouns) and Abbreviations

Object Noun Name Abbreviation Purpose
asm asm To add, configure, enable, start, obtain the status of, stop, disable, and remove ASM instances.
database db To add, configure, modify, manage environment variables for, enable, start, obtain the status of, stop, disable, and remove databases.
instance inst To add, configure, modify, manage environment variables for, enable, start, obtain the status of, stop, and remove database instances.
nodeapps no abbreviation To add, configure, modify, manage environment variables for, start, obtain the status of, stop, and remove node applications.
service serv To add, configure, modify, manage environment variables for, enable, start, obtain the status of, relocate, disable, stop, and remove services from your cluster database.

srvctl add

The SRVCTL add command adds the configuration and the CRS applications to the OCR for the cluster database, named instances, named services, or for the named nodes. To execute srvctl add operations, you must be logged in as the database administrator and be the Oracle account owner on UNIX-based systems, or you must be logged on as a user with Administrator privileges on Windows-based systems.

When adding an instance, the name that you specify with -i must match the ORACLE_SID parameter. The database name given with -d db_unique_name must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME. Also, the domain name given with -m db_domain must match the DB_DOMAIN setting.

Table B-3 srvctl add Summary

Command Description
srvctl add database Adds a database and configuration.
srvctl add instance Adds one or more instances and configurations.
srvctl add service Adds services.
srvctl add nodeapps Adds node applications.
srvctl add asm Adds ASM instances.

srvctl add database

Adds a database configuration to your cluster database configuration.

Syntax and Options

Use the srvctl add database command with the following syntax:

srvctl add database -d <db_unique_name -o <oracle_home> [-m <domain_name>] [-p
<spfile>] [-A <addr_str>] [-r {PRIMARY |
PHYSICAL_STANDBY | LOGICAL_STANDBY}] [-s <start_options>] [-n <db_name>]

Table B-4 srvctl add database Options

Syntax Description

-d <db_unique_name>

Unique name for the database.

-o <oracle_home>

The Oracle home for the database.

-m <domain_name>

The Domain for the database.

-p <spfile>

The server parameter file for the database.

-A <addr_str>

The database cluster alias (<name|ip>/netmask[/if1[|if2|...]]).

-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY}

The role of the database (primary, physical standby, or logical standby).

-s <start_options>

Startup options for the database.
-n <db_name> The name of the database, where it is different from the unique name given by the -d option.

Example

An example of this command is:

srvctl add database -d crm -o /ora/ora10

srvctl add instance

Adds a configuration for an instance to your cluster database configuration.

Syntax and Options

Use the srvctl add instance command with the following syntax:

srvctl add instance -d <db_unique_name -i <inst_name> -n <node_name>

Table B-5 srvctl add instance Options

Option Description

-d <db_unique_name>

Unique name for the database.

-i <inst_name>

The instance name.

-n <node_name>

The node name.

Examples

Examples of this command are:

srvctl add instance -d crm -i  crm01 -n gm01
srvctl add instance -d crm -i  crm02 -n gm02
srvctl add instance -d crm -i  crm03 -n gm03

srvctl add service

Adds services to a database and assigns them to instances. If you have multiple instances of a cluster database on the same node, then always use only one instance on that node for all of the services that node manages. Also, you can use the srvctl add service command to configure the Transparent Application Failover (TAF) policy for a service.


See Also:

Chapter 4 for more information about TAF policies

Syntax and Options

Use the srvctl add service command with the following syntax:

srvctl add service -d <db_unique_name> -s <service_name> -r <preferred_list>
[-a <available_list>] [-P <TAF_policy>]

Table B-6 srvctl add service Options

Option Description

-d <db_unique_name>

Unique name for the database.

-s <service_name>

The service name.

-r <preferred_list>

The list of preferred instances.

-a <available_list>

The list of available instances

-P <TAF_policy>

The TAF policy (NONE, BASIC, or PRECONNECT).

Use the following syntax to add a new preferred or available instance to the service configuration:

srvctl add service -d <db_unique_name> -s <service_name>  -u [-r <new_preferred_inst> | -a <new_available_inst>]

Table B-7 srvctl add service Options for a New Instance

Option Description

-d <db_unique_name>

Unique name for the database.

-s <service_name>

The service name.

-u

Add a new instance to service configuration

-r <new_preferred_inst>

Name of the new preferred instance.

-a <new_available_inst>

Name of new available instance.

Examples

Use this example syntax to add a named service to a database with preferred instances in list one and available instances in list two, using basic failover for the available instances:

srvctl add  service -d crm -s sales -r crm01,crm02 -a crm03

Use this example syntax to add a named service to a database with preferred instances in list one and available instances in list two, using preconnect failover for the available instances:

srvctl add  service -d crm -s sales -r crm01,crm02 -a crm03 -P Preconnect

srvctl add nodeapps

Adds a node application configuration to the specified node.


Note:

On UNIX-based systems, you must be logged in as root and on Windows-based systems, you must be logged in as a user with Administrator privileges to execute this command.

Syntax and Options

Use the srvctl add nodeapps command with the following syntax:

srvctl add nodeapps -n <node_name -o <oracle_home> -A <addr_str>

Table B-8 srvctl add nodeapps Options

Option Description

-n <node_name>

Node name.

-o <oracle_home>

Oracle home for the cluster database.

-A <addr_str>

The node level VIP address (<name|ip>/netmask[/if1[|if2|...]]).

Example

An example of this is:

srvctl add nodeapps -n crmnode1 -o /ora/ora10 -A 1.2.3.4/255.255.255.0

srvctl add asm

Adds a record for an ASM instance to the specified node.

Syntax and Options

Use the srvctl add asm command with the following syntax:

srvctl add asm -n <node_name -i <asm_instance_name> -o <oracle_home>

Table B-9 srvctl add asm Options

Option Description

-n <node_name>

Node name.

-i <asm_instance_name>

The ASM instance name.
-o <oracle_home> Oracle home for the cluster database.

Example

An example of this is:

srvctl add asm -n crmnode1 -i asm1 -o /ora/ora10

srvctl config

The SRVCTL config command displays the configuration stored in the OCR.

Table B-10 srvctl config Summary

Command Description
srvctl config database Displays the configuration information of the cluster database.
srvctl config service Displays the configuration information for the services.
srvctl config nodeapps Displays the configuration information for the node applications.
srvctl config asm
Displays the configuration for the ASM instances on the node.

srvctl config database

Displays the configuration for a RAC database or lists all configured databases.

Syntax and Options

Use the srvctl config database command with the following syntax:

srvctl config database [-d <db_unique_name [-a] [-t]]

Table B-11 srvctl config database Options

Option Description

-d <db_unique_name>

Unique name for the database

-a

Additional attributes

-t

Display sample TNS entries

Examples

An example of this command to list all database is:

srvctl config database

An example of this command to show sample TNS entries for a specific database is:

srvctl config database -d db_erp

srvctl config service

Displays the configuration for a service.

Syntax and Options

Use the srvctl config service command with the following syntax:

srvctl config service -d <db_unique_name [-s <service_name>] [-a]

Table B-12 srvctl config service Options

Option Description

-d <db_unique_name>

Unique name for the database.

-s <service_name>

Service name.

-a

Additional attributes.

Example

An example of this command is:

srvctl config service -d crm -s crm


Note:

If you do not specify -s <service>, then SRVCTL displays all services for the specified cluster database.

srvctl config nodeapps

Displays the configuration for node applications.

Syntax and Options

Use the srvctl config nodeapps command with the following syntax:

srvctl config nodeapps -n <node_name [-a] [-g] [-s] [-l]

Table B-13 srvctl config nodeapps Option

Option Description

-n <node_name>

Node name.

-a

VIP configuration.

-g

GSD configuration.

-s

ONS configuration.

-l

Listener configuration.

Example

An example of this is:

srvctl config nodeapps -n mynode1

srvctl config asm

Displays the configuration for the ASM instances.

Syntax and Options

Use the srvctl config asm command with the following syntax:

srvctl config asm -n <node_name

The only option available for this command is -n to specify the node name.

Example

An example of this is:

srvctl config asm -n mynode1

srvctl enable

The SRVCTL enable command enables the named object so that it can run under CRS for automatic startup, failover, or restart. The CRS application supporting the object may be up or down to use this function. Enable is the default value. If the object is already enabled, then the command is ignored. Enabled objects can be started, and disabled objects cannot be started.

Table B-14 srvctl enable Summary

Command Description
srvctl enable database Enables the database.
srvctl enable instance Enables the instance.
srvctl enable service Enables a service.
srvctl enable asm Enables an ASM instance.

srvctl enable database

Enables CRS resources for a database and enables the database's instances if the database was previously disabled.

Syntax and Options

Use the srvctl enable database command with the following syntax:

srvctl enable database -d <db_unique_name

The only option available for this command is -d to specify the database name.

Example

An example of this command is:

srvctl enable database -d crm

srvctl enable instance

Enables an instance for CRS. If all instances are disabled, then enabling an instance also enables the database.

Syntax and Options

Use the srvctl enable instance command with the following syntax:

srvctl enable instance -d <db_unique_name -i <inst_name_list>

Table B-15 srvctl enable instance Option

Option Description

-d <db_unique_name>

Unique name for the database

-i <inst_name_list>

Comma-separated list of instance names.

Example

An example of this command is:

srvctl enable instance  -d crm -i crm1,crm2...

srvctl enable service

Enables a service for CRS. Enabling an entire service also affects the enabling of the service over all the instances by enabling the service at each one. When the entire service is already enabled, an srvctl enable service operation does not affect all the instances and enable them. Instead, this operation returns an error. Therefore, you cannot always use the entire set of service operations to manipulate the per-instance service indicators.

Syntax and Options

Use the srvctl enable service command with the following syntax:

srvctl enable service -d <db_unique_name {-s <service_name_list> | -s <service_name> -i <inst_name>}

Table B-16 srvctl enable service Options

Option Description

-d <db_unique_name>

Unique name for the database.

-s <service_name_list>

Comma-separated list of service names.
-s <service_name> Single service name.

-i <inst_name>

Instance name.

Examples

The following example globally enables a service:

srvctl enable service -d crm -s crm

The following example enables a service to use a preferred instance:

srvctl enable service -d crm -s crm -i crm1

srvctl enable asm

Enables an ASM instance.

Syntax and Options

Use the srvctl enable asm command with the following syntax:

srvctl enable asm -n <node_name [-i <asn_inst_name>]

Table B-17 srvctl enable asm Option

Option Description

-n <node_name>

Node name

-i <inst_name>

ASM instance name.

Example

An example of this command is:

srvctl enable asm -n crmnode1 -i asm1

srvctl disable

Disables a specified object (cluster database, database instance, ASM instance, or service). SRVCTL disable is intended to be used when an object is to be repaired or is down for maintenance to prevent inappropriate automatic restarts. When you issue the disable command, the object is disabled and unavailable to run under CRS for automatic startup, failover, or restart. If you specify -i <instance_name, then SRVCTL only disables the service from running on the specified instance.

Table B-18 srvctl disable Summary

Command Description
srvctl disable database Disables the cluster database
srvctl disable instance Disables an instance
srvctl disable service Disables a service
srvctl disable asm Disables an ASM instance

srvctl disable database

Disables a cluster database and its instances.

Syntax and Options

Use the srvctl disable database command with the following syntax:

srvctl disable database -d <db_unique_name

The only option available for this command is -d to specify the database name.

Example

An example of this command is:

srvctl disable database -d mybd1

srvctl disable instance

Disables an instance. If the instance that you disable with this command is the last enabled instance, then this operation also disables the database.

Syntax and Options

Use the srvctl disable instance command with the following syntax:

srvctl disable instance -d <db_unique_name -i <inst_name_list>

Table B-19 srvctl disable instance Options

Option Description

-d <db_unique_name>

Unique name for the database.

-i <inst_name_list>

Comma-separated instance names.

Example

An example of this command is:

srvctl disable instance -d crm -i crm1,crm3

srvctl disable service

Disables a service. Disabling an entire service affects all the instances, disabling each one. When the entire service is already disabled, an srvctl disable service operation on the entire service affect all the instances and disable them; it just returns an error. This means that you cannot always use the entire set of service operations to manipulate the per-instance service indicators.

Syntax and Options

Use the srvctl disable service command with the following syntax:

srvctl disable service -d <db_unique_name {-s <service_name_list> | -s <service_name> -i <inst_name>}

Table B-20 srvctl disable service Options

Option Description

-d <db_unique_name>

Unique name for the database.

-s <service_name_list>

Comma-separated service names.
-s <service_name> Single service name.

-i <inst_name>

Instance name.

Examples

The following example globally disables a service:

srvctl disable service -d crm -s crm,marketing

The following example disables a service running on the preferred named instance and results in running a service on one less instance:

srvctl disable service -d crm -s crm -i crm1

srvctl disable asm

Disables an ASM instance.

Syntax and Options

Use the srvctl disable asm command with the following syntax:

srvctl disable asm -n <node_name [-i <asn_inst_name>]

Table B-21 srvctl disable asm Option

Option Description

-n <node_name>

Node name

-i <inst_name>

ASM instance name.

Example

An example of this command is:

srvctl disable asm -n crmnode1 -i asm1

srvctl start

Starts CRS enabled, non-running applications for the database, all or named instances, all or named service names, or node-level applications. For the start command, and for other operations that use a connect string, if you do not provide a connect string, then SRVCTL uses "/ as sysdba" to perform the operation. To run such operations, the owner of the oracle binary executables must be a member of the OSDBA group, and users running the commands must be in the OSDBA group also.

Table B-22 srvctl start Summary

Command Description
srvctl start database Starts the cluster database and its instances
srvctl start instance Starts the instance
srvctl start service Starts the service
srvctl start nodeapps Starts the node applications
srvctl start asm
Starts ASM instances

srvctl start database

Starts a cluster database and its enabled instances.

Syntax and Options

Use the srvctl start database command with the following syntax:

srvctl start database -d <db_unique_name [-o <start_options>] [-c <connect_str> | -q]

Table B-23 srvctl start database Options

Option Description

-d <db_unique_name>

Unique name for the database.

-o <start_options>

Options for startup command (for example: open, mount, or nomount)

-c <connect_str>

Connect string (default: / as sysdba)

-q

Prompt for user credentials connect string from standard input.


Example

An example of this command is:

srvctl start database -d crm -o open

srvctl start instance

Starts instances in the cluster database.

Syntax and Options

Use the srvctl start instance command with the following syntax:

srvctl start instance -d <db_unique_name -i <inst_name_list> [-o <start_options>] [-c <connect_str> | -q]

Table B-24 srvctl start instance Options

Option Description

-d <db_unique_name>

Unique name for the database.

-i <inst_name_list>

Comma-separated instance names.

-o <start_options>

Options for startup command (for example: open, mount, or nomount).

-c <connect_str>

Connect string (default: / as sysdba).

-q

Prompt for user credentials connect string from standard input.

Example

An example of this command is:

srvctl start instance -d crm -i crm1,crm4

srvctl start service

Starts a service or multiple services on the specified instance. The srvctl start service command 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. You may move a service or change the status of a service on an instance with the srvctl modify service and srvctl relocate service commands described on and respectively.

Syntax and Options

Use the srvctl start service command with the following syntax:

srvctl start service -d <db_unique_name [-s <service_name_list> [-i <inst_name>]]  [-o <start_options>] [-c <connect_str> | -q]

Table B-25 srvctl start service Options

Option Description
-d <db_unique_name> Unique name for the database
-s <service_name_list> Comma-separated service names; the service name list is optional and if not provided, the SRVCTL starts all of the database's services
-i <inst_name> Instance name
-o <start_options> Options to startup command (for example: open, mount, or nomount)
-c <connect_str> Connect string (default: / as sysdba)
-q Query connect string from standard input

Examples

The following example starts named service names. If the instances that support these services, including available instances that the service uses for failover, are not running but are enabled, then they are started:

srvctl start service -d crm -s crm

The following example starts a named service on a specified instance:

srvctl start service -d crm -s crm -i crm2

srvctl start nodeapps

Starts node-level applications on a particular node.

Syntax and Options

Use the srvctl start nodeapps command with the following syntax:

srvctl start nodeapps -n <node_name

The only option available for this command is -n to specify the node name.

Example

An example of this command is:

srvctl start nodeapps -n mynode1

srvctl start asm

Starts an ASM instance.

Syntax and Options

Use the srvctl start asm command with the following syntax:

srvctl start asm -n <node_name [-i <asn_inst_name>] [-o <start_options>]

Table B-26 srvctl start asm Option

Option Description

-n <node_name>

Node name

-i <inst_name>

ASM instance name.
-o <start_options> Options to startup command (for example: open, mount, or nomount)

Examples

An example of this command to start a single ASM instance is:

srvctl start asm -n crmnode1 -i asm1

An example to start all ASM instances on a node is:

srvctl start asm -n crmnode2

srvctl stop

Stops the CRS applications for the database, all or named instances, all or named service names, or node level applications. Only CRS applications that are starting or running are stopped. Objects running outside of CRS are not stopped. Stops node-level applications and all dependent CRS applications on the node.

You should disable an object that you intend to remain stopped after you issue a SRVCTL stop command. Refer to the SRVCTL disable command starting with srvctl disable database.


Note:

If the object is stopped and is not disabled, then it can restart as a result of another planned operation. That is, the object will not restart as a result of a failure. Oracle recommends that you disable an object that should remain stopped after you issue a stop command.

Table B-27 srvctl stop Summary

Command Description
srvctl stop database Stops the cluster database
srvctl stop instance Stops the instance
srvctl stop service Stops the service
srvctl stop nodeapps Stops the node-level applications
srvctl stop asm Stops ASM instances

srvctl stop database

Stops a database, its instances, and its services.

Syntax and Options

Use the srvctl stop database command with the following syntax:

srvctl stop database -d <db_unique_name [-o <stop_options>] [-c <connect_str> | -q]

Table B-28 srvctl stop database Options

Option Description

-d <db_unique_name>

Unique name for the database

-o <stop_options>

shutdown command options (for example: normal, transactional, immediate, or abort)

-c <connect_str>

Connect string (default: / as sysdba)

-q

Prompt for user credentials connect string from standard input

Example

An example of this command is:

srvctl stop database -d crm

srvctl stop instance

Stops instances and stops all enabled and non-running services that have these instances as either preferred or available instances.

Syntax and Options

Use the srvctl stop instance command with the following syntax:

srvctl stop instance -d <db_unique_name -i <inst_name_list> [-o <stop_options>] [-c <connect_str> | -q]

Table B-29 srvctl stop instance Options

Option Description

-d <db_unique_name>

Unique name for the database

-i <inst_name_list>

Comma-separated instance names

-o <stop_options>

Options for shutdown command (for example: normal, transactional, immediate, or abort)

-c <connect_str>

Connect string (default: / as sysdba)

-q

Query connect string from standard input

Example

An example of this command is:

srvctl stop instance -d crm -i crm1

srvctl stop service

Stops one or more services globally across the cluster database, or on the specified instance.

Syntax and Options

Use the srvctl stop service command with the following syntax:

srvctl stop service -d <db_unique_name [-s <service_name_list> [-i <inst_name>]]  [-c <connect_str> | -q] [-f]

Table B-30 srvctl stop service Options

Option Description

-d <db_unique_name>

Unique name for the database

-s <service_name_list>

Comma-separated service names; if you do not provide a service name list, then SRVCTL stops all services on the database

-i <inst>

Instance name

-c <connect_str>

Connect string (default: / as sysdba)

-q

Query connect string from standard input
-f <force> Force SRVCTL to stop the service; this causes SRVCTL to disconnect all the sessions transactionally, causing the sessions using the service to reconnect to another instance

Examples

The following example stops a service globally across a cluster database:

srvctl stop service -d crm -s crm

The following example stops a service on a specified instance:

srvctl stop  service -d crm -s crm -i crm2

srvctl stop nodeapps

Stops node-level applications on a particular node.

Syntax and Options

Use the srvctl stop nodeapps command with the following syntax:

srvctl stop nodeapps -n <node_name

The only option for this command is the -n option, which specifies the node name.

Example

An example of this command is:

srvctl stop nodeapps -n mynode1

srvctl stop asm

Stops an ASM instance.

Syntax and Options

Use the srvctl stop asm command with the following syntax:

srvctl stop asm -n <node_name [-i <inst_name>] [-o <stop_options>]

Table B-31 srvctl stop asm Option

Option Description

-n <node_name>

Node name

-i <inst_name>

ASM instance name.
-o <stop_options> Options for shutdown command (for example: normal, transactional, immediate, or abort)

Example

An example of this command is:

srvctl stop asm -n crmnode1 -i asm1

srvctl modify

Enables you to modify the instance configuration without removing and adding the CRS resources. Using modify preserves the environment in the OCR configuration that would otherwise need to be re-entered. The configuration description is modified in the OCR configuration, and a new CRS profile is generated and registered. The change takes effect when the application is next restarted.

Table B-32 srvctl modify Summary

Command Description
srvctl modify database Modifies the configuration for a database.
srvctl modify instance Modifies the configuration for an instance.
srvctl modify service Modifies the configuration for a service.
srvctl modify nodeapps
Modifies the configuration for a node application.

srvctl modify database

Modifies the configuration for a database.

Syntax and Options

Use the srvctl modify database command with the following syntax:

srvctl modify database -d <db_unique_name [-n <db_name>] [-o <ohome>] [-m <domain_name>] [-p <spfile>] [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY}] [-s <start_options>] 

Table B-33 srvctl modify database Options

Option Description

-d <db_unique_name>

Unique name for the database.

-n <db_name>

Name of the database, where it is different from the unique name given by -d option.

-o <ohome>

Oracle home for cluster database.

-m <domain_name>

Domain for cluster database.

-p <spfile>

Server parameter file for cluster database.
-r <role> [PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY] Role of the database (primary, physical standby, or logical standby)
-s <start_options> Startup options for the database

Example

The following example changes the role of a database to a logical standby:

srvctl modify database -d crm -r logical_standby

srvctl modify instance

Modifies the configuration for a database instance from its current node to another node or changes the dependency between and ASM instance and a database instance.

Syntax and Options

Use the srvctl modify instance command with the following syntax:

srvctl modify instance -d <db_unique_name -i <inst_name> {-n <node_name> | -s <asm_instance_name> | -r}

Table B-34 srvctl modify instance Options

Option Description

-d <db_unique_name>

Unique name for the database.

-i <inst_name>

Database instance name.
-n <node_name> Node name.
-s <asm_instance_name> ASM instance dependency to database instance.
-r Remove ASM instance dependency from database instance.

Examples

An example of this command to relocate a database instance is:

srvctl modify instance -d crm -i crm1 -n my_new_node

The following example of this command establishes a dependency between an ASM instance and a database instance:

srvctl modify instance -d crm -i crm1 -s asm1

srvctl modify service

Moves a service member from one instance to another. Additionally, this command changes which instances are to be the preferred and the available instances for a service. This command supports some online modifications to the service, for example:

  • 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 as described.

  • 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.

As a result 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.


Important:

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 Options

Use the srvctl modify service command with the following syntax:

srvctl modify service -d <db_unique_name -s <service_name> -i <old_inst_name>  -t <new_inst_name> [-f]

Table B-35 srvctl modify service Options for an Available Instance

Option Description

-d <db_unique_name>

Unique name for the database.
-s <service_name> Service name.

-i <old_inst_name>

Old instance name.

-t <new_inst_name>

New instance name.

-f

Disconnect all sessions during stop or relocate service operations.

You can also use the srvctl modify service command to change an available instance to a preferred instance as follows:

srvctl modify service -d <db_unique_name> -s <service_name> -i <avail_inst_name> -r [-f]

Table B-36 srvctl modify service Options for Changing an Available Instance to Preferred

Option Description

-d <db_unique_name>

Unique name for the database.
-s <service_name> Service name.

-i <avail_inst_name>

Instance name.

-r

Upgrade instance to preferred.

-f

Disconnect all sessions during stop or relocate service operations.

Examples

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

srvctl modify service -d crm -s crm -i crm1 -t crm2

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

srvctl modify service -d crm -s crm -i crm1 -r

To change the status of multiple instances, you can use the srvctl modify service command to list which instances are to be the preferred and which are to be the available instances for a service as follows:

srvctl modify service -d <db_unique_name> -s <service_name> -n -i <pref_inst_list> [-a <avail_inst_list>] [-f]

Table B-37 srvctl modify service Options for Changing Instances between Preferred and Available status

Option Description

-d <db_unique_name>

Unique name for the database.
-s <service_name> Service name.
-n Uses only the instances named for this service (unnamed instances already assigned to the service are removed).

-i <avail_inst_name>

List of preferred instances.

-a <avail_inst_list>

List of available instances.

-f

Disconnect all sessions during stop or relocate service operations.

Example

An example of this command to exchange a preferred and available instance is:

srvctl modify service -d crm -s crm -n -i crm1 -a crm2

srvctl modify nodeapps

Applies a new Oracle home or virtual IP address to nodeapps.

Syntax and Options

Use the srvctl modify nodeapps command with the following syntax:

srvctl modify nodeapps -n <node_name [-o <oracle_home>] [-A <new_vip_address>]

Table B-38 srvctl modify nodeapps Option

Option Description

-n <node_name>

Node name.

-o <oracle_home>

Oracle home for the cluster database.

-A <new_vip_address>

The node level VIP address (<name|ip>/netmask[/if1[|if2|...]]).

Example

An example of this is:

srvctl modify nodeapps -n mynode1 -A 100.200.300.40/255.255.255.0

srvctl relocate

Relocates the named service names from one named instance to another named instance. The srvctl relocate command works on only one source instance and one target instance at a time, relocating a service from a single source instance to a single target instance. The target instance must be on the preferred or available list for the service. The relocated service is temporary until you modify the configuration. The srvctl modify command described permanently changes the service configuration.

Table B-39 srvctl relocate Summary

Command Description
srvctl relocate service Relocates the named service names from one named instance to another named instance

srvctl relocate service

Temporarily relocates a service member to run on another instance.

Syntax and Options

Use the srvctl relocate service command with the following syntax:

srvctl relocate service -d <db_unique_name -s <service_name> -i <old_inst_name> -t <new_inst_name> [-f] 

Table B-40 srvctl relocate service Options

Option Description

-d <db_unique_name>

Unique name for the database.
-s <service_name> Service name.

-i <old_inst_name>

Old instance name.

-t <new_inst_name>

New instance name.

-f

Disconnect all sessions during stop or relocate service operations.

Example

To temporarily relocate a named service member from crm1 to crm3:

srvctl relocate service -d crm -s crm -i crm1 -t crm3

srvctl status

Displays the current state of a named database, instances, services, or node applications.

Table B-41 srvctl status Summary

Command Description
srvctl status database Obtains the status of a database.
srvctl status instance Obtains the status of a instance.
srvctl status service Obtains the status of services.
srvctl status nodeapps Obtains the status of node applications.
srvctl status asm
Obtains the status of ASM instances.

srvctl status database

Obtains the status of instances and their services.

Syntax and Options

Use the srvctl status database command with the following syntax:

srvctl status database -d <db_unique_name [-f] [-v]

Table B-42 srvctl status database Options

Option Description

-d <db_unique_name>

Unique name for the database
-f Include disabled applications

-v

Verbose output

Example

An example of this command is:

srvctl status database -d crm -v

srvctl status instance

Obtains the status of instances.

Syntax and Options

Use the srvctl status instance command with the following syntax:

srvctl status instance -d <db_unique_name -i <inst_name_list> [-f] [-v]

Table B-43 srvctl status instance Options

Option Description

-d <db_unique_name>

Unique name for the database
-i <inst_name_list> Comma-separated list of instance names
-f Include disabled applications

-v

Verbose output

Example

An example of this command is:

srvctl status instance -d crm -i crm1,crm2 -v

srvctl status service

Obtains the status of a service.

Syntax and Options

Use the srvctl status service command with the following syntax:

srvctl status service -d <db_unique_name -s <service_name_list> [-f] [-v]

Table B-44 srvctl status service Options

Option Description

-d <db_unique_name>

Unique name for the database
-s <service_name_list> Comma-separated list of service names
-f Include disabled applications

-v

Verbose output

Example

The following example obtains the status of a named service globally across the database:

srvctl status service -d crm -s crm -v

srvctl status nodeapps

Obtains the status of node applications on a particular node.

Syntax and Options

Use the srvctl status nodeapps command with the following syntax:

srvctl status nodeapps -n <node_name

The only option available for this command is -n to specify the node name.

Example

An example of this command to obtain the status of all nodes supporting database applications is:

srvctl status nodeapps -n mynode1

srvctl status asm

Obtains the status of an ASM instance.

Syntax and Options

Use the srvctl status asm command with the following syntax:

srvctl status asm -n <node_name

The only option available for this command is -n to specify the node name.

Example

An example of this command is:

srvctl status asm -n crmnode1

srvctl getenv

Gets and displays values for the environment from the configuration file. Use SRVCTL with the set, get, and unset environment configuration verbs to administer the environment configurations for databases, instances, services, and node applications.

Table B-45 srvctl getenv Summary

Command Description
srvctl getenv database Gets the cluster database environment values.
srvctl getenv instance Gets the instance environment values.
srvctl getenv service Gets the service environment values.
srvctl getenv nodeapps Gets the node application environment values.

srvctl getenv database

Displays the cluster database environment values.

Syntax and Options

Use the srvctl getenv database command with the following syntax:

srvctl getenv database -d <db_unique_name> [-t <name_list>]

Table B-46 srvctl getenv database Options

Options Description
-d <db_unique_name> Unique name for the database
-t <name_list> Names of environment variables

Example

The following example gets the environment configuration for a cluster database:

srvctl getenv database -d crm

srvctl getenv instance

Gets the values for an instance environment configuration.

Syntax and Options

Use the srvctl getenv instance command with the following syntax:

srvctl getenv instance -d <db_unique_name -i <inst_name> [-t <name_list>]

Table B-47 srvctl getenv database Options

Options Description
-d <db_unique_name> Unique name for the database
-i <inst_name> Instance name
-t <name_list> Names of environment variables

Example

The following example sets the environment configuration for an instance:

srvctl getenv instance -d -crm -i instance1

srvctl getenv service

Gets the values for a service environment configuration.

Syntax and Options

Use the srvctl getenv service command with the following syntax:

srvctl getenv service -d <db_unique_name -s <service_name> [-t <name_list>]

Table B-48 srvctl getenv service Options

Options Description
-d <db_unique_name> Unique name for the database
-s <service_name> Service name
-t <name_list> Names of environment variables

Example

The following example lists all environment variables for a service:

srvctl getenv service -d crm -s crm

srvctl getenv nodeapps

Gets the environment variables for the node application configurations.

Syntax and Options

Use the srvctl getenv nodeapps command with the following syntax:

srvctl getenv nodeapps -n <node_name [-t <name_list>]

Table B-49 srvctl getenv nodeapps Options

Options Description
-n <node_name> Node name
-t <name_list> Names of environment variables

Example

The following example lists all environment variables for the node applications:

srvctl getenv nodeapps -n crmnode1

srvctl setenv and unsetenv

The setenv command sets values for the environment in the configuration file. The unsetenv command unsets values for the environment in the configuration file.

Table B-50 srvctl setenv and unsetenv Summary

Command Description
srvctl setenv database Administers cluster database environment configurations
srvctl setenv instance Administers instance environment configurations
srvctl setenv service Administers service environment configurations
srvctl setenv nodeapps Administers node application environment configurations
srvctl unsetenv database Unsets the cluster database environment configuration
srvctl unsetenv instance Unsets instance environment configurations
srvctl unsetenv service Unsets service environment configurations
srvctl unsetenv nodeapps Unsets node application environment configurations

srvctl setenv database

Administers cluster database environment configurations.

Syntax and Options

Use the srvctl setenv database command with the following syntax:

srvctl setenv database -d <db_unique_name> {-t <name>=<val>[,<name>=<val>,...] | -T <name>=<val>} 

Table B-51 srvctl setenv database Options

Options Description

-d <db_unique_name>

Unique name for the database.

-t <name>=<val>,...

Names and values of environment variables.
-T <name>=<val> Enables single environment variable to be set to a value that contains commas or other special characters.

Example

The following example sets the language environment configuration for a cluster database:

srvctl setenv database -d crm -t LANG=en

srvctl setenv instance

Administers instance environment configurations.

Syntax and Options

Use the srvctl setenv instance with the following syntax:

srvctl setenv instance -d <db_unique_name> [-i <inst_name>] {-t <name>=<val>[,<name>=<val>,...] | -T <name>=<val>} 

Table B-52 srvctl setenv instance Options

Options Description

-d <db_unique_name>

Unique name for the database.

-i <inst_name>

Instance name.

-t <name>=<val>,...

Names and values of environment variables.
-T <name>=<val> Enables single environment variable to be set to a value that contains commas or other special characters.

Example

The following example sets the environment configuration for an instance:

srvctl setenv instance -d -crm -i instance1 -t LANG=EN

srvctl setenv service

Administers service environment configurations.

Syntax and Options

Use the srvctl setenv service command with the following syntax:

srvctl setenv service -d <db_unique_name> [-s <service_name>] {-t <name>=<val>[,<name>=<val>,...] | -T <name>=<val>}

Table B-53 srvctl setenv service Options

Options Description

-d <db_unique_name>

Unique name for the database.

-s <service_name>

Service name.

-t <name>=<val>,...

Names and values of environment variables.
-T <name>=<val> Enables single environment variable to be set to a value that contains commas or other special characters.

Example

To set all environment variables for a service:

srvctl setenv service -d crm -s crm -t CLASSPATH=/usr/local/jdk/jre/rt.jar
 

srvctl setenv nodeapps

Sets the environment variables for the node application configurations.

Syntax and Options

Use the srvctl setenv nodeapps command as follows:

srvctl setenv nodeapps -n <node_name> {-t <name>=<val>[,<name>=<val>,...] | -T <name>=<val>} 

Table B-54 srvctl setenv nodeapps Options

Options Description

-n <node_name>

Node name.

-t <name>=<val>,...

Names and values of environment variables.
-T <name>=<val> Enables single environment variable to be set to a value that contains commas or other special characters.

Example

To set an environment variable for a node application:

srvctl setenv nodeapps -n crmnode1 -t CLASSPATH=/usr/local/jdk/jre/rt.jar

srvctl unsetenv database

Unsets the cluster database environment configurations.

Syntax and Options

Use the srvctl unsetenv database command as follows:

srvctl unsetenv database -d <db_unique_name> -t <name_list>

Table B-55 srvctl unsetenv database Options

Options Description

-d <db_unique_name>

Unique name for the database.

-t <name_list>

Names of environment variables.

Example

The following example unsets the environment configuration for a cluster database environment variable:

srvctl unsetenv database -d crm -t CLASSPATH

srvctl unsetenv instance

Unsets instance environment configurations.

Syntax and Options

Use the srvctl unsetenv instance command as follows:

srvctl unsetenv instance -d <db_unique_name> [-i <inst_name>] -t <name_list>


Table B-56 srvctl unsetenv instance Options

Options Description

-d <db_unique_name>

Unique name for the database.

-i <instance_name>

Instance name.

-t <name_list>

Names of environment variables.

Example

The following example unsets the environment configuration for an instance:

srvctl unsetenv instance -d -crm -i instance1 -t CLASSPATH

srvctl unsetenv service

Unsets service environment configurations.

Syntax and Options

Use the srvctl unsetenv service command as follows:

srvctl unsetenv service -d <db_unique_name> [-s <service_name>] -t <name_list>

Table B-57 srvctl unsetenv service Options

Options Description

-d <db_unique_name>

Unique name for the database.

-s <service_name>

Service name.

-t <name_list>

Names of environment variables.

Example

To unset an environment variables for a service:

srvctl unsetenv service -d crm -s crm -t CLASSPATH

srvctl unsetenv nodeapps

Unsets the environment configuration for the node application configurations.

Syntax and Options

Use the srvctl unsetenv nodeapps command as follows:

srvctl unsetenv nodeapps -n <node_name -t <name_list>

Table B-58 srvctl unsetenv nodeapps Options

Options Description

-n <node_name>

Node name.

-t <name>=<val>

Names and values of environment variables.

Example

The following example unsets the environment configuration for a node's node applications:

srvctl unsetenv nodeapps -n crmnode1 -t <name_list>

srvctl remove

Removes the configuration, the CRS applications for the node (including the virtual IP address, the Oracle Enterprise Manager agent, the GSD, and the listeners), the database, named instances, or the named services from the cluster database. Environment settings for the object are also removed. If you do not use the force flag (-f), then Oracle prompts you to confirm whether to proceed. If you use the force (-f) option, then the remove operation proceeds without prompting. To use the remove verb, you must first stop the node applications, database, instance, or service for which you are specifying srvctl remove. Oracle recommends that you perform a disable operation before using this command, but this is not required. You must stop the target object before running the srvctl remove command. The srvctl stop command is described.

Table B-59 srvctl remove Summary

Command Description
srvctl remove database Removes a database and configuration.
srvctl remove instance Removes one or more instances and configurations.
srvctl remove service Removes services.
srvctl remove nodeapps Removes node applications.
srvctl remove asm
Removes ASM instances

srvctl remove database

Removes a database configuration.

Syntax and Options

Use the srvctl remove database command with the following syntax:

srvctl remove database -d <db_unique_name [-f]

Table B-60 srvctl remove database Options

Options Description

-d <db_unique_name>

Unique name for the database.

-f

Force remove.

Example

An example of this command is:

srvctl remove database -d crm

srvctl remove instance

Removes the configurations for an instance.

Syntax and Options

Use the srvctl remove instance command with the following syntax:

srvctl remove instance -d <db_unique_name -i <inst_name> [-f]

Table B-61 srvctl remove instance Options

Options Description

-d <db_unique_name>

Unique name for the database.

-i <inst_name>

Instance name.

-f

Force remove.

Example

An example of this command is:

srvctl remove instance -d crm -i crm01

srvctl remove service

Removes the configuration for a service.

Syntax and Options

Use the srvctl remove service command as follows:

srvctl remove service -d <db_unique_name -s <service_name> [-i <inst_name>] [-f]

Table B-62 srvctl remove service Options

Options Description

-d <db_unique_name>

Unique name for the database.

-s <service_name>

Service name.

-i <inst_name>

Instance name.

-f

Force remove.

Examples

An example of this command is:

srvctl remove service -d crm -s sales

The following example removes the services from specific instances:

srvctl remove service -d crm -s sales -i crm01,crm02 

srvctl remove nodeapps

Removes the node application configuration from the specified node. You must have full administrative privileges to run this command. On UNIX-based systems, you must be logged in as root and on Windows-based systems, you must be logged in as a user with Administrator privileges.

Syntax

Use the srvctl remove nodeapps command as follows:

srvctl remove nodeapps -n <node_name_list [-f]

Table B-63 srvctl remove nodeapps Options

Options Description

-n <node_name_list>

Node name or a comma-separated list of node names.

-f

Force remove.

Example

An example of this command is:

srvctl remove nodeapps -n mynode1,mynode2,mynode3

srvctl remove asm

Removes an ASM instance.

Syntax and Options

Use the srvctl remove asm command with the following syntax:

srvctl remove asm -n <node_name [-i <asn_inst_name>]

Table B-64 srvctl remove asm Option

Option Description

-n <node_name>

Node name

-i <asm_inst_name>

ASM instance name.

Example

An example of this command is:

srvctl remove asm -n crmnode1 -i asm1