Oracle® Real Application Clusters Administration and Deployment Guide 11g Release 1 (11.1) Part Number B28254-01 |
|
|
View PDF |
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
See Also:
Your platform-specific Oracle Real Application Clusters installation guide for information about using Database Configuration Assistant (DBCA)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
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 the 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, issue SRVCTL
commands from the Oracle home of the database or object you are managing.
Always issue SRVCTL
commands from the Oracle home of the database (or object) that you are administering. You must issue 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.
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 runningSRVCTL
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
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
is the command to start the SRVCTL
utility.
command
is a verb such as start
, stop
, or remove
.
object
is an object or target on which SRVCTL
performs the command, such as database
or instance
. You can also use object abbreviations.
options
extend the use of a preceding command combination to include additional parameters for the command. For example, the -i
option indicates that a comma-delimited list of preferred instance names follows; sometimes the -i
option only permits one value and not a list of names. The -n
option indicates that a node name or a comma-delimited list of node names follows.
Note:
Enclose comma-delimited lists in double-quote ("...,..." ) symbols.The database configuration tasks are:
Add, modify, and delete cluster database configuration information.
Add an instance or a service to, and delete an instance or service from the configuration of a cluster database.
Move instances and services in a cluster database configuration and modify service configurations.
Set and unset the environment for an instance or service in a cluster database configuration.
Set and unset the environment for an entire cluster database in a cluster database configuration.
The node-level tasks are:
Setting and unsetting the environment for node-level applications.
Administering node applications.
Administering ASM instances.
Starting and stopping a group of programs that includes virtual IP addresses, listeners, and Oracle Notification Services.
See Also:
Oracle Clusterware Administration and Deployment Guide for information about Oracle Clusterware node applications (nodeapps)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.
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 |
---|---|
|
Adds the node applications, database, database instance, ASM instance, or service. |
|
Removes the node applications, database, database instance, ASM instance, or service. |
|
Lists the configuration for the node applications, database, ASM instance, or service. |
|
Enables the database, database instance, ASM instance, or service. |
|
Disables the database, database instance, ASM instance, or service. |
|
Starts the node applications, database, database instance, ASM instance, or service. |
|
Stops the node applications, database, database instance, ASM instance, or service. |
|
Modifies the node applications, database, database instance, or service configuration. |
|
Relocates the service from one instance to another. |
|
Obtains the status of the node applications, database, database instance, ASM instance, or service. |
|
Displays the environment variable in the configuration for the node applications, database, database instance, or service. |
|
Sets and unsets the environment variable in the configuration for the node applications, database, database instance, or service. |
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 |
---|---|---|
|
To add, configure, enable, start, obtain the status of, stop, disable, and remove ASM instances. |
|
|
To add, configure, modify, manage environment variables for, enable, start, obtain the status of, stop, disable, and remove databases. |
|
|
To add, configure, modify, manage environment variables for, enable, start, obtain the status of, stop, and remove database instances. |
|
|
To add, configure, modify, start, stop, and remove listeners. |
|
no abbreviation |
To add, configure, modify, manage environment variables for, start, obtain the status of, stop, and remove node applications. |
|
|
To add, configure, modify, manage environment variables for, enable, start, obtain the status of, relocate, disable, stop, and remove services from your cluster database. |
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 |
---|---|
Adds a database and configuration. |
|
Adds one or more instances and configurations. |
|
Adds services. |
|
Adds node applications. |
|
Adds ASM instances. |
|
|
Adds a listener to the node. |
Adds a database configuration to your cluster database configuration.
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 |
---|---|
|
Unique name for the database. |
|
The Oracle home for the database. |
|
The Domain for the database. |
|
The server parameter file for the database. |
|
The database cluster alias ( |
|
The role of the database (primary, physical standby, snapshot standby, or logical standby). |
|
Startup options for the database. |
|
The name of the database, where it is different from the unique name given by the |
|
Management policy for the database, either |
Adds a configuration for an instance to your cluster database configuration.
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.
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 |
---|---|
|
Unique name for the database. |
|
The service name. |
|
The list of preferred instances. |
|
The list of available instances |
|
The TAF policy ( |
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 |
---|---|
|
Unique name for the database. |
|
The service name. |
|
Update a new instance-to-service configuration. |
|
Name of the new preferred instance. |
|
Name of new available instance. |
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
Adds a node application configuration to the specified node.
Note:
On Linux and UNIX systems, you must be logged in asroot
and on Windows, you must be logged in as a user with Administrator privileges to run this command.Adds a record for an ASM instance to the specified node.
The srvctl
config
command displays the configuration stored in the OCR.
Table A-11 srvctl config Summary
Command | Description |
---|---|
Displays the configuration information of the cluster database. |
|
Displays the configuration information for the services. |
|
Displays the configuration information for the node applications. |
|
|
Displays the configuration for the ASM instances on the node. |
|
Displays a list of configured listeners that are registered with Oracle Clusterware on a given node. |
Displays the configuration for an Oracle RAC database or lists all configured databases.
Displays the configuration for a service.
Displays the configuration for node applications.
Displays the configuration for the ASM instances.
Displays a list of configured listeners that are registered with Oracle Clusterware on a given node.
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 |
---|---|
Enables the database. |
|
Enables the instance. |
|
Enables a service. |
|
Enables an ASM instance. |
Enables the Oracle Clusterware resources for a database and enables the database's instances if the database was previously disabled.
Enables an instance for Oracle Clusterware. If all instances are disabled, then enabling an instance also enables the database.
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.
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 issue 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 |
---|---|
Disables the cluster database |
|
Disables an instance |
|
Disables a service |
|
Disables an ASM instance |
Disables a cluster database and its instances.
Disables an instance. If the instance that you disable with this command is the last enabled instance, then this operation also disables the database.
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.
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 |
---|---|
Starts the cluster database and its instances |
|
Starts the instance |
|
Starts the service |
|
Starts the node applications |
|
|
Starts ASM instances |
|
Starts the specified listener or listeners. |
Starts a cluster database and its enabled instances.
Starts instances in the cluster database.
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.
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 |
---|---|
|
Unique name for the database |
|
Comma-delimited service names; the service name list is optional and if not provided, the |
|
Instance name |
|
Options to startup command (for example: open, mount, or nomount) |
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
Starts node-level applications on a particular node.
Starts an ASM instance.
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.
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 issue 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 issue astop
command.Table A-29 srvctl stop Summary
Command | Description |
---|---|
Stops the cluster database |
|
Stops the instance |
|
Stops the service |
|
Stops the node-level applications |
|
Stops ASM instances |
|
|
Stops the specified listener or listeners. |
Stops a database, its instances, and its services.
Stops instances and stops all enabled and non-running services that have these instances as either preferred or available instances.
Stops one or more services globally across the cluster database, or on the specified instance.
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 |
---|---|
|
Unique name for the database |
|
Comma-delimited service names; if you do not provide a service name list, then SRVCTL stops all services on the database |
|
Instance name |
|
Force |
Stops node-level applications on a particular node.
Stops an ASM instance.
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.
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 |
---|---|
Modifies the configuration for a database. |
|
Modifies the configuration for an instance. |
|
Modifies the configuration for a service. |
|
|
Modifies the configuration for a node application. |
|
Modifies the listener configuration on a node. |
Modifies the configuration for a database.
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 |
---|---|
|
Unique name for the database. |
|
Name of the database, where it is different from the unique name given by -d option. |
|
Oracle home for cluster database. |
|
Domain for cluster database. |
|
Server parameter file for cluster database. |
|
Role of the database (primary, physical standby, snapshot standby, or logical standby) |
|
Startup options for the database. |
|
Management policy for the database, either |
|
Print usage. |
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.
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.
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 |
---|---|
|
Unique name for the database. |
|
Service name. |
|
Old instance name. |
|
New instance name. |
|
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 |
---|---|
|
Unique name for the database. |
|
Service name. |
|
Instance name. |
|
Upgrade instance to preferred. |
|
Disconnect all sessions during stop or relocate service operations. |
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 |
---|---|
|
Unique name for the database. |
|
Service name. |
|
Uses only the instances named for this service (unnamed instances already assigned to the service are removed). |
|
List of preferred instances. |
|
List of available instances. |
|
Disconnect all sessions during stop or relocate service operations. |
Applies a new Oracle home or virtual IP address to nodeapps.
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.
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-42 srvctl relocate Summary
Command | Description |
---|---|
Relocates the named service names from one named instance to another named instance |
Displays the current state of a named database, instances, services, or node applications.
Table A-44 srvctl status Summary
Command | Description |
---|---|
Obtains the status of a database. |
|
Obtains the status of a instance. |
|
Obtains the status of services. |
|
Obtains the status of node applications. |
|
|
Obtains the status of ASM instances. |
Obtains the status of instances and their services.
Obtains the status of instances.
Obtains the status of a service.
Obtains the status of node applications on a particular node.
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-48 srvctl getenv Summary
Command | Description |
---|---|
Gets the cluster database environment values. |
|
Gets the instance environment values. |
|
Gets the service environment values. |
|
Gets the node application environment values. |
Displays the cluster database environment values.
Gets the values for an instance environment configuration.
Gets the values for a service environment configuration.
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-53 srvctl setenv and unsetenv Summary
Command | Description |
---|---|
Administers cluster database environment configurations |
|
Administers instance environment configurations |
|
Administers service environment configurations |
|
Administers node application environment configurations |
|
Unsets the cluster database environment configuration |
|
Unsets instance environment configurations |
|
Unsets service environment configurations |
|
Unsets node application environment configurations |
Administers cluster database environment configurations.
Administers instance environment configurations.
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-55 srvctl setenv instance Options
Options | Description |
---|---|
|
Unique name for the database. |
|
Instance name. |
|
Names and values of environment variables. |
|
Enables single environment variable to be set to a value that contains commas or other special characters. |
Administers service environment configurations.
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-56 srvctl setenv service Options
Options | Description |
---|---|
|
Unique name for the database. |
|
Service name. |
|
Names and values of environment variables. |
|
Enables single environment variable to be set to a value that contains commas or other special characters. |
Sets the environment variables for the node application configurations.
Unsets the cluster database environment configurations.
Unsets instance environment configurations.
Unsets service environment configurations.
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 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-62 srvctl remove Summary
Command | Description |
---|---|
Removes a database and configuration. |
|
Removes one or more instances and configurations. |
|
Removes services. |
|
Removes node applications. |
|
|
Removes ASM instances |
|
Removes the listener from the specified node. |
Removes a database configuration.
Removes the configurations for an instance.
Removes the configuration for a service.
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.
Removes an ASM instance.