Skip Headers
Oracle® Real Application Clusters Administration and Deployment Guide
11g Release 1 (11.1)

B28254-07
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
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

A Server Control Utility Reference

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

Overview of SRVCTL for Oracle Real Application Clusters and Oracle Clusterware

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 move or remove instances and services. You can also use SRVCTL to add 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 Oracle Clusterware process (CRSD), which then starts or stops the Oracle Clusterware 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 Oracle Real Application Clusters

Guidelines for using SRVCTL are:

  • To use SRVCTL to change your Oracle RAC database configuration, log in to the database as the owner of the home that you want to manage.

    For example, if you installed Oracle Database and ASM in separate homes and each one has a different owner, then log in as the database user to manage databases and log in as the ASM user to manage ASM instances. Users who are members of the dba group can start and stop the database.

  • Only use the version of SRVCTL that is provided with Oracle Database 11g on Oracle RAC databases that are created or upgraded for Oracle Database 11g. The version of SRVCTL must be the same as the version of the object (listeners, ASM instances, Oracle RAC databases and their instances, and services) being managed. To ensure the versions are the same release, run SRVCTL commands from the Oracle home of the database or object you are managing.

  • Always run SRVCTL commands from the Oracle home of the database (or object) that you are administering. You must run SRVCTL commands from the bin directory in the Oracle Clusterware home when performing any operation related to node applications (for example, srvctl add nodeapps), and from the respective home of the Oracle Listeners, ASM instances, Oracle RAC databases and their instances, and Services when performing any operation on those objects.

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

See Also:

Oracle Clusterware Administration and Deployment Guide for information about Oracle Clusterware node applications (nodeapps)

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 DBCA to create your Oracle RAC database. This is because DBCA configures both the Oracle Clusterware resources and the Net Service entries for each service.

SRVCTL Commands Summary

Table A-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 A-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 A-2 lists the SRVCTL objects for SRVCTL commands. Use the full name or the abbreviation for the purpose described.

Table A-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.

listener

lsnr

To add, configure, modify, start, stop, and remove listeners.

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 Oracle Clusterware applications to the OCR for the cluster database, named instances, named services, or for the named nodes. To perform srvctl add operations, you must be logged in as the database administrator and be the Oracle account owner on Linux and UNIX systems, or you must be logged on as a user with Administrator privileges on Windows 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 A-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 listener

Adds a listener to the node.


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 | SNAPSHOT_STANDBY}] [-s start_options] 
[-n db_name] - y [ automatic | manual ] 

Table A-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 | SNAPSHOT_STANDBY}

The role of the database (primary, physical standby, snapshot 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.

-y

Management policy for the database, either automatic or manual.


Example

An example of this command is:

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

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 A-5 srvctl add instance Options

Option Description

-d db_unique_name

Unique name for the database

-i inst_name

Instance name

-n node_name

Node name

-p spfile

Server parameter file path

-h

Prints command usage


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.

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 A-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). If you choose PRECONNECT, it creates a service_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 A-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

Update 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 Linux and UNIX systems, you must be logged in as root and on Windows, you must be logged in as a user with Administrator privileges to run 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 A-8 srvctl add nodeapps Options

Option Description

-n node_name

Node name.

-o oracle_home

Oracle Clusterware home for the cluster database.

-A addr_str

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


Example

An example of this command is:

srvctl add nodeapps -n crmnode1 -o /ora/ora11 -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 A-9 srvctl add asm Options

Option Description

-n node_name

Node name.

-i asm_instance_name

The ASM instance name must begin with the + character.

-o oracle_home

Oracle home for the cluster database.


Example

An example of this command is:

srvctl add asm -n crmnode1 -i +asm1 -o /ora/ora11

srvctl add listener

Adds a listener to the node.

Syntax and Options

Use the srvctl add listener command with the following syntax:

srvctl add listener -n node_name -o Oracle_home [-l listener_name]

Table A-10 srvctl add listener Options

Option Description

-n node_name

Node name

-o oracle_home

Oracle home for the cluster database

-l listener_name

Sets the listener name


Example

The following command adds a listener to the node node1:

srvctl add listener -n node1 -i -o /ora/ora11

srvctl config

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

Table A-11 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 listener

Displays a list of configured listeners that are registered with Oracle Clusterware on a given node


srvctl config database

Displays the configuration for an Oracle 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 A-12 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 -t

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 A-13 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 A-14 srvctl config nodeapps Option

Option Description

-n node_name

Node name.

-a

Displays the VIP address configuration.

-g

Displays the GSD configuration.

-s

Displays the ONS configuration.

-l

Displays the listener configuration.


Example

An example of this command 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 command is:

srvctl config asm -n mynode1

srvctl config listener

Displays a list of configured listeners that are registered with Oracle Clusterware on a given node.

Syntax and Options

Use the srvctl config listener command with the following syntax:

srvctl config listener -n node_name

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

Example

An example of this command is:

srvctl config listener -n mynode1

srvctl enable

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

Table A-15 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 the Oracle Clusterware 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 Oracle Clusterware. 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 A-16 srvctl enable instance Option

Option Description

-d db_unique_name

Unique name for the database

-i inst_name_list

Comma-delimited 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 Oracle Clusterware. Enabling an entire service also affects the enabling of the service over all of 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 of 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 service indicators for each instance.

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 A-17 srvctl enable service Options

Option Description

-d db_unique_name

Unique name for the database.

-s service_name_list

Comma-delimited 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 asm_inst_name]

Table A-18 srvctl enable asm Option

Option Description

-n node_name

Node name

-i asm_inst_name

The ASM instance name must begin with the + character


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). The srvctl disable command is intended to be used when an object is to be repaired or is down for maintenance to prevent inappropriate automatic restarts. When you run the disable command, the object is disabled and unavailable to run under Oracle Clusterware 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 A-19 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 A-20 srvctl disable instance Options

Option Description

-d db_unique_name

Unique name for the database.

-i inst_name_list

Comma-delimited 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 of the instances, disabling each one. When the entire service is already disabled, a srvctl disable service operation on the entire service affects all of the instances and disables them; it just 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 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 A-21 srvctl disable service Options

Option Description

-d db_unique_name

Unique name for the database.

-s service_name_list

Comma-delimited service names.

-s service_name

Single service name.

-i inst_name

Instance name.


Examples

The following example globally disables two services:

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 asm_inst_name]

Table A-22 srvctl disable asm Option

Option Description

-n node_name

Node name

-i asm_inst_name

The ASM instance name must begin with the + character


Example

An example of this command is:

srvctl disable asm -n crmnode1 -i +asm1

srvctl start

Starts Oracle Clusterware 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 A-23 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 listener

Starts the specified listener or listeners.


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]

Table A-24 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)


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]

Table A-25 srvctl start instance Options

Option Description

-d db_unique_name

Unique name for the database.

-i inst_name_list

Comma-delimited instance names.

-o start_options

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


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]

Table A-26 srvctl start service Options

Option Description

-d db_unique_name

Unique name for the database

-s service_name_list

Comma-delimited service names; the service name list is optional and if not provided, 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)


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 asm_inst_name] [-o start_options]

Table A-27 srvctl start asm Option

Option Description

-n node_name

Node name

-i asm_inst_name

The ASM instance name must begin with the + character

-o start_options

Options to startup command, for example open, mount, or nomount

-h

Display help


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 start listener

Starts the default listener known as node_name, or starts all of the listeners represented in a given list of listener names, that are registered with Oracle Clusterware on the given node.

Syntax and Options

Use the srvctl start listener command with the following syntax:

srvctl start listener -n node_name [-l listener_name_list]

Table A-28 srvctl start listener Options

Option Description

-n node_name

Node name.

-l listener_name_list

Displays the listener configuration.


Example

An example of this command is:

srvctl start listener -n mynode1

srvctl stop

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

You should disable an object that you intend to remain stopped after you run a srvctl stop command. See 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 run a stop command.

Table A-29 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 listener

Stops the specified listener or listeners.


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]

Table A-30 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)


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]

Table A-31 srvctl stop instance Options

Option Description

-d db_unique_name

Unique name for the database

-i inst_name_list

Comma-delimited instance names

-o stop_options

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


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]]  [-f]

Table A-32 srvctl stop service Options

Option Description

-d db_unique_name

Unique name for the database

-s service_name_list

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

-i inst_name

Instance name

-f force

Force SRVCTL to stop the service; this causes SRVCTL to disconnect all of 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 A-33 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.

-h

Display help.


Example

An example of this command is:

srvctl stop asm -n crmnode1 -i +asm1

srvctl stop listener

Stops the default listener known as node_name, or the listeners represented in a given list of listener names, that are registered with Oracle Clusterware on the given node.

Syntax and Options

Use the srvctl stop listener command with the following syntax:

srvctl stop listener -n node_name [-l listener_name_list]
Example

An example of this command is:

srvctl stop listener -n mynode1

srvctl modify

Enables you to modify the instance configuration without removing and adding Oracle Clusterware 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 Oracle Clusterware profile is generated and registered. The change takes effect when the application is next restarted.

Table A-34 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 asm

Modifies the configuration for ASM.

srvctl modify nodeapps

Modifies the configuration for a node application.

srvctl modify listener

Modifies the listener configuration on a node.


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 oracle_home] 
[-m domain_name] [-p spfile] [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY |
SNAPSHOT_STANDBY}] [-s start_options] [-y {AUTOMATIC | MANUAL}]

Table A-35 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 oracle_home

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 | SNAPSHOT_STANDBY]

Role of the database (primary, physical standby, snapshot standby, or logical standby)

-s start_options

Startup options for the database.

-y

Management policy for the database, either automatic or manual.

-h

Print usage.


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 A-36 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 run 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 A-37 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 A-38 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 instances 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 A-39 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 preferred_inst_list

List of preferred instances.

-a avail_inst_list

List of available instances.

-f

Disconnect all sessions during stop or relocate service operations.


Example

The following command exchanges a preferred and available instance:

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

srvctl modify asm

Obtains the status of node applications on a particular node.

Syntax and Options

Use the srvctl modify asm command with the following syntax:

srvctl modify asm -n node_name -i asm_instance_name [-o Oracle_home] [-p spfile]

Table A-40 srvctl modify asm Options

Option Description

-n node_name

Node name.

-i asm_instance_name

The ASM instance name must begin with the + character.

-o Oracle_home

Oracle home for the cluster database.

-p spfile

Server parameter file path.


Example

An example of this command to modify the configuration of ASM is:

srvctl modify asm -n mynode1 -i +asm1 -o /ora/ora11 -p spfile1

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 A-41 srvctl modify nodeapps Options

Option Description

-n node_name

Node name.

-o clusterware_home

Oracle Clusterware home for node applications such as VIP, ONS, and GSD.

-A new_vip_address

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


Example

An example of this command is:

srvctl modify nodeapps -n mynode1 -A 100.200.300.40/255.255.255.0/eth0

srvctl modify listener

Modifies the default listener configuration known as node_name, or the listeners represented in a given list of listener names, that are registered with Oracle Clusterware on the given node.

Syntax and Options

Use the srvctl modify listener command with the following syntax:

srvctl modify listener -n node_name [-l listener_name_list] -o Oracle_home

Table A-42 srvctl modify listener Options

Option Description

-n node_name

Node name.

-o oracle_home

Oracle home for the cluster database.

-l lsnr, lsnr ...

Comma-separated list of the listeners on the node ([-l lsnr1[lsnr2...]]).


Example

An example of this command is:

srvctl modify listener -n mynode1 -o /ora/ora11

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 A-43 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 A-44 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 A-45 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 A-46 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 A-47 srvctl status instance Options

Option Description

-d db_unique_name

Unique name for the database

-i inst_name_list

Comma-delimited 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 A-48 srvctl status service Options

Option Description

-d db_unique_name

Unique name for the database

-s service_name_list

Comma-delimited 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 A-49 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 A-50 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 A-51 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 A-52 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 A-53 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 A-54 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 A-55 srvctl setenv database Options

Options Description

-d db_unique_name

Unique name for the database.

-t =,...nameval

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 A-56 srvctl setenv instance Options

Options Description

-d db_unique_name

Unique name for the database.

-i inst_name

Instance name.

-t =,...nameval

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 A-57 srvctl setenv service Options

Options Description

-d db_unique_name

Unique name for the database.

-s service_name

Service name.

-t =,...nameval

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=value,...] | -T name=value} 

Table A-58 srvctl setenv nodeapps Options

Options Description

-n node_name

Node name.

-t =,...nameval

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 A-59 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 A-60 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 A-61 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 A-62 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 Oracle Clusterware 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 Database prompts you to confirm whether to proceed. If you use the force (-f) option, then the remove operation proceeds without prompting and continues processing even when it encounters errors. Even when the Oracle Clusterware resources cannot be removed, the OCR configuration is removed, so that the object now appears not to exist, but there are still Oracle Clusterware resources. Use the force flag (-f) option with extreme caution because this could result in an inconsistent OCR.

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 A-63 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 listener

Removes the listener from the specified node.


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 A-64 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 A-65 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 A-66 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 Linux and UNIX systems, you must be logged in as root and on Windows 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 A-67 srvctl remove nodeapps Options

Options Description

-n node_name_list

Node name or a comma-delimited 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 asm_inst_name]

Table A-68 srvctl remove asm Option

Option Description

-n node_name

Node name

-i asm_inst_name

The ASM instance name must begin with the + character


Example

An example of this command is:

srvctl remove asm -n crmnode1 -i +asm1

srvctl remove listener

Removes the listener from the specified node.

Syntax and Options

Use the srvctl remove listener command with the following syntax:

srvctl remove listener -n node_name [-l listener_name]

Table A-69 srvctl remove listener Options

Options Description

-n node_name

Name of the node.

-l listener_name

Name of the listener that you want to remove.


Examples

The following command removes the listener lsnr01 from the node1 node:

srvctl remove listener -n node1 -l lsnr01