A Server Control Utility Reference
Use the Server Control Utility (SRVCTL) to manage Oracle Real Application Clusters (Oracle RAC) configuration information.
Note:
SRVCTL commands specific to Oracle Grid Infrastructure administration operations are documented in Oracle Clusterware Administration and Deployment Guide- SRVCTL Usage Information
SRVCTL is installed on each node in a cluster by default. To use SRVCTL, log in to the operating system of a node and enter the SRVCTL command and its parameters in case-sensitive syntax. - Specifying Command Parameters as Keywords Instead of Single Letters
The use of single letter commands is deprecated. Oracle recommends that you use full command words with SRVCTL. - Character Set and Case Sensitivity of SRVCTL Object Values
SRVCTL interacts with many different types of objects. The character set and name length limitations, and whether the object name is case sensitive, can vary between object types. - Summary of Tasks for Which SRVCTL Is Used
Use SRVCTL to manage databases, instances, cluster databases, cluster database instances, Oracle ASM instances and disk groups, services, listeners, or other clusterware resources. - Using SRVCTL Help
Learn about how to use context sensitive help with SRVCTL commands. - SRVCTL Privileges and Security
To use SRVCTL to change your Oracle RAC database configuration, log in to the operating system as the software owner of the home that you want to manage. - Additional SRVCTL Topics
You can use SRVCTL to manage Oracle-supplied resources, but Oracle strongly advises you to follow the guidelines provided here. - Deprecated SRVCTL Subprograms or Commands
Oracle recommends that you use alternatives for several SRVCTL commands and parameters deprecated with Oracle Database 12c. - SRVCTL Command Reference
Use this comprehensive list of SRVCTL commands to manage Oracle Real Application Clusters (Oracle RAC) environments.
SRVCTL Usage Information
SRVCTL is installed on each node in a cluster by default. To use SRVCTL, log in to the operating system of a node and enter the SRVCTL command and its parameters in case-sensitive syntax.
-
Use the version of SRVCTL that is provided with the current Oracle Database release from the Oracle home of the database that you are managing. The version of SRVCTL must be the same as the version of the object (listeners, Oracle ASM instances, Oracle Database, Oracle Database instances, and Oracle Database services) being managed.
-
SRVCTL does not support concurrent processing of commands on the same object. Therefore, run only one SRVCTL command at a time for each database, service, or other object.
-
When specifying a comma-delimited list as part of a SRVCTL command, there should not be any spaces between the items in the list.
When you specify a comma-delimited list in a Windows environment, you must enclose the list in double quotation marks (
""
). You can enclose a comma-delimited list in double quotation marks in a Linux or UNIX environment but they will be ignored. -
If you are entering a SRVCTL command, and you want to continue the input on a new line, then you can use the operating system continuation character. In Linux, this is the backslash (\) symbol.
-
A SRVCTL command that produces no output is a successful command. Not all SRVCTL commands return a message when it completes, successfully. However, if a SRVCTL command fails, then it always returns an error message.
- SRVCTL returns
0
on success,1
on failure, and2
on warnings. Some commands, such asstart
,stop
,enable
, anddisable
, can return 2 for a warning when the request would not change anything. In other words, the object of the command is already started, already stopped, already disabled, and so on. In warning cases, SRVCTL also prints a message about what was already done. -
You can use the
-eval
parameter with several SRVCTL commands. This parameter, when you use it, enables you to simulate running a command without making any changes to the system. SRVCTL returns output that informs you what will happen if you run a particular command. For example, to know what might happen if you relocate a server:The
-eval
parameter is available with the following commands:-
srvctl add database
-
srvctl add service
-
srvctl modify database
-
srvctl modify service
-
srvctl relocate service
-
srvctl start database
-
srvctl start service
-
srvctl stop database
-
srvctl stop service
-
Parent topic: Server Control Utility Reference
Specifying Command Parameters as Keywords Instead of Single Letters
The use of single letter commands is deprecated. Oracle recommends that you use full command words with SRVCTL.
In releases earlier than Oracle Database 12c, the SRVCTL
command-line interface used single letter parameters. However, single letter parameters impose a limit on the number of unique parameters available for use with SRVCTL commands. SRVCTL command parameters in current Oracle Database releases use full words instead of single letters, such as -multicastport
and -subdomain
.
To support backward compatibility, you can use a mix of single-letter parameters and new keyword parameters. New parameters introduced with keywords can be used with single letter parameters.
Note:
The use of single letter parameters are deprecated. Oracle recommends that you use the keyword parameters, so that you avoid using the same letter to implement different functionality, depending on the command.
You can obtain the single-letter equivalents, where applicable, by adding the -compatible
parameter after the -help
parameter.
Parent topic: Server Control Utility Reference
Character Set and Case Sensitivity of SRVCTL Object Values
SRVCTL interacts with many different types of objects. The character set and name length limitations, and whether the object name is case sensitive, can vary between object types.
Table A-1 String Restrictions for SRVCTL Object Names
Object Type | Character Set Limitations | Case Sensitive? | Maximum Length |
---|---|---|---|
db_domain |
Alpha-numeric characters, underscore (_), and number sign (#) |
No |
128 characters |
db_unique_name |
Alpha-numeric characters, underscore (_), number sign (#), and dollar sign ($); the first 8 characters must be unique because those characters are used to form instance names |
No |
30 characters but the first 12 characters must be unique relative to any other database in the same cluster |
pdb_name |
Alpha-numeric characters and underscore (_); the first character must be an alphabet character |
No |
30 characters |
diskgroup_name |
Naming disk groups have the same limitations as naming other database objects. |
No (all names are converted to uppercase) |
30 characters |
instance_name |
Alphanumeric characters |
Depends on the platform |
15 characters |
listener_name |
Alphanumeric characters |
Depends on the platform |
15 characters |
node_name |
Alphanumeric characters |
No |
15 characters |
scan_name |
The first character must be an alphabetic character |
No |
15 characters |
service_name |
Alphanumeric characters, underscore (_), number sign
(#), period (.), and dollar sign ($); the name cannot begin with a
period, nor contain single quotation marks ( |
No |
250 characters |
volume_name |
Alphanumeric characters; dashes (-) are not allowed and the first character must be an alphabetic character. |
No |
11 characters |
Parent topic: Server Control Utility Reference
Summary of Tasks for Which SRVCTL Is Used
Use SRVCTL to manage databases, instances, cluster databases, cluster database instances, Oracle ASM instances and disk groups, services, listeners, or other clusterware resources.
-
Cluster Database Configuration Tasks
Tasks Commands Add, modify, and delete cluster database configuration information
srvctl add database
srvctl modify database
srvctl remove database
Add an instance to or delete an instance from the configuration of a cluster database
srvctl add instance
srvctl remove instance
Add a service to or delete a service from the configuration of a cluster database
srvctl add service
srvctl remove service
Move instances and services in a cluster database configuration and modify service configurations
srvctl relocate database
srvctl relocate service
srvctl modify instance
srvctl modify service
Set and unset the environment for an instance or service in a cluster database configuration
srvctl modify instance
srvctl modify service
Set and unset the environment for an entire cluster database in a cluster database configuration
srvctl setenv database
srvctl unsetenv database
-
General Cluster Database Administration Tasks
Tasks Commands Start and stop cluster databases
srvctl start database
srvctl stop database
Start and stop cluster database instances
srvctl start instance
srvctl stop instance
Start, stop, and relocate cluster database services
srvctl start service
srvctl stop service
srvctl relocate service
Obtain statuses of cluster databases, cluster database instances, or cluster database services
srvctl status database
srvctl status instance
srvctl status service
-
Node-Level Tasks
Tasks Commands Administering VIPs
srvctl add vip
srvctl config vip
srvctl disable vip
srvctl enable vip
srvctl getenv vip
srvctl modify vip
srvctl relocate vip
srvctl remove vip
srvctl setenv vip
srvctl start vip
srvctl status vip
srvctl stop vip
srvctl unsetenv vip
Administering node applications
srvctl add nodeapps
srvctl disable nodeapps
srvctl enable nodeapps
srvctl getenv nodeapps
srvctl modify nodeapps
srvctl remove nodeapps
srvctl setenv nodeapps
srvctl unsetenv nodeapps
Related Topics
Parent topic: Server Control Utility Reference
Using SRVCTL Help
Learn about how to use context sensitive help with SRVCTL commands.
To see help for all SRVCTL commands, from the command line enter:
srvctl -help
To see the command syntax and a list of parameters for each SRVCTL command, from the command line enter:
srvctl command (or verb) object (or noun) -help
When you request online help for a command using -help
, SRVCTL prints the full words for each parameter. You can obtain the single-letter equivalents, where applicable, by adding the -compatible
parameter after the -help
parameter. For example:
$ srvctl config database -help -compatible
The preceding command prints usage information for the srvctl config database
command, listing all parameters as full words followed by their single-letter equivalents in parentheses, where applicable.
To see the SRVCTL version number enter:
$ srvctl -version
Parent topic: Server Control Utility Reference
SRVCTL Privileges and Security
To use SRVCTL to change your Oracle RAC database configuration, log in to the operating system as the software owner of the home that you want to manage.
For example, if different users installed Oracle Database and the Oracle Grid Infrastructure, then log in as the database software owner (for example, ora_db
) to manage databases and log in as the Oracle Grid Infrastructure software owner (for example, ora_asm
) to manage the Oracle ASM instances.
Users who are members of the OSDBA operating system group can start and stop the database. To stop and start an Oracle ASM instance, you must be a member of the OSASM operating system group.
To create or register objects such as listeners, Oracle Notification Services, and services, you must be logged in to the operating system as the software owner of the Oracle home. The objects you create or register for that Oracle home will run under the user account of the owner of the Oracle home. Databases run as the database installation owner of the home from which they run.
To perform srvctl add
operations on any object, you must be logged in as the Oracle account owner of the home on which the object runs.
For some SRVCTL commands, to run the commands 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. In this appendix, those commands are preceded by the root prompt (#
) in the command examples.
Parent topic: Server Control Utility Reference
Additional SRVCTL Topics
You can use SRVCTL to manage Oracle-supplied resources, but Oracle strongly advises you to follow the guidelines provided here.
-
Use SRVCTL to manage Oracle-supplied resources such as listener, instances, disk groups, and networks, and CRSCTL for managing Oracle Clusterware and its resources.
Caution:
Oracle strongly discourages you from using CRSCTL to directly manipulate Oracle-supplied resources (resources whose names begin with
ora
). Making manual changes to Oracle resources using CRSCTL can adversely affect the cluster configuration. -
Although you may be able to cancel running SRVCTL commands by pressing the Control-C keys, Oracle strongly advises that you do not attempt to do this, because you can corrupt your configuration data by doing this.
Do not to attempt to terminate SRVCTL in this manner.
Parent topic: Server Control Utility Reference
Deprecated SRVCTL Subprograms or Commands
Oracle recommends that you use alternatives for several SRVCTL commands and parameters deprecated with Oracle Database 12c.
- Single Character Parameters Deprecated for all SRVCTL Commands
Single-character parameters were deprecated in Oracle Database 12c. Use the full keyword for each parameter. Refer to the information here to understand how to update scripts using single-character parameters. - Miscellaneous SRVCTL Commands and Parameters
If you have scripts dating from Oracle Database 12.2 or earlier releases, then Oracle recommends that you review the deprecated parameters and update your usage to current forms.
Parent topic: Server Control Utility Reference
Single Character Parameters Deprecated for all SRVCTL Commands
Single-character parameters were deprecated in Oracle Database 12c. Use the full keyword for each parameter. Refer to the information here to understand how to update scripts using single-character parameters.
Oracle recommends that you use the full keyword for each SRVCTL parameter. To support older tools and scripts that still use single-character parameters, the current version of SRVCTL continues to support both single-character parameters and full keyword parameters. However, deprecated functionality can be desupported in a future release.
The command reference topics for SRVCTL show the keywords for each SRVCTL command. The following table lists the deprecated single-character parameters.
Table A-2 Deprecated Single-Character Parameters for SRVCTL Commands
Single Letter | Long Form | Values | Description | Related Commands |
---|---|---|---|---|
A |
address |
{VIP_name | IP}/netmask/ [if1[|if2...]] |
VIP address specification for node applications |
Node applications, VIP, network, Listener, SCAN VIP, and SCAN listener commands |
a |
all |
none |
All resources of that kind |
Common |
a |
diskgroup |
diskgroup_list |
Comma-delimited list of Oracle ASM disk groups |
Database, instance, Oracle ASM, disk group, and file system commands |
a |
detail |
None |
Print detailed configuration information |
Common |
a |
available |
available_list |
A comma-delimited list of available instances |
Service commands |
a |
abort |
None |
Stop failed online relocation |
Relocate database |
a |
viponly |
None |
Display VIP configuration |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
B |
rlbgoal |
{NONE| SERVICE_TIME| THROUGHPUT} |
The runtime load balancing goal of a service |
Service commands |
c |
currentnode |
current_node |
Node name from which to relocate the service |
Service commands |
c |
cardinality |
{UNIFORM| SINGLETON} |
Whether the service should run on every active server (UNIFORM) or only one server (SINGLETON) |
Service commands |
c |
dbtype |
type |
Type of database: Oracle RAC One Node, Oracle RAC, or single instance |
Database, instance, Oracle ASM, disk group, and file system commands |
d |
db or database |
db_unique_name |
Database unique name |
Common |
d |
device |
volume_device |
Volume device path |
Database, instance, Oracle ASM, disk group, and file system commands |
d |
domain |
None |
Display subdomain served by GNS |
OC4J, home, CVU, and GNS commands |
e |
emport |
em_port_number |
Local listen port for Oracle Enterprise Manager |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
e |
failovertype |
{NONE|SESSION BASIC|TRANSACTION} |
The failover type for a service |
Service commands |
e |
server |
server_list |
Candidate server list for Oracle RAC One Node database |
Database, instance, Oracle ASM, disk group, and file system commands |
f |
force |
None |
Force remove |
Common |
g |
diskgroup |
diskgroup_name |
Disk group name |
File system, Diskgroup commands |
h |
help |
None |
None |
Common |
i |
instance |
instance_name instance_list |
Instance name prefix for administrator-managed Oracle RAC One Node database A comma-delimited list of instance names |
Database, instance, Oracle ASM, disk group, and file system commands |
I |
ip |
ip_address |
VIP address on which GNS is to listen |
OC4J, home, CVU, and GNS commands |
i |
oldinst |
instance_name |
The old instance name |
Service commands |
i |
scannumber |
scan_ordinal _number |
Ordinal number of the IP address for the SCAN |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
i |
vip |
vip_name or "vip_name_list" |
VIP names |
Node applications, GNS, VIP, network, listener, SCAN VIP, and SCAN listener commands |
j |
acfspath |
acfs_path_list |
Comma-delimited list of Oracle ACFS paths where the dependency on the database will be set |
Database, instance, Oracle ASM, disk group, and file system commands |
j |
clbgoal |
{SHORT|LONG} |
The connection load balancing goal for a service |
Service commands |
k |
netnum |
network_number |
The network number |
Service commands Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands OC4J, home, CVU, and GNS commands |
l |
list |
|
List all records in GNS |
OC4J, home, CVU, and GNS commands |
l |
listener |
|
The name of a listener |
ASM commands |
l |
loglevel |
log_level |
Specify the level (0-6) of logging that GNS should run with |
OC4J, home, CVU, and GNS commands |
l |
onslocalport |
port_number |
Oracle Notification Service listening port for local client connections |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
l |
role |
service_role |
Comma-delimited list of server roles within double quotation marks ( |
Service commands |
m |
domain |
domain_name |
The domain for the database |
Database, instance, Oracle ASM, disk group, and file system commands |
|
failovermethod |
{NONE|BASIC} |
The failover method of a service |
Service commands |
m |
multicastpost |
|
The port on which the GNS daemon is listening for multicast requests |
OC4J, home, CVU, and GNS commands |
m |
path |
mountpoint_path |
Mountpoint path |
Database, instance, Oracle ASM, disk group, and file system commands |
n |
name |
|
Advertise a name through GNS using the given address |
OC4J, home, CVU, and GNS commands |
n |
node |
node_name |
The name of a specific node |
Common |
n |
nodes |
node_list |
A comma-delimited list of node names |
File system commands |
n |
dbname |
database_name |
The database name (DB_NAME), if different from the unique name specified by the |
Database, instance, Oracle ASM, disk group, and file system commands |
n |
scanname |
scan_name |
Fully-qualified SCAN name (includes the domain) |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
n |
servers |
server_list |
A comma-delimited list of candidate server names |
Service commands |
n |
targetnode |
node_name |
Node name to which to relocate the service |
Service commands |
o |
oraclehome |
oracle_home |
|
Database commands |
p |
endpoints |
[TCP:]port _number[/IPC: key][/NMP:pipe _name][/TCPS: s_port][/SDP: port] |
SCAN listener endpoints |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
p |
port |
|
The port which the GNS daemon uses to communicate with the DNS server |
OC4J, home, CVU, and GNS commands |
p |
rmiport |
port_number |
OC4J RMI port number |
OC4J, home, CVU, and GNS commands |
P |
tafpolicy |
{NONE|BASIC} |
TAF policy specification |
Service commands |
p |
spfile |
spfile_location |
Server parameter file path |
Database, instance, Oracle ASM, disk group, and file system commands |
q |
notification |
{TRUE|FALSE} |
Whether FAN is enabled for OCI connections |
Service commands |
q |
query |
|
Query GNS for the records belonging to a name |
OC4J, home, CVU, and GNS commands |
r |
preferred |
preferred_list |
A comma-delimited list of preferred instances |
Service commands |
r |
onsremoteport |
port_number |
Oracle Notification Service listening port for connections from remote hosts |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
r |
relocate |
|
Relocate the VIP |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
r |
revert |
None |
Remove target node of failed online relocation request from the candidate server list of administrator-managed Oracle RAC One Node database |
Relocate database |
r |
role |
role_type |
Role of the standby database: |
Database, instance, Oracle ASM, disk group, and file system commands |
s |
onsonly |
|
Display Oracle Notification Service daemon configuration |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
s |
skip |
None |
Skip checking the ports |
Listener, SCAN, and SCAN listener. |
s |
statfile |
file_name |
The file path of the |
OC4J, home, CVU, and GNS commands |
s |
status |
|
Display the status of GNS |
OC4J, home, CVU, and GNS commands |
S |
subnet |
subnet/net _mask/[if1[| if2...]] |
Network address specification for a network |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
s |
service |
service_name service_name_list |
The name of a service A comma-delimited list of service names |
Service commands |
s |
startoption |
start_options |
Startup options for the database (mount, open, read only) |
Database, instance, Oracle ASM, disk group, and file system commands |
t |
checkinterval |
time_interval |
Interval in minutes between checks |
OC4J, home, CVU, and GNS commands |
t |
edition |
edition_name |
The initial session edition of a service |
Service commands |
t |
envs |
"name_list" |
A list of environment variables |
Common |
t |
namevals |
"name= value,..." |
Names and values of environment variables |
Common |
T |
nameval |
"name=value" |
Name and value of a single environment variable |
Common |
t |
update |
instance_name |
The new instance name |
Service commands |
t |
remoteservers |
host_name[: port_number] [,host_name[: port_number]...] |
List of remote host name and port number pairs for Oracle Notification Service daemons outside this cluster |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
t |
stopoption |
stop_options |
Stop options for the database ( |
Database, instance, Oracle ASM, disk group, and file system commands |
t |
toversion |
target_version |
Version to which you are downgrading |
Database, instance, Oracle ASM, disk group, and file system commands |
u |
nettype |
network_type |
The network server type, which can be |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
u |
newinst |
None |
Add a new instance to the service configuration |
Service commands |
u |
update |
|
Update SCAN listeners to match the number of SCAN VIPs |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
u |
user |
oracle_user |
Oracle user or other authorized user to mount and unmount file systems |
Database, instance, Oracle ASM, disk group, and file system commands |
v |
verbose |
|
Verbose output |
Common |
v |
volume |
volume_name |
Name of a volume |
Database, instance, Oracle ASM, disk group, and file system commands |
V |
versions |
|
|
Common |
w |
failoverdelay |
number |
Failover delay |
Service commands |
w |
nettype |
network_type |
The network server type, which can be |
Node applications, VIP, network, listener, SCAN VIP, and SCAN listener commands |
w |
timeout |
timeout |
Online relocation timeout in minutes |
Database, instance, Oracle ASM, disk group, and file system commands |
x |
dtp |
{TRUE | FALSE} |
Whether to enable distributed transaction processing |
Service commands |
x |
node |
node_name |
Node name (use this parameter only with noncluster databases) |
Common |
y |
noprompt |
|
Suppress the confirmation prompt |
Common |
y |
policy |
{AUTOMATIC | MANUAL} |
Management policy for the resource |
Database, instance, Oracle ASM, disk group, file system, and service commands |
z |
failoverretry |
number |
Number of failover retries |
Service commands |
z |
rmdepondisk |
|
To remove a database's dependency upon disk groups |
Database, instance, Oracle ASM, disk group, and file system commands |
Parent topic: Deprecated SRVCTL Subprograms or Commands
Miscellaneous SRVCTL Commands and Parameters
If you have scripts dating from Oracle Database 12.2 or earlier releases, then Oracle recommends that you review the deprecated parameters and update your usage to current forms.
The following command parameters were deprecated in Oracle Database 12c:
Table A-3 Deprecated Commands and Parameters for SRVCTL
Command | Deprecated Parameters |
---|---|
srvctl modify asm |
|
srvctl modify instance |
Instead, use the |
srvctl modify gns |
Use the |
srvctl * oc4j |
The |
srvctl add service |
The |
srvctl modify service |
The The |
Parent topic: Deprecated SRVCTL Subprograms or Commands
SRVCTL Command Reference
Use this comprehensive list of SRVCTL commands to manage Oracle Real Application Clusters (Oracle RAC) environments.
- About Using SRVCTL Commands
To be able to use SRVCTL commands to obtain the outcome you require, review these guidelines. - database Commands
Use commands with the database keyword to manage cluster database. - diskgroup Commands
Use commands with thediskgroup
keyword to manage Oracle ASM disk groups. - home Commands
Use commands with thehome
keyword to start, stop, and obtain the status of all clusterware resources related to a Home directory. - instance Commands
Use commands with theinstance
keyword to add, modify, enable, disable, start, stop, obtain the status of, and remove database instances. - listener Commands
Use commands with thelistener
keyword to add, modify, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, and remove listeners. - network Commands
Use commands with thenetwork
keyword to add, modify, list the configuration of, and remove a non-default Network. - nodeapps Commands
Use commands with thenodeapps
keyword to add, modify, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, and remove node applications. - ons Commands
Use commands with theons
keyword to manage only Oracle Notification Service instances for Oracle Restart. - pdb Commands
Use commands with thepdb
keyword to manage the Pluggable Databases (PDBs) in your cluster database. - scan Commands
Use commands with thescan
keyword to add, list the configuration of, modify, enable, disable, start, stop, relocate, obtain the status of, and remove SCAN VIPs. - scan_listener Commands
Use commands with thescan_listener
keyword to add, list the configuration of, modify, enable, disable, start, stop, relocate, obtain the status of, and remove SCAN listeners. - service Commands
Use commands with theservice
keyword to add, modify, list the configuration of, enable, disable, start, stop, obtain the status of, relocate, and remove services. - vip Commands
Use commands with thevip
keyword to add, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, and remove a VIP. - volume Commands
Use commands with thevolume
keyword to list the configuration of, enable, disable, start, stop, obtain the status of, and remove an Oracle ACFS volume.
Parent topic: Server Control Utility Reference
About Using SRVCTL Commands
To be able to use SRVCTL commands to obtain the outcome you require, review these guidelines.
SRVCTL commands, object names, and parameters are case-sensitive. Database, instance, listener, and service names are case insensitive and case preserving. You cannot create listener names that differ only in case, such as LISTENER and listener. SRVCTL uses the following command syntax:
srvctl command object [parameters]
In SRVCTL syntax:
-
command
is a verb, such asstart
,stop
, orremove
-
object
(also known as a noun) is the target or object on which SRVCTL performs the command, such as database or instance. You can also use object abbreviations. -
parameters
extend the use of a preceding command combination to include additional parameters for the command. For example, the-instances
parameter indicates that a comma-delimited list of preferred instance names follows; the-instance
parameter only permits one value and not a list of names. Do not use spaces between the items in a comma-delimited list.
Note:
If specifying a comma-delimited list in Windows, then you must enclose the list within double quotation marks (""
).
The following table lists the keywords that you can use for the object
portion of SRVCTL commands. You can use either the full name or the abbreviation for each object keyword. The Purpose column describes the object and the actions that can be performed on that object.
Table A-4 Object Keywords and Abbreviations
Object | Keyword | Purpose |
---|---|---|
Database |
database |
To add, modify, manage environment variables for, list the configuration of, enable, disable, start, stop, and obtain the status of databases, remove configuration information for or get behavior predictions for a database, and also to convert, upgrade, downgrade, and relocate databases |
Diskgroup |
diskgroup |
To enable, disable, start, stop, obtain the status of, remove, or get behavior predictions for an Oracle ASM disk group |
Home |
home |
To start, stop, or obtain the status of resources running from a particular Oracle home directory |
Instance |
|
To add, modify, enable, disable, start, stop, obtain the status of, update, and remove database instances |
Listener |
|
To add, modify, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, remove, and get behavior predictions for listeners |
Network |
network |
To add, modify, list the configuration of, remove and get behavior predictions for a non-default network resource. Note: The node applications object, and the |
Node applications |
nodeapps |
To add, modify, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, and remove node applications |
Oracle Notification Service |
ons |
To add, configure, enable, start, obtain the status of, stop, disable, and remove Oracle Notification Service instances only for Oracle Restart |
Pluggable Database (PDB) |
pdb |
To add, modify, remove, list the configuration of, enable, disable, start, stop, and obtain the status of PDBs |
Single client access name (SCAN) |
scan |
To add, list the configuration of, modify, enable, disable, start, stop, relocate, remove, obtain the status of, and get behavior predictions for SCAN VIPs |
SCAN listener |
scan_listener |
To add, list the configuration of, modify, enable, disable, start, stop, relocate, obtain the status of, remove, and get behavior predictions for SCAN listeners |
Service |
service |
To add, modify, list the configuration of, enable, disable, start, stop, obtain the status of, relocate, remove, and get behavior predictions for services |
Virtual IP |
vip |
To add, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, remove, and get behavior predictions for a VIP |
Volume |
volume |
To list the configuration of, enable, disable, start, stop, obtain the status of, and remove an Oracle ACFS volume |
Note:
SRVCTL commands specific to Oracle Grid Infrastructure administration operations are documented in CWADD SRVCTL Command ReferenceParent topic: SRVCTL Command Reference
database Commands
Use commands with the database keyword to manage cluster database.
You can add, modify, manage environment variables for, list the configuration of, enable, disable, start, stop, and obtain the status of databases, and also to upgrade, downgrade, and remove database configuration information about databases.
- srvctl add database
Adds a database configuration to Oracle Clusterware. - srvctl config database
Displays the configuration for an Oracle RAC database or lists all configured databases that are registered with Oracle Clusterware. - srvctl convert database
Converts a database either to or from an Oracle RAC One Node database. - srvctl disable database
Disables a running database. - srvctl downgrade database
Downgrades the configuration of a database and its services from its current version to a specific lower version. - srvctl enable database
Enables a cluster database and its instances. - srvctl getenv database
Displays the values for environment variables associated with a database. - srvctl modify database
Modifies the configuration for a database. - srvctl predict database
Predicts the consequences of the failure of a specific database. - srvctl relocate database
Initiates the relocation of an Oracle RAC One Node database from one node to another node. - srvctl remove database
Removes database configurations. - srvctl setenv database
Administers cluster database environment configurations. - srvctl start database
Starts a database and its enabled instances, and all listeners on nodes with database instances. - srvctl status database
This command displays the current state of the of the database. - srvctl stop database
Stops a database, its instances, and its services. - srvctl unsetenv database
Unsets the cluster database environment configurations. - srvctl update database
Updates the specified database to use the new listener endpoints. - srvctl upgrade database
Upgrades the configuration of a database and all of its services to the version of the database home from where this command is run.
Parent topic: SRVCTL Command Reference
srvctl add database
Adds a database configuration to Oracle Clusterware.
Note:
The policy-managed database deployment option is desupported in Oracle Database 23ai.Syntax
srvctl add database -db db_unique_name -oraclehome oracle_home
[-dbtype {RACONENODE | RAC | SINGLE} [-server "server_list"]
[-instance instance_name] [-timeout timeout]] [-domain domain_name]
[-spfile spfile] [-pwfile password_file_path]
[-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY | FAR_SYNC}]
[-startoption start_options] [-stopoption stop_options]
[-startconcurrency start_concurrency] [-stopconcurrency stop_concurrency]
[-dbname db_name] [-policy {AUTOMATIC | MANUAL | NORESTART | USERONLY | RANK}]
[-node node_name] [-diskgroup "disk_group_list"] [-acfspath "acfs_path_list"]
[-css_critical {yes | no}] [-memorytarget memory_target] [-maxmemory max_memory]
[-defaultnetnum network_number] [-verbose]
Parameters
Table A-5 srvctl add database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name of the database. |
-oraclehome oracle_home |
The path for the Oracle database home directory. |
-dbtype {RACONENODE | RAC | SINGLE} |
The type of database you are adding: Oracle RAC One Node, Oracle RAC, or single instance. The default is |
-server server_list |
List of candidate servers for Oracle RAC One Node databases. Oracle Clusterware attempts to start Oracle
RAC One instance in the order in which the servers are
listed. First, it attempts to start the instance on the
first server in the list. If that does not succeed for
any reason, then Oracle Clusterware attempts to start
the instance on the second server defined in the list,
and so on. For example, for a 3-node cluster:
Oracle Clusterware refers to this list every time an instance starts, which can be either a regular start or a start that is triggered by a failure event. |
-instance instance_name |
The instance name prefix for Oracle RAC One Node databases. The default value for this parameter is the first 12 characters of the global unique name of the database. |
-timeout timeout |
The online database relocation timeout, in minutes, for Oracle RAC One Node databases. The default value is |
-domain db_domain |
The domain for the database. Note: You must use this parameter if you set the |
-spfile spfile |
The path name of the database server parameter file. |
-pwfile password_file_path |
The full path to the location of the password file. |
-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY | FAR_SYNC} |
The role of the database in an Oracle Data Guard configuration. The default is |
-startoption start_options |
Startup options for the database, such as Notes:
|
-stopoption stop_options |
Stop options for the database, such as |
-startconcurrency start_concurrency |
Number of instances to be started simultaneously, or 0 to disable this option. |
-stopconcurrency stop_concurrency |
Number of instances to be stopped simultaneously, or 0 to disable this option. |
-dbname db_name |
The name of the database, if it is different from the unique name given by the |
-policy {AUTOMATIC | MANUAL | NORESTART | USERONLY | RANK} |
The management policy for the database.
|
-node node_name |
The node name on which you want to register a noncluster, or single instance, Oracle database. Note: This parameter can be used only with Oracle Clusterware. |
-diskgroup "disk_group_list" |
A comma-delimited list of Oracle Automatic Storage Management (Oracle ASM) disk groups if database uses Oracle ASM storage. |
-acfspath "acfs_path_list" |
A single Oracle Advanced Cluster File System (Oracle
ACFS) path or a comma-delimited list of Oracle ACFS paths enclosed in double quotation marks ( Use this parameter to create dependencies on Oracle ACFS file systems other than Note: This parameter is available only on the platforms on which Oracle ACFS is supported. |
-css_critical {YES | NO} |
You can add weight to a service by setting this parameter to |
-memorytarget memory_target |
The target memory size, in MB, to be allocated for the database. The default is 0. |
-maxmemory max_memory |
The maximum memory size, in MB, to be allocated for the resource. If you specify |
-defaultnetnum network_number |
Specify a network number (an integer) to which services will default in the event you do not specify a network number when you add the service. The number must match the value of the |
Examples
This example shows how to add a database named crm.example.com
in a specific Oracle Home directory.
$ srvctl add database -db crm -oraclehome /u01/oracle/product/23ai/mydb
-domain example.com
Parent topic: database Commands
srvctl config database
Displays the configuration for an Oracle RAC database or lists all configured databases that are registered with Oracle Clusterware.
Syntax
srvctl config database [-db db_unique_name] [-all] [-verbose]
Parameters
Table A-6 srvctl config database Command Parameters
Parameter | Description |
---|---|
|
Unique name for the database. If you do not specify this parameter, then the utility displays the configuration of all database resources. |
|
Print detailed configuration information. |
|
Display verbose output. |
Example
This command returns output similar to the following:
$ srvctl config database -d main4
Database unique name: main
Database name:
Oracle home: /ade/mjkeenan_main4/oracle
Oracle user: mjkeenan
Spfile:
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups:
Mount point paths:
Services: test
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: main41,main42
Configured nodes: mjkeenan_main4_0,mjkeenan_main4_1
CSS critical: no
CPU count: 0
Memory target : 0
Maximum memory: 0
CPU cap: 0
Database is administrator managed
Parent topic: database Commands
srvctl convert database
Converts a database either to or from an Oracle RAC One Node database.
Syntax
Use this command with one of the following syntax models:
srvctl convert database -db db_unique_name -dbtype RACONENODE
[-instance instance_name] [-timeout timeout]
srvctl convert database -db db_unique_name -dbtype RAC [-node node_name]
Parameters
Table A-7 srvctl convert database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name for the database. Note: If you specify a noncluster database, then command returns an error instructing you to first convert the noncluster database to Oracle RAC or Oracle RAC One Node. |
-dbtype RACONENODE | RAC |
Specify the type of database to which you are converting, either Oracle RAC One Node or Oracle RAC. Note: If there is an ongoing or failed online database relocation, then the command returns an error instructing you to first complete or stop the online database relocation and then rerun the command. |
-instance instance_name |
Optionally, you can specify an instance name prefix for Oracle RAC One Node databases. The default value for this parameter is the first 12 characters of the global unique name of the database. Notes:
|
-timeout timeout |
Optionally, you can specify online database relocation timeout, in minutes, for Oracle RAC One Node databases. The default is |
-node node_name |
Optionally, you can specify the name of the node for an administrator-managed Oracle RAC database. The default is the first candidate. Note: If you do not specify a node name or you specify a node name where the database is not running, then the command returns an error instructing you specify the correct node. |
Example
$ srvctl convert database -db myDB -dbtype RACONENODE -instance myDB3
Parent topic: database Commands
srvctl disable database
If the database is a cluster database, then its instances are also disabled.
Syntax
srvctl disable database -db db_unique_name [-node node_name]
Parameters
Table A-8 srvctl disable database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the name of the database you want to disable. |
-node node_name |
Optionally, you can specify a node on which you want to disable the database. Note: You can only use this parameter only with Oracle Clusterware. |
Example
The following example disables the database mydb1
:
$ srvctl disable database -db mydb1
Parent topic: database Commands
srvctl downgrade database
Syntax
srvctl downgrade database -db db_unique_name -oraclehome Oracle_home
-targetversion to_version
Parameters
Table A-9 srvctl downgrade database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database you want to downgrade. |
-oraclehome Oracle_home |
Specify the path to the Oracle home. |
-targetversion to_version |
Specify the database version to which you want to downgrade. |
Parent topic: database Commands
srvctl enable database
Syntax
srvctl enable database -db db_unique_name [-node node_name]
Parameters
Table A-10 srvctl enable database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database you want to enable. |
-node node_name |
Optionally, you can specify the name of the node on which the database resource resides that you want to enable. Note: You can only use this parameter with Oracle Clusterware. |
Example
The following example enables a database named mydb1
:
$ srvctl enable database -db mydb1
Parent topic: database Commands
srvctl getenv database
Syntax
srvctl getenv database -db db_unique_name [-envs "name_list"]
Parameters
Table A-11 srvctl getenv database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database for which you want to display the environment variable values. |
-envs "name_list" |
Optionally, you can specify a comma-delimited list of the names of specific environment variables enclosed in double quotation marks ( If you do not use this parameter, then SRVCTL displays the values of all environment variables associated with the database. |
Example
The following example displays the environment configuration for a database named crm
:
$ srvctl getenv database -db crm
Parent topic: database Commands
srvctl modify database
Modifies the configuration for a database.
Note:
The policy-managed database deployment option is desupported in Oracle Database 23ai.Syntax
srvctl modify database -db db_unique_name [-dbname db_name] [-instance instance_name]
[-oraclehome oracle_home_path] [-localrolling] | [-localrolling_revert] [-user user_name]
[-server "server_list"] [-timeout timeout] [-domain db_domain]
[-spfile spfile] [-pwfile password_file_path]
[-role {PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY}]
[-startoption start_options] [-stopoption stop_options]
[-startconcurrency start_concurrency] [-stopconcurrency stop_concurrency]
[-policy {AUTOMATIC | MANUAL | NORESTART | USERONLY | RANK}]
[{-diskgroup "diskgroup_list" | -nodiskgroup}] [-acfspath "acfs_path_list"]
[-css_critical {YES | NO}] [-memorytarget memory_target] [-maxmemory max_memory]
[-defaultnetnum network_number] [-disabledreason {DECOMMISSIONED}] [-force]
[-verbose]
Parameters
Table A-12 srvctl modify database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Unique name for the database. |
-dbname db_name |
The name of the database, if it is different from the unique name given by the |
-instance instance_name |
Instance name prefix; this parameter is required for administrator-managed Oracle RAC One Node databases. |
-oraclehome oracle_home |
The path for the Oracle database home directory. |
-localrolling |
Creates a new Oracle RAC database instance to enable the local rolling feature. |
-localrolling_revert |
Use this parameter to revert the Oracle RAC local rolling configuration changes. |
-user user_name |
The name of the user who owns the Oracle home directory. Note: If you specify the |
-server server_list |
List of candidate servers for Oracle RAC One Node databases. Oracle Clusterware attempts to start Oracle
RAC One instance in the order in which the servers are
listed. First, it attempts to start the instance on the
first server in the list. If that does not succeed for
any reason, then Oracle Clusterware attempts to start
the instance on the second server defined in the list,
and so on. For example, for a 3-node cluster:
Oracle Clusterware refers to this list every time an instance starts, which can be either a regular start or a start that is triggered by a failure event. |
-timeout timeout |
Online database relocation timeout, in minutes, for Oracle RAC One Node databases. The default is |
-domain db_domain |
The domain for the database. Note: You must use this parameter if you set the |
-spfile spfile |
The path name of the database server parameter file. |
-pwfile password_file_path |
Enter the full path to the location of the password file. |
-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY} |
The role of the database in an Oracle Data Guard configuration. The default is |
-startoption start_options |
Startup options for the database, such as Notes:
|
-stopoption stop_options |
Stop options for the database, such as |
-startconcurrency start_concurrency |
Number of instances to be started simultaneously, or 0 to disable this option. |
-stopconcurrency stop_concurrency |
Number of instances to be stopped simultaneously, or 0 to disable this option. |
-policy {AUTOMATIC | MANUAL | NORESTART | USERONLY | RANK} |
The management policy for the database.
|
-diskgroup "disk_group_list" |
Comma-delimited list of Oracle ASM disk groups if database uses Oracle ASM storage. |
-acfspath "acfs_path_list" |
A single Oracle ACFS path or a comma-delimited list of Oracle ACFS paths enclosed in double quotation marks ( Use this parameter to create dependencies on Oracle ACFS file systems other than Note: This parameter is available only on the platforms on which Oracle ACFS is supported. |
-css_critical {YES | NO} |
You can add weight to a service by setting this parameter to |
-memorytarget memory_target |
Specify the target memory, in MB, to be allocated for the database. The default is 0. |
-maxmemory max_memory |
Specify the maximum memory, in MB, to be allocated for the resource. If you specify |
-defaultnetnum network_number |
Specify a network number to which services will default in the event you do not specify a network number when you add a service. |
-disabledreason {DECOMMISSIONED} |
Marks the database as being decommissioned, which means it cannot be started again and is not being used. This is intended for databases that will be deleted at a future date. |
Usage Notes
-
When using the
srvctl modify database
command, for a running database, if the server list is supplied, then the node where the database is running must be on that list. -
The instance name prefix cannot be modified after running the
srvctl add database
command. -
You cannot change the management policy from
AUTOMATIC
(using the-policy
parameter) for Oracle RAC One Node databases. Any attempt to do so results in an error message.
Examples
The following example changes the role of a database to a logical standby:
$ srvctl modify database -db crm -role logical_standby
The following example directs the racTest
database to use the SYSFILES
, LOGS
, and OLTP
Oracle ASM disk groups:
$ srvctl modify database -db racTest -diskgroup "SYSFILES,LOGS,OLTP"
Related Topics
Parent topic: database Commands
srvctl predict database
Syntax
srvctl predict database -db db_unique_name [-verbose]
Usage Notes
-
Specify the unique name of the database you want to check.
-
Optionally, you can use the
–verbose
parameter to display detailed output.
Parent topic: database Commands
srvctl relocate database
This command also cleans up after a failed relocation, and you can only use it for relocating Oracle RAC One Node databases.
Syntax
Use this command with one of the following syntax models:
To initiate the online relocation of an Oracle RAC One Node database:
srvctl relocate database -db db_unique_name [-node target_node] [-timeout timeout]
[-stopoption NORMAL] [-drain_timeout drain_timeout] [-verbose]
To stop the failed online relocation of an Oracle RAC One Node database:
srvctl relocate database -db db_unique_name -abort [-revert]
[-drain_timeout drain_timeout] [-verbose]
Parameters
Table A-13 srvctl relocate database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database you want to relocate. |
-node target_node |
Optionally, you can specify a target node to which to relocate the Oracle RAC One Node database. Note: You must use this parameter if you are relocating an administrator-managed Oracle RAC One Node database. |
-timeout timeout |
Optionally, you can specify an online database relocation timeout, in minutes, for Oracle RAC One Node databases. The default is |
-stopoption NORMAL |
Use this parameter to override the default shutdown option for a running instance, such as the default of |
–abort |
Use this parameter to stop a failed online database relocation. |
–revert |
Use this parameter to remove the target node of a failed online relocation request from the candidate server list of an administrator-managed Oracle RAC One Node database. |
-drain_timeout timeout |
Specify the time, in seconds, allowed for resource draining to be completed. Accepted values are an empty string (""), 0, or any positive integer. The default value is an empty string, which means that this parameter is not set. If it is set to 0, then draining occurs, immediately. The draining period is intended for planned maintenance operations. During the draining period, all current client requests are processed, but new requests are not accepted. When set on the service this value is used when the command line value is not set. |
–verbose |
Use this parameter to display verbose output. |
Usage Notes
-
If the Oracle RAC One Node database you want to relocate is not running, then the command returns an error.
-
If another online database relocation is active for this Oracle RAC One Node database, then the command returns an error.
- If the
-drain_timeout
value is higher than the-timeout
value, then SRVCTL relocates the services but does not explicitly start or stop the services on the database instances. -
If an online database relocation for this Oracle RAC One Node database has failed and the target nodes are not the same for either relocation, then the command returns an error instructing you to stop the failed online database relocation and then initiate a new one.
-
If an online database relocation for this Oracle RAC One Node database has failed and the target nodes are the same (or you do not specify the target), then the command attempts to relocate the database.
Example
The following example relocates an administrator-managed Oracle RAC One Node database named rac1
to a server called node7
.
$ srvctl relocate database -db rac1 -node node7
Parent topic: database Commands
srvctl remove database
Removes database configurations.
After running this command, ensure that the password file is in the default location if you want to connect to the database as the SYS user with the SYS user's password.
Syntax
srvctl remove database -db db_unique_name [-force] [-noprompt] [-verbose]
Parameters
Table A-14 srvctl remove database Command Parameters
Parameter | Description |
---|---|
-database db_unique_name |
Unique name for the database. |
-force |
Forcibly remove the database and ignore any dependencies. |
-noprompt |
Suppress prompts. |
-verbose |
Display verbose output. |
Example
To remove a database named crm
:
$ srvctl remove database -db crm
Parent topic: database Commands
srvctl setenv database
Syntax
Use this command with one of the following syntax models:
srvctl setenv database -db db_unique_name -envs "name=val[,...]"
srvctl setenv database -db db_unique_name -env "name=val"
Parameters
Table A-15 srvctl setenv database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify a unique name for the database for which you want to set environment variables. |
-envs "name=val[,...]" |
Specify a comma-delimited list of name-value pairs of environment variables enclosed in double quotation marks ( |
-env "name=val" |
Specify a single environment variable that you want to set to a value that contains commas or other special characters enclosed in double quotation marks ( |
Usage Notes
Add additional information about the command here.
Example
The following example sets the language environment variable for a cluster database:
$ srvctl setenv database -db crm -env LANG=en
Parent topic: database Commands
srvctl start database
You can disable listeners that you do not want to start.
Syntax
srvctl start database -db db_unique_name [-eval] [-startoption start_options]
[-startconcurrency number_of_instances] [-node node_name]
Parameters
Table A-16 srvctl start database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database you want to start. |
–eval |
Optionally, use this parameter to hypothetically evaluate the impact of the command on the system. |
-startoption start_options |
Optionally, you can set options for the startup command (for example: Notes:
|
-startconcurrency number_of_instances |
Optionally, you can specify a number of database instances to start simultaneously,
or specify Note: If the value for the-startconcurrency
parameter is greater than the number of total instances, then
this parameter does not have any effect, same as
0 .
|
-node node_name |
Optionally, you can specify the name of a node on which you want to start the database. Notes:
|
Examples
The following example starts the crm
database and sets the startup option to read only:
$ srvctl start database -db crm -startoption "read only"
Parent topic: database Commands
srvctl status database
This command displays the current state of the of the database.
Syntax
srvctl status database {-db db_unique_name {[-sid] [-home]} | -thisversion | -thishome}
[-force] [-detail] [-verbose]
Parameters
Table A-17 srvctl status database Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify a unique name for the database. |
–sid |
Use this parameter to display the SID of the Oracle instance running on this node. |
–home |
Use this parameter to display the Oracle home of the specified database. |
-thisversion |
Use this parameter to display the status of databases that are of the same Oracle product version as SRVCTL. |
-thishome |
Use this parameter to display the status of databases that are configured in this Oracle home. |
-force |
Include disabled applications |
–detail |
Use this parameter to display detailed database status information. |
-verbose |
Displays If the
If the
If the
|
Usage Notes
The output of this command includes information on the Oracle ASM or Oracle ASM IOServer instance for each running instance of the database.
Examples
This command displays output similar to the following:
$ srvctl status database -db db00 -detail
Instance db00_1 is connected to ASM instance +ASM3
Instance db00_2 is connected to ASM I/O server instance +IOS1
Parent topic: database Commands
srvctl stop database
Stops a database, its instances, and its services.
Syntax
srvctl stop database -db db_unique_name [-stopoption stop_options]
[-stopconcurrency number_of_instances] [-drain_timeout timeout] [-eval]
[-force] [-verbose]
Parameters
Table A-18 srvctl stop database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name for the database that you want to stop. |
-stopoption stop_options |
Optionally, you can specify options for the shutdown command, such as |
-stopconcurrency number_of_instances |
Optionally, you can specify a number of database instances to stop
simultaneously, or specify Note: If the value for the-stopconcurrency parameter is greater
than the number of total instances, then this parameter does not have any effect,
same as 0 .
|
-drain_timeout timeout |
Optionally, you can specify the time, in seconds, allowed to complete the resource draining action. By default, this parameter is not set. You can specify 0 or any positive integer. An empty string unsets the parameter. If you specify zero, then the agent will perform the actions related to service draining, immediately. Drain timeout is the maximum time the service waits before exiting (in case of |
-eval |
Optionally, you can use this parameter to hypothetically evaluate the impact of the command on the system. |
-force |
Optionally, you can use this parameter to stop the database, its instances, its services, and any resources that depend on those services. |
—verbose |
Optionally, you can use this parameter to display detailed output. |
Example
The following command example stops a database and includes detailed output:
$ srvctl stop database -db db1 -drain_timeout 50 -verbose
Draining in progress on services svc1,svc2.
Drain complete on services svc1.
Draining in progress on services svc2.
Draining in progress on services svc2.
Drain complete on services svc2.
Parent topic: database Commands
srvctl unsetenv database
Syntax
srvctl unsetenv database -db db_unique_name -envs "name_list"
Parameters
Table A-19 srvctl unsetenv database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database for which you want to unset environment variables. |
-envs "name_list" |
Specify a comma-delimited list of environment variable names enclosed in double quotation marks ( |
Example
The following example unsets two cluster database environment variables:
$ srvctl unsetenv database -db crm -envs "CLASSPATH,LANG"
Parent topic: database Commands
srvctl update database
Updates the specified database to use the new listener endpoints.
Syntax
srvctl update database -db db_unique_name [-startoption start_options [-node node_name]]
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
Specify the unique name of the database you want to update.
Parent topic: database Commands
srvctl upgrade database
Syntax
srvctl upgrade database -db db_unique_name -oraclehome Oracle_home
Parameters
Table A-20 srvctl upgrade database Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database you want to upgrade. |
-oraclehome Oracle_home |
Specify the path to the upgraded |
Parent topic: database Commands
diskgroup Commands
Use commands with the diskgroup
keyword to manage Oracle ASM disk groups.
You can add, modify, list the configuration of, enable, disable, start, stop, obtain the status of, and remove Oracle ASM disk groups.
- srvctl disable diskgroup
Disables a specific disk group on a number of specified nodes. - srvctl enable diskgroup
Enables a specific disk group on a number of specified nodes. - srvctl predict diskgroup
Predicts the consequences of an Oracle ASM disk group failure. - srvctl remove diskgroup
Removes a specific Oracle ASM disk group resource from Oracle Clusterware or Oracle Restart. - srvctl start diskgroup
Starts a specific Oracle ASM disk group resource on a number of specified nodes. - srvctl status diskgroup
Displays the status of a specific disk group on a number of specified nodes. - srvctl stop diskgroup
Stops a specific Oracle ASM disk group resource on a number of specified nodes.
Parent topic: SRVCTL Command Reference
srvctl disable diskgroup
Syntax
srvctl disable diskgroup -diskgroup diskgroup_name [-node "node_list"]
Parameters
Table A-21 srvctl disable diskgroup Command Parameters
Parameter | Description |
---|---|
-diskgroup diskgroup_name |
Specify the name of the Oracle ASM disk group you want to disable. |
-node "node_list" |
Optionally, you can specify a comma-delimited list of node names enclosed in double quotation marks ( Note: You can only use this parameter with Oracle Clusterware. |
Example
The following example disables the Oracle ASM disk group, dgroup1
, on two nodes in a cluster, mynode1
and mynode2
:
$ srvctl disable diskgroup -diskgroup dgroup1 -node "mynode1,mynode2"
Parent topic: diskgroup Commands
srvctl enable diskgroup
Syntax
srvctl enable diskgroup -diskgroup diskgroup_name [-node "node_list"]
Parameters
Table A-22 srvctl enable diskgroup Command Parameters
Parameter | Description |
---|---|
-diskgroup diskgroup_name |
Specify the name of the Oracle ASM disk group you want to enable. |
-node "node_list" |
Optionally, you can specify a comma-delimited list of node names enclosed in double quotation marks ( Note: You can only use this parameter with Oracle Clusterware. |
Example
The following example enables the diskgroup1
Oracle ASM disk group on nodes mynode1
and mynode2
:
$ srvctl enable diskgroup -diskgroup diskgroup1 -node "mynode1,mynode2"
Parent topic: diskgroup Commands
srvctl predict diskgroup
Syntax
srvctl predict diskgroup -diskgroup diskgroup_name [-verbose]
Usage Notes
Specify the name of the Oracle ASM disk group for which you want to evaluate a failure. Optionally, you can use the –verbose
parameter top print detailed output.
Parent topic: diskgroup Commands
srvctl remove diskgroup
Syntax
srvctl remove diskgroup -diskgroup diskgroup_name [-force]
Usage Notes
Specify the name of the Oracle ASM disk group you want to remove. Optionally, you can use the –force
parameter to ignore any dependencies and forcibly remove the disk group.
Example
The following example forcibly removes the DG1
Oracle ASM disk group:
$ srvctl remove diskgroup -diskgroup DG1 -force
Parent topic: diskgroup Commands
srvctl start diskgroup
Syntax
srvctl start diskgroup -diskgroup diskgroup_name [-node "node_list"]
Parameters
Table A-23 srvctl start diskgroup Command Parameters
Parameter | Description |
---|---|
-diskgroup diskgroup_name |
Specify the name of the Oracle ASM disk group you want to start. |
-node "node_list" |
Optionally, you can specify a comma-delimited list of node names enclosed in double quotation marks ( Note: You can only use this parameter with Oracle Clusterware. |
Example
The following example starts the diskgroup1
Oracle ASM disk group on the nodes mynode1
and mynode2
:
$ srvctl start diskgroup -diskgroup diskgroup1 -node "mynode1,mynode2"
Parent topic: diskgroup Commands
srvctl status diskgroup
Syntax
srvctl status diskgroup -diskgroup diskgroup_name [-node "node_list"]
[-detail] [-verbose]
Parameters
Table A-24 srvctl status diskgroup Command Parameters
Parameter | Description |
---|---|
-diskgroup diskgroup_name |
Specify the name of the Oracle ASM disk group for which you want to display the status. |
-node "node_list" |
Optionally, you can specify a comma-delimited list of node names on which to check status of an Oracle ASM disk group. Note: You can only use this parameter with Oracle Clusterware. |
-detail |
Optionally, you can use this parameter to display detailed status information for the Oracle ASM disk group. |
-verbose |
Optionally, you can use this parameter to display verbose output. |
Examples
The following example displays the status of the dgrp1
Oracle ASM disk group:
$ srvctl status diskgroup -diskgroup dgrp1 -node "mynode1,mynode2" -detail
Parent topic: diskgroup Commands
srvctl stop diskgroup
Syntax
srvctl stop diskgroup -diskgroup diskgroup_name [-node "node_list"] [-force]
Parameters
Table A-25 srvctl stop diskgroup Command Parameters
Parameter | Description |
---|---|
-diskgroup diskgroup_name |
Specify the name of the Oracle ASM disk group you want to stop. |
-node "node_list" |
Optionally, you can specify a comma-delimited list of node names enclosed in double quotation marks ( Note: You can only use this parameter with Oracle Clusterware. |
-force |
Optionally, you can use this parameter to perform a forceful dismount. While this parameter does not stop the databases that depend on the disk group you are stopping, it still may cause those databases to fail. |
Example
The following command stops the diskgroup1
Oracle ASM disk group on the two nodes mynode1
and mynode2
:
$ srvctl stop diskgroup -diskgroup diskgroup1 -node "mynode1,mynode2" -force
Parent topic: diskgroup Commands
home Commands
Use commands with the home
keyword to start, stop, and obtain the status of all clusterware resources related to a Home directory.
- srvctl start home
Starts all the Oracle Restart-managed or Oracle Clusterware-managed resources on the specified Oracle home. - srvctl status home
Displays the status of all the Oracle Restart-managed or Oracle Clusterware-managed resources for the specified Oracle home. - srvctl stop home
Stops all the Oracle Restart-managed or Oracle Clusterware-managed resources that run from the specified Oracle home.
Parent topic: SRVCTL Command Reference
srvctl start home
Syntax
srvctl start home -oraclehome Oracle_home -statefile state_file -node node_name
Parameters
Table A-26 srvctl start home Command Parameters
Parameter | Description |
---|---|
-oraclehome Oracle_home |
Specify the path to the Oracle home for which you want to start the Oracle Restart or Oracle Clusterware-managed resources. |
-statefile state_file |
Specify the path to the directory where you want SRVCTL to write the state file. |
-node node_name |
Specify the name of the node on which the Oracle home resides. Note: You can only use this parameter with Oracle Clusterware. |
Example
The following command starts an Oracle home:
$ srvctl start home -oraclehome /u01/app/oracle/product/12.2.0/db_1
-statefile ~/state.txt -node node1
Parent topic: home Commands
srvctl status home
Displays the status of all the Oracle Restart-managed or Oracle Clusterware-managed resources for the specified Oracle home.
Syntax
srvctl status home -oraclehome Oracle_home -statefile state_file -node node_name
Parameters
Table A-27 srvctl status home Command Parameters
Parameter | Description |
---|---|
-oraclehome Oracle_home |
Specify the path to the Oracle home for which you want to start the Oracle Restart or Oracle Clusterware-managed resources. |
-statefile state_file |
Specify the path to the directory that contains the text file that holds the state information generated by this command. |
-node node_name |
Specify the name of the node on which the Oracle home resides. Note: This parameter is required and you can only use it with Oracle Clusterware. |
Example
The following example obtains the status of a particular Oracle home:
$ srvctl status home -oraclehome /u01/app/oracle/product/23.4.0/dbhome_1 -statefile
~/state.txt -node stvm12
The preceding command returns output similar to the following:
Database cdb1 is running on node stvm12
Parent topic: home Commands
srvctl stop home
Stops all the Oracle Restart-managed or Oracle Clusterware-managed resources that run from the specified Oracle home.
Syntax
srvctl stop home -oraclehome Oracle_home -statefile state_file -node node_name
[-stopoption stop_options] [-force]
Parameters
Table A-28 srvctl stop home Command Parameters
Parameter | Description |
---|---|
-oraclehome Oracle_home |
Specify the directory path to the Oracle home for which you want to start the Oracle Restart or Oracle Clusterware-managed resources. Note: The path to the Oracle home you specify must be the same version as the Oracle home from which you invoke SRVCTL. |
-statefile state_file |
Specify the path to the directory where you want SRVCTL to write the state file. |
-node node_name |
Specify the name of the node on which the Oracle home resides. Note: You can only use this parameter with Oracle Clusterware. |
-stopoption stop_options |
Optionally, you can specify shutdown options for the database, such as See Also: SQL*Plus User's Guide and Reference for more information about shutdown options |
-force |
Optionally, you can use this parameter to stop the resources even if errors are reported. |
Example
The following example stops the Oracle home:
$ srvctl stop home -oraclehome /u01/app/oracle/product/23.4.0/db_1 -statefile
~/state.txt
Parent topic: home Commands
instance Commands
Use commands with the instance
keyword to add, modify, enable, disable, start, stop, obtain the status of, and remove database instances.
- srvctl add instance
Adds a configuration for an instance to your cluster database configuration. - srvctl disable instance
Disables a database instance. - srvctl enable instance
Enables an instance of an Oracle RAC database. - srvctl modify instance
This command modifies the configuration for a database instance from its current node to another node. - srvctl remove instance
Removes the configurations for an instance of a database. - srvctl start instance
Starts instances and their dependencies in the cluster database. - srvctl status instance
- srvctl stop instance
Thesrvctl stop instance
command stops instances and stops any services running on specified instances. - srvctl transfer instance
Transfers Oracle RAC and Oracle Oracle RAC One Node databases, PDBs, and services from the old Oracle home to the new Oracle home in a dual instance deployment. - srvctl update instance
Thesrvctl update instance
command changes the open mode or the target Oracle ASM instance of the database instances.
Parent topic: SRVCTL Command Reference
srvctl add instance
Adds a configuration for an instance to your cluster database configuration.
Syntax
srvctl add instance -db db_unique_name -instance instance_name
-node node_name [-force]
Parameters
Table A-29 srvctl add instance Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name of the database you are adding the instance to |
-instance instance_name |
The name of the instance you are adding |
-node node_name |
The name of the node on which you are creating the instance |
-force |
Optionally, you can force the add operation, even though some resources will be stopped. |
Usage Notes
-
You can only use this command with Oracle Clusterware and Oracle RAC.
-
This command increments the
CARDINALITY
resource attribute. -
If you attempt to use this command on an Oracle RAC One Node database, then the command returns an error stating you must convert the database to Oracle RAC.
Examples
Examples of this command are:
$ srvctl add instance -db crm -instance crm01 -node gm01
$ srvctl add instance -db crm -instance crm02 -node gm02
$ srvctl add instance -db crm -instance crm03 -node gm03
Parent topic: instance Commands
srvctl disable instance
If the database instance that you disable with this command is the last enabled database instance, then this operation also disables the database.
Note:
-
This command is only available with Oracle Clusterware and Oracle RAC.
-
If you run this command on an Oracle RAC One Node database, then the command returns an error instructing you to use the
database
noun, instead.
Syntax
srvctl disable instance -db db_unique_name -instance "instance_name_list"
Parameters
Table A-30 srvctl disable instance Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name for the database for which you want to disable the instance. |
-instance "instance_name_list" |
Specify an instance name or a comma-delimited list of instance names enclosed in double quotation marks ( |
Example
The following example disables two instances of the crm
database, named crm1
and crm2
:
$ srvctl disable instance -db crm -instance "crm1,crm3"
Parent topic: instance Commands
srvctl enable instance
Note:
-
You can only use this command with Oracle Clusterware and Oracle RAC.
-
If you run this command on an Oracle RAC One Node database, then the command returns an error instructing you to use the
database
noun, instead.
Syntax
srvctl enable instance -db db_unique_name -instance "instance_name_list"
Parameters
Table A-31 srvctl enable instance Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database for which you want to enable instances. |
-instance "instance_name_list" |
Specify a comma-delimited list of instance names enclosed in double quotation marks ( |
Example
The following example enables two instances of the crm
database:
$ srvctl enable instance -db crm -instance "crm1,crm2"
Parent topic: instance Commands
srvctl modify instance
Syntax
Note:
The policy-managed database deployment option is desupported in Oracle Database 23ai.srvctl modify instance -db db_unique_name -instance instance_name
-node node_name
Parameters
Table A-32 srvctl modify instance Command Parameters
Parameter | Description |
---|---|
-database db_unique_name |
Specify the unique name for the database. |
-instance instance_name |
Specify the database instance name. Note: If you specify an instance name that has never been started before, then you may have to assign an instance number, undo, and redo in the SPFILE. |
-node node_name |
Name of the node on which to run the instance. |
Usage Notes
You cannot use this command to rename or relocate a running instance.
Examples
The following example to changes the configuration of a database,
amdb
, so that the database instance, amdb1
,
runs on the specified node, mynode
:
$ srvctl modify instance -db amdb -instance amdb1 -node mynode
The following example removes the directive established by the previous example:
$ srvctl modify instance -db pmdb -instance pmdb1_1 -node ""
Parent topic: instance Commands
srvctl remove instance
Syntax
srvctl remove instance -db db_unique_name -instance instance_name
[-noprompt] [-force]
Parameters
Table A-33 srvctl remove instance Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database. |
-instance instance_name |
Specify the name of the instance that you want to remove. |
-noprompt |
Use this parameter to suppress prompts. |
–force |
Use this parameter to skip checking that the instance is not running, and remove it even though it is running. This parameter also skips checking that the instance has no running services using it, and causes those services to stop before the instance is removed. |
Usage Notes
-
You can use this command only with Oracle Clusterware and Oracle RAC.
-
If you use the
-force
parameter, then any services running on the instance stop. Oracle recommends that you reconfigure services to not use the instance you want to removed as a preferred or available instance before removing the instance. -
If you attempt to use this command on an Oracle RAC One Node database, then the command returns an error stating that cannot remove the instance except by removing the database.
Example
The following example removes the crm01
database instance from the crm
database.
$ srvctl remove instance -db crm -instance crm01
Parent topic: instance Commands
srvctl start instance
Starts instances and their dependencies in the cluster database.
Use the srvctl start instance
command to start database instances, and all listeners on nodes with database instances.
Syntax
Use the srvctl start instance
command with one of these syntax models:
To start all Oracle Clusterware managed database instances on one or more nodes:
srvctl start instance -node "node_list" [-startoption start_options]
To start an instance of a database on a specific node:
srvctl start instance -db db_unique_name -node node_name
[-instance "instance_name"] [-startoption start_options]
To start an instance of a database on one or more nodes:
srvctl start instance -db db_unique_name -node "node_list" [-startoption start_options]
To start specific instances of a database on available nodes:
srvctl start instance -db db_unique_name -instance "inst_name_list"
[-startoption start_options]
Parameters
Table A-34 srvctl start instance Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Unique name for the database |
-node node_name or -node "node_list" |
The name of a single node or a comma-delimited list of node names |
-instance "instance_name" or -instance "inst_name_list" |
The name of a single instance or a comma-delimited list of instance names |
-startoption start_options |
Options for startup command, such as Note: For multi-word startup options, such as |
Usage Notes
- This command is only available with Oracle Clusterware and Oracle RAC.
- If you run this command on an Oracle RAC One Node database, then the command returns an error instructing you to use the
database
noun, instead.
Related Topics
Parent topic: instance Commands
srvctl status instance
Displays the status of instances.
Note:
This command is only available with Oracle Clusterware and Oracle RAC.
Parent topic: instance Commands
srvctl stop instance
The srvctl stop instance
command stops instances and stops any services running on specified instances.
Syntax
Use this command with one of the following syntax models.
To stop all instances on one or more nodes:
srvctl stop instance -node "node_list" [-stopoption stop_options]
[-drain_timeout timeout] [-force] [-failover] [-verbose]
To stop instances for a database that are running on specific nodes:
srvctl stop instance -db db_unique_name -node "node_list"
[-stopoption stop_options] [-drain_timeout timeout] [-force] [-failover] [-verbose]
To stop one or more instances by name for a database:
srvctl stop instance -db db_unique_name -instance "instance_name_list"
[-stopoption stop_options] [-drain_timeout timeout] [-force] [-failover] [-verbose]
Parameters
Table A-35 srvctl stop instance Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name for the database for which you want to stop an instance. |
-node "node_list" |
Specify a comma-delimited list of node names enclosed in double quotation marks ( If you specify |
-instance "instance_name_list" |
Specify a comma-delimited list of instance names enclosed in double quotation marks ( |
-stopoption stop_options |
Specify options for the shutdown command, such as |
-drain_timeout timeout |
The time, in seconds, allowed to complete the resource draining action. By default, this parameter is not set. You can specify 0 or any positive integer. An empty string unsets the parameter. If you specify zero, then the agent will perform the actions related to service draining, immediately. Drain timeout is the maximum time the service waits before exiting (in case of |
-force |
Use this parameter to forcibly stop the instance and any running services if the |
–failover |
If you specify |
-verbose |
Display verbose output. |
Usage Notes
If you run this command on an Oracle RAC One Node database, then the command returns an error instructing you to use the srvctl stop database
command instead.
Example
The following command example stops the instance of the db1
database running on the node server1
, and includes verbose output:
$ srvctl stop instance -db db1 -node server1 -drain_timeout 50 -verbose
Draining in progress on services svc1
Draining in progress on services svc1
Drain complete on services svc1
Related Topics
Parent topic: instance Commands
srvctl transfer instance
Transfers Oracle RAC and Oracle Oracle RAC One Node databases, PDBs, and services from the old Oracle home to the new Oracle home in a dual instance deployment.
Syntax
srvctl transfer instance -db db_unique_name [-node node_list]
[-stopoption stop_options] [-drain_timeout timeout] [-rollback] [-verbose]
Parameters
Table A-36 srvctl transfer instance Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Specify the unique name of the database you want to relocate. |
-node target_node |
Comma-separated list of nodes on which you want to transfer the instances from the old Oracle homes to the new Oracle homes. |
-stopoption NORMAL |
Use this parameter to override the default shutdown option for the
instance running from the old Oracle home, such as
|
-drain_timeout timeout |
Specify the time, in seconds, allowed for resource draining to be completed. Accepted values are an empty string (""), 0, or any positive integer. The default value is an empty string, which means that this parameter is not set. If it is set to 0, then draining occurs, immediately. The draining period is intended for planned maintenance operations. During the draining period, all current client requests are processed, but new requests are not accepted. When set on the service this value is used when the command line value is not set. |
-rollback |
Use this parameter to rollback an online instance transfer. |
–verbose |
Use this parameter to display verbose output. |
Example
The following example transfers an Oracle RAC One Node database instance of database
named rac1
on the node called node1
.
$ srvctl transfer instance -db rac1 -node node1
Parent topic: instance Commands
srvctl update instance
The srvctl update instance
command changes the open mode or the target Oracle ASM instance of the database instances.
Syntax
srvctl update instance -db db_unique_name [-instance "instance_name_list"
| -node "node_list"] [-startoption start_options] [-targetinstance instance_name]
Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name of the database |
-instance "instance_name_list" | -node "node_list" |
A comma-delimited list of instance names or node names that you want to update. If you specify a list of node names, then SRVCTL udpates the instances running on those specific nodes. |
-startoption start_options |
The specify startup options for the database, such as |
-targetinstance instance_name |
The target Oracle ASM or Oracle ASM IOServer instance. Use double quotation marks ( |
Examples
An example of this command is:
$ srvctl update instance -db db00 -instance db00_3 -targetinstance +ASM2
Parent topic: instance Commands
listener Commands
Use commands with the listener
keyword to add, modify, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, and remove listeners.
- srvctl add listener
Adds a listener to every node in a cluster. - srvctl config listener
Displays configuration information of a specific listener that is registered with Oracle Clusterware. - srvctl disable listener
Disables a listener resource. - srvctl enable listener
Enables a listener resource. - srvctl getenv listener
Displays the environment variables for the specified listener. - srvctl modify listener
Changes several aspects of the listener - srvctl predict listener
Predicts the consequences of a listener failure. - srvctl remove listener
Removes the configuration of a specific listener, or all listeners, from Oracle Clusterware or Oracle Restart. - srvctl setenv listener
Administers listener environment configurations. - srvctl start listener
Starts the default listener on specific node, or starts the specified listener on all nodes that are registered with Oracle Clusterware or on the given node. - srvctl status listener
Displays the status of listener resources. - srvctl stop listener
Stops the default listener or a specific listener on all nodes or the specified node. - srvctl unsetenv listener
Unsets the environment configuration for a listener. - srvctl update listener
Updates the listener to listen on the new endpoints.
Parent topic: SRVCTL Command Reference
srvctl add listener
Adds a listener to every node in a cluster.
Syntax
Use this command with one of the following syntax models.
To create an Oracle Database listener:
srvctl add listener [-listener listener_name] [-netnum network_number] [-oraclehome Oracle_home]
[-user user_name] [-endpoints "[TCP:]port_list[:FIREWALL={ON|OFF}][/IPC:key][/NMP:pipe_name]
[/{TCPS|SDP|EXADIRECT}port_list[:FIREWALL={ON|OFF}]]" [-group group_name]] [-skip]
To create an Oracle ASM listener:
srvctl add listener [-listener listener_name] -asmlistener [-subnet subnet]
[-endpoints "[TCP:]port_list[:FIREWALL={ON|OFF}][/IPC:key][/NMP:pipe_name]
[/{TCPS|SDP|EXADIRECT}port_list[:FIREWALL={ON|OFF}]]" [-group group_name]] [-skip]
To create a SCAN listener, use the srvctl add scan_listener
command.
Parameters
Table A-37 srvctl add listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Specify a listener name. This parameter is optional. If you do not specify this parameter, then the name of the listener defaults to |
-netnum network_number |
The optional network number from which VIPs are obtained. If not specified, the VIPs are obtained from the same default network from which the Note: Use this parameter when you add an Oracle Database listener. |
-oraclehome oracle_home |
Specify an Oracle home for the cluster database. If you do not include this parameter, then SRVCTL uses the Grid home by default. Note: Use this parameter when you add an Oracle Database listener. |
-user user_name |
Use this parameter to set the user who will run the listener to a less privileged user. Oracle recommends using this parameter to increase security. Notes:
|
-endpoints "[TCP:]port_list[:FIREWALL={ON|OFF}][/IPC:key] [/NMP:pipe_name][/{TCPS|SDP|EXADIRECT}port_list[:FIREWALL={ON|OFF}]]"] |
Protocol specifications for the listener. Use If you do not specify the You can also specify endpoints for TCPS, SDP, and EXADIRECT ports. Note: You can modify this attribute using Online Resource Attribute Modification. |
-group group_name |
Optionally, you can use the |
-skip |
Indicates you want to skip the checking of ports. |
-asmlistener |
Specifies the listener type as an Oracle ASM listener. If you do not specify the Note: You can only use this parameter with Oracle Clusterware. |
-subnet subnet |
Specifies the subnet to use for an Oracle ASM listener. Note: You can only use this parameter with Oracle Clusterware. |
Usage Notes
You must run this command as root
user on Linux and UNIX platforms when you specify the -user
parameter.
Example
The following command adds a listener named listener112
that is listening on ports 1341, 1342, and 1345 and runs from the Oracle home directory on every node in the cluster.
$ srvctl add listener -listener listener112 -endpoints "1341,1342,1345"
-oraclehome /u01/app/oracle/product/23.4.0/db1
When a listener is configured in the Oracle RAC home instead of the Grid home, then
the listener.ora
file is created under the location returned by the
$ORACLE_HOME/bin/orabasehome
utility, in the subdirectory
network/admin
, for example,
/u02/racbase/homes/OraDB23Home1/network/admin
.
Parent topic: listener Commands
srvctl config listener
Displays configuration information of a specific listener that is registered with Oracle Clusterware.
Syntax
srvctl config listener [-listener listener_name | -asmlistener] [-all]
Parameters
Table A-38 srvctl config listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name | -asmlistener |
The name of a specific listener name or the type of listener (Oracle ASM). If you do not specify this parameter, then SRVCTL displays the configuration for the default database listener. |
-all |
Print detailed configuration information. |
Example
This command returns output similar to the following:
Name: LISTENER
Subnet: 10.100.200.195
Type: type
Owner: scott
Home: Grid_home
End points: TCP:1521
Parent topic: listener Commands
srvctl disable listener
Syntax
srvctl disable listener [-listener listener_name] [-node node_name]
Parameters
Table A-39 srvctl disable listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Optionally, you can specify the name of a particular listener resource. If you do not specify this parameter, then the name of the listener defaults to |
-node node_name |
Optionally, you can specify the name of a cluster node on which the listener resource you want to disable is running. Note: This parameter is only available with Oracle Clusterware. |
Example
The following example disables a listener resource named listener_crm
on the node node5
:
$ srvctl disable listener -listener listener_crm -node node5
Parent topic: listener Commands
srvctl enable listener
Syntax
srvctl enable listener [-listener listener_name] [-node node_name]
Parameters
Table A-40 srvctl enable listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Optionally, you can specify the name of a listener resource. If you do not use this parameter, then the name of the listener defaults to |
-node node_name |
Optionally, you can specify the name of a cluster node on which to enable the listener. Note: You can only use this parameter with Oracle Clusterware. |
Examples
The following example enables the listener named listener_crm
on the node named node5
:
$ srvctl enable listener -listener listener_crm -node node5
Parent topic: listener Commands
srvctl getenv listener
Syntax
srvctl getenv listener [-listener listener_name] [-envs "name_list"]
Parameters
Table A-41 srvctl getenv listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Optionally, you can specify a listener name for which you want to obtain the environment variables. If you do not use this parameter, then the name of the listener defaults to |
-envs "name_list" |
Optionally, you can specify a comma-delimited list of the names of environment variables enclosed in double quotation marks ( If you do not use this parameter, then SRVCTL displays the values of all environment variables associated with the listener. |
Example
The following example lists all environment variables specified for the default listener:
$ srvctl getenv listener
Parent topic: listener Commands
srvctl modify listener
Changes the Oracle home directory from which the listener runs, the name of the operating system user who owns Oracle home directory from which the listener runs, the listener endpoints, or the public subnet on which the listener listens, either for the default listener, or a specific listener, that is registered with Oracle Restart or with Oracle Clusterware.
If you want to change the name of a listener, then use the srvctl remove listener
and srvctl add listener
commands.
Syntax
srvctl modify listener [-listener listener_name] [-oraclehome oracle_home]
[-endpoints "[TCP:]port_list[:FIREWALL={ON|OFF}][/IPC:key][/NMP:pipe_name]
[/{TCPS|SDP|EXADIRECT}port_list[:FIREWALL={ON|OFF}]]"] [-group <group>]
[-user user_name] [-netnum network_number]
Parameters
Table A-42 srvctl modify listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Optionally, you can enter the name of the listener you want to modify. If you do not use this parameter, then SRVCTL uses the default name, |
-oraclehome oracle_home |
If you choose to use this parameter, then SRVCTL moves the listener to run from the Oracle home you specify. Note: When you use this parameter, run the command as a privileged user to enable SRVCTL to update resource ownership corresponding to the new |
-endpoints "[TCP:]port_list[:FIREWALL={ON|OFF}][/IPC:key][/NMP:pipe_name][/{TCPS|SDP|EXADIRECT}port_list[:FIREWALL={ON|OFF}]]" |
Optionally, you can use this parameter to modify protocol specifications for the listener. You must enclose the string of protocols in double quotation marks (
You can also modify endpoints for TCPS, SDP, and EXADIRECT ports. Note: You can modify this attribute using Online Resource Attribute Modification. |
-group group_name |
Optionally, you can use the |
-user user_name |
Optionally, you can specify the name of the operating system user who will own the specified Oracle listener Notes:
|
-netnum network_number |
Optionally, you can use this parameter to change the public subnet on which the listener listens. Note: Oracle recommends that you always have at least one listener on the default network. Do not use this parameter to change the network of the only listener that listens on the default network. |
Example
The following example changes the TCP ports for the default listener:
$ srvctl modify listener -endpoints "TCP:1521,1522"
Parent topic: listener Commands
srvctl predict listener
Syntax
srvctl predict listener listener_name [-verbose]
Usage Notes
Specify the name of the listener for which you want to predict the consequences of a failure. Optionally, you can use the –verbose parameter
for detailed output.
Parent topic: listener Commands
srvctl remove listener
Syntax
srvctl remove listener [-listener listener_name | -all] [-force]
Usage Notes
-
Optionally, you can specify the name of a listener that you want to remove or use the
–all
parameter to remove all listeners. If you do not specify a listener name, then the listener name defaults toLISTENER
for a database listener orLISTENER_ASM
for an Oracle ASM listener. -
Optionally, you can use the
–force
parameter to skip checking whether there are other resources that depend on this listener, such as databases, and remove the listener anyway.
Example
The following example removes the configuration for the listener named lsnr01
:
$ srvctl remove listener -listener lsnr01
Parent topic: listener Commands
srvctl setenv listener
Syntax
Use this command with one of the following syntax models:
srvctl setenv listener [-listener listener_name] -envs "name=val[,...]"
srvctl setenv listener [-listener listener_name] -env "name=val"
Parameters
Table A-43 srvctl setenv listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Optionally, you can specify the name of a listener. If you do not use this parameter, then the listener name defaults to |
|
Specify a comma-delimited list of name-value pairs of environment variables enclosed in double quotation marks ( |
-env "name=val" |
Use this parameter to enable single environment variable to be set to a value that contains commas or other special characters enclosed in double quotation marks ( |
Examples
The following example sets the language environment configuration for the default listener:
$ srvctl setenv listener -env "LANG=en"
Parent topic: listener Commands
srvctl start listener
Syntax
srvctl start listener [-node node_name] [-listener listener_name]
Parameters
Table A-44 srvctl start listener Command Parameters
Parameter | Description |
---|---|
-node node_name |
Specify a particular node name to start the listener on that node. Note: You can only use this parameter with Oracle Clusterware. |
-listener listener_name |
Specify a particular listener name. Use the If you do not assign a value to this parameter, then SRVCTL starts all known listeners in the cluster. |
Examples
The following command starts all listeners managed by Oracle Clusterware on the node named server3
.
$ srvctl start listener -node server3
Parent topic: listener Commands
srvctl status listener
Syntax
srvctl status listener [-listener listener_name] [-node node_name] [-verbose]
Parameters
Table A-45 srvctl status listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Optionally, you can specify the name of a listener. If you do not use this parameter, then the listener name defaults to |
-node node_name |
Optionally, you can specify the name of a cluster node. Note: You can only use this parameter with Oracle Clusterware. |
–verbose |
Optionally, you can use this parameter to display verbose output. |
Examples
The following example displays the status of the default listener on the node node2
:
$ srvctl status listener -node node2
Parent topic: listener Commands
srvctl stop listener
You can also use this command to stop a listener on a non-cluster database from the non-cluster database home. However, SRVCTL does not accept the -node
parameter when run from a non-cluster database home.
Syntax
srvctl stop listener [-listener listener_name] [-node node_name] [-force]
Parameters
Table A-46 srvctl stop listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Specify the name of the listener you want to stop. If you do not assign a value to this parameter, then SRVCTL stops all known listeners in the cluster. |
-node node_name |
Optionally, you can specify the name of a single node on which a particular listener runs. Note: You can only use this parameter with Oracle Clusterware. |
–force |
Forcibly stop the listener. |
Examples
The following command stops all listeners on the node mynode1
:
$ srvctl stop listener -node mynode1
Parent topic: listener Commands
srvctl unsetenv listener
Syntax
srvctl unsetenv listener [-listener listener_name] -envs "name_list"
Parameters
Table A-47 srvctl unsetenv listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Optionally, you can specify the name of a listener for which you want to unset the environment configuration. If you do not use this parameter, then the name of the listener defaults to |
-envs "name_list" |
Specify a comma-delimited list of environment variable names enclosed in double quotation marks ( |
Examples
The following example unsets the environment variable TNS_ADMIN
for the default listener:
$ srvctl unsetenv listener -envs "TNS_ADMIN"
Parent topic: listener Commands
srvctl update listener
Updates the listener to listen on the new endpoints.
Syntax
srvctl update listener [-listener listener_name -asm -remove [-force]]
Parameters
Table A-48 srvctl update listener Command Parameters
Parameter | Description |
---|---|
-listener listener_name |
Optionally, you can specify the name of a listener that you want to update. If you do not use this parameter, then the name of
the listener defaults to |
-asm |
Oracle ASM listener type. |
-remove |
Remove Oracle ASM listener. |
-force |
Forcefully remove Oracle ASM listener. |
Usage Notes
You can only use this command with Oracle Clusterware.
Parent topic: listener Commands
network Commands
Use commands with the network
keyword to add, modify, list the configuration of, and remove a non-default Network.
- srvctl add network
Adds a static or dynamic network. - srvctl config network
Displays the network configuration for the cluster. - srvctl modify network
Modifies the subnet, network type, or IP address type for a network. - srvctl predict network
Predicts the consequences of network failure. - srvctl remove network
Removes the network configuration.
Parent topic: SRVCTL Command Reference
srvctl add network
Adds a static or dynamic network.
If your server connects to more than one network, then you can use this command to configure an additional network interface for Oracle RAC, allowing you to create VIPs on multiple public networks.
Syntax
srvctl add network [-netnum net_number] -subnet subnet/netmask[/if1[|if2...]]
[-nettype {STATIC | DHCP | AUTOCONFIG | MIXED}] [-pingtarget "ping_target_list"]
[-skip] [-verbose]
Parameters
Table A-49 srvctl add network Command Parameters
Parameter | Description |
---|---|
-netnum net_number |
The network number. The default is 1. |
-subnet subnet/netmask [/if1[|if2|...]] |
Defines a subnet. If you do not specify any interface names, then the network uses any interface on the given subnet. For IPv6, |
-nettype {STATIC|DHCP|AUTOCONFIG|MIXED} |
Specify the network type: If you specify If you specify If you specify If you specify |
-pingtarget "ping_target_list" |
A comma-delimited list of IP addresses or host names to ping. |
-skip |
Use this parameter to skip the checking of subnet. |
-verbose |
Verbose output. |
Usage Notes
-
On Linux and UNIX systems, you must be logged in as the
root
user and on Windows, you must be logged in as a user with Administrator privileges to run this command. -
This command is only available with Oracle Clusterware.
-
Oracle only supports DHCP-assigned networks for the default network, not for subsequent networks.
-
You can also use the
LISTENER_NETWORKS
database initialization parameter to control client redirects to the appropriate network.
Example
An example of this command is:
# srvctl add network -netnum 3 -subnet 192.168.3.0/255.255.255.0
Parent topic: network Commands
srvctl config network
Displays the network configuration for the cluster.
Syntax
srvctl config network [-netnum network_number]
Usage Notes
-
Specify the network for which you want to display configuration information.
-
This command is only available with Oracle Clusterware.
Example
An example of this command is:
$ srvctl config network -netnum 2
Parent topic: network Commands
srvctl modify network
Syntax
srvctl modify network [-netnum network_number] [-subnet subnet/netmask
[/if1[|if2|...]]] [-nettype network_type | -iptype {ipv4 | ipv6 | both}]
[-pingtarget "ping_target_list"] [-verbose]
Parameters
Table A-50 srvctl modify network Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
Optionally, you can specify a network number that you want to modify. The default is 1. |
-subnet subnet/netmask [/if1[|if2|...]] |
Optionally, you can specify a subnet number for the public network. The netmask and interfaces you specify, if any, change those of the network you are modifying. If you specify an IPv6 subnet, then enter a prefix length, such as 64, in place of If you are changing the network type using the |
-nettype network_type |
Optionally, you can modify the network type using this parameter, to static , dhcp , autoconfig , or mixed .
|
-iptype {ipv4 | ipv6 | both} |
Alternative to modifying the network type, you can modify the type of IP address to |
-pingtarget "ping_target_list" |
Optionally, you can specify a comma-delimited list of IP addresses or host names to ping enclosed in double quotation marks ( |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
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. -
You can modify the IP address type for a network from IPv4 to IPv6, or from IPv6 to IPv4.
-
If you specify
static
for the network type, then you must provide the virtual IP address using thesrvctl add vip
command. -
If you specify
dhcp
for the network type, then the VIP agent obtains the IP address from a DHCP server. -
If you specify
autoconfig
for the network type, then the VIP agent generates a stateless IPv6 address for the network. You can only use this parameter for IPv6 networks. If the subnet/netmask specification is not for an IPv6 address, then SRVCTL returns an error. -
If you change a network from
static
tomixed
, then you must first configure GNS, so that the dynamic addresses obtained can have names registered for them. -
If you specify
mixed
for the network type, then the VIP resource uses both a static IP address and an IP address obtained dynamically, either DHCP or autoconfig. -
If you specify
mixed_autoconfig
for the network type, then the VIP resource retains the static IP configuration and either obtains an IP address from a DHCP server for an IPv4 network specification or generates a stateless auto-configured IP address for an IPv6 network specification.
Examples
The following example changes the subnet number, netmask, and interface list:
# srvctl modify network -subnet 192.168.2.0/255.255.255.0/eth0
The following example changes the second network to DHCP:
# srvctl modify network -netnum 2 -nettype dhcp
The following example adds an IPv6 subnet and netmask to the default network:
# srvctl modify network -subnet 2606:b400:400:18c0::/64
The following example removes the IPv4 configuration from a network:
# srvctl modify network -iptype ipv6
Related Topics
Parent topic: network Commands
srvctl predict network
Syntax
srvctl predict network [-netnum network_number] [-verbose]
Usage Notes
Optionally, you can specify a network for which you want to evaluate a failure. The default value is 1. You can also use the –verbose
parameter to print detailed output.
Example
The following example predicts the consequences of a failure on network number 2:
$ srvctl predict network -netnum 2
Parent topic: network Commands
srvctl remove network
Syntax
srvctl remove network {-netnum network_number | -all} [-force] [-verbose]
Parameters
Table A-51 srvctl remove network Command Parameters
Parameter | Description |
---|---|
-netnum network_number | -all |
Specify which network number you want to remove. Alternatively, you can use the |
-force |
Optionally, you can use this parameter to remove the specified network regardless of any dependencies. |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
-
You can only use the command with Oracle Clusterware.
-
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.
Example
The following example removes a network:
# srvctl remove network -netnum 3
Parent topic: network Commands
nodeapps Commands
Use commands with the nodeapps
keyword to add, modify, manage environment variables for, list the configuration of, enable, disable, start, stop, obtain the status of, and remove node applications.
- srvctl add nodeapps
Adds a node application configuration to the specified node. - srvctl config nodeapps
Displays the VIP configuration for each node in the cluster. - srvctl disable nodeapps
Disables node applications on all nodes in the cluster. - srvctl enable nodeapps
Enables the node applications on all nodes in the cluster. - srvctl getenv nodeapps
Displays the environment variables for the node application configurations. - srvctl modify nodeapps
Modifies the configuration for a node application. - srvctl remove nodeapps
Removes the node application configuration. - srvctl setenv nodeapps
Sets the environment variables for the node application configurations. - srvctl start nodeapps
Starts node-level applications on a node or all nodes in the cluster. - srvctl status nodeapps
Displays the status of node applications. - srvctl stop nodeapps
Stops node-level applications on a node in the cluster. - srvctl unsetenv nodeapps
Unsets the environment configuration for the node applications.
Parent topic: SRVCTL Command Reference
srvctl add nodeapps
Adds a node application configuration to the specified node.
Syntax
Use this command with one the following syntax models, specifying either a specific node and VIP or a specific subnet and netmask:
srvctl add nodeapps {-node node_name -address {vip_name |
ip_address}/netmask[/if1[|if2|..]] [-skip]}
[-emport em_port] [-onslocalport ons_local_port] [-onsremoteport ons_remote_port]
[-remoteservers hostname[:port][,hostname[:port]]
[-clientdata client_data_file [-scanclient]] [-pingtarget "pingtarget_list"] [-vipless] [-verbose]
srvctl add nodeapps -subnet subnet/netmask[/if1[|if2|...]] [-emport em_port]
[-onslocalport ons_local_port] [-onsremoteport ons_remote_port]
[-remoteservers hostname[:port][,hostname[:port]]
[-clientdata client_data_file [-scanclient]] [-pingtarget "pingtarget_list"] [-vipless] [-verbose]
Parameters
Table A-52 srvctl add nodeapps Command Parameters
Parameter | Description |
---|---|
-node node_name |
The name of the node on which you want to create the node application. Node name is optional and unnecessary if you run the command on the local node. |
-address {vip_name | ip_address}/netmask[/if1[|if2|..]]} |
This specification creates a traditional VIP node application on the specified node. Note: You must use this parameter for upgrade configurations and new, non-DHCP configurations. |
-skip |
Specify this parameter to skip checking the reachability of the VIP address. |
-subnet subnet/netmask [/if1[|if2 |...]] |
Creates a DHCP subnet. If you do not specify any interface names, then the VIPs use any interface on the given subnet. |
-emport em_port |
Local port on which Oracle Enterprise Manager listens. The default port is 2016. |
-onslocalport ons_local_port |
The Oracle Notification Service daemon listener port on its node. If you do not specify this value, the Oracle Notification Service daemon listener port defaults to 6100. Note: The local port and remote port must each be unique. |
-onsremoteport ons_remote_port |
The port number for remote Oracle Notification Service daemon connections. If you do not specify a port number, the default value of 6200 is used for the Oracle Notification Service remote port. Note: The local port and remote port must each be unique. |
-remoteservers hostname[:port] |
A list of |
-clientdata
client_data_file |
Optionally, you can specify the file with a wallet to import, or an empty string to delete a wallet used for SSL to secure Oracle Notification Service communication. If you want to use a custom certificate, then add your custom
certificate to an auto-login Oracle wallet using the
/wallet_directory/Oracle_wallet_name/custom_certificate_name.sso |
-scanclient |
Optionally, you can specify SCAN client cluster name. |
-pingtarget
"pingtarget_list" |
Optionally, you can specify a comma-delimited list of IPs or host names enclosed in double quotation marks ("") to ping. |
-vipless |
Specify this option to add a network without node VIP addresses. |
-verbose |
Verbose output. |
Usage Notes
-
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. -
This command is only available with Oracle Clusterware.
Example
An example of this command is:
# srvctl add nodeapps -node crmnode1 -address 1.2.3.4/255.255.255.0
Related Topics
Parent topic: nodeapps Commands
srvctl config nodeapps
Displays the VIP configuration for each node in the cluster.
Note:
This command is only available with Oracle Clusterware.
Syntax
srvctl config nodeapps [-viponly] [-onsonly]
Usage Notes
Use -viponly
to display the VIP address configuration. Use -onsonly
to display the Oracle Notification Service configuration.
Example
An example of this command is:
$ srvctl config nodeapps -viponly -onsonly
Parent topic: nodeapps Commands
srvctl disable nodeapps
Disables node applications on all nodes in the cluster.
Syntax
srvctl disable nodeapps [-onsonly] [-adminhelper] [-verbose]
Parameters
Table A-53 srvctl disable nodeapps Command Parameters
Parameter | Description |
---|---|
-onsonly |
Optionally, you can use this parameter to disable only the Oracle Notification Service (ONS). |
-adminhelper |
Optionally, you can use this parameter to disable the Administrator helper only. |
–verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this parameter with Oracle Clusterware.
Example
The following example disables ONS:
$ srvctl disable nodeapps -onsonly -verbose
Parent topic: nodeapps Commands
srvctl enable nodeapps
Enables the node applications on all nodes in the cluster.
Syntax
srvctl enable nodeapps [-onsonly] [-adminhelper] [-verbose]
Parameters
Table A-54 srvctl enable nodeapps Command Parameters
Parameter | Description |
---|---|
-onsonly |
Optionally, you can use this parameter to disable only the Oracle Notification Service (ONS). |
-adminhelper |
Optionally, you can use this parameter to enable the Administrator helper only. |
–verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example enables ONS:
$ srvctl enable nodeapps -onsonly -verbose
Parent topic: nodeapps Commands
srvctl getenv nodeapps
Displays the environment variables for the node application configurations.
Syntax
srvctl getenv nodeapps [-viponly] [-onsonly] [-envs "name_list"]
Parameters
Table A-55 srvctl getenv nodeapps Command Parameters
Parameter | Description |
---|---|
-viponly |
Optionally, you can use this parameter to display the VIP address configuration. |
-onsonly |
Optionally, you can use this parameter to isplay the Oracle Notification Service configuration. |
-envs "name_list" |
Optionally, you can specify a comma-delimited list of the names of environment variables enclosed in double quotation marks ( If you do not use this parameter, then SRVCTL displays the values of all environment variables associated with the node applications. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example lists all environment variables for the node applications:
$ srvctl getenv nodeapps -viponly
Parent topic: nodeapps Commands
srvctl modify nodeapps
Modifies the configuration for a node application.
Syntax
Use this command with one of the following syntax models, specifying either a specific node and VIP or a specific subnet and netmask:
srvctl modify nodeapps {[-node node_name -address {vip_name|vip_address}/
netmask[/if1[|if2|...]] [-skip]} [-nettype network_type] [-emport em_port]
[-onslocalport ons_local_port] [-onsremoteport ons_remote_port]
[-remoteservers host:[port][,...]] [-verbose]
[-clientdata file] [-pingtarget "ping_target_list"]
srvctl modify nodeapps [-subnet subnet/netmask[/if1[|if2|...]]]
[-nettype network_type] [-emport em_port]
[-onslocalport ons_local_port] [-onsremoteport ons_remote_port]
[-remoteservers host:[port][,host:port,...]] [-verbose]
[-clientdata file] [-pingtarget "ping_target_list"]
Parameters
Table A-56 srvctl modify nodeapps Command Parameters
Parameter | Description |
---|---|
-node node_name |
Specify the name of the node on which the node application you want to modify resides. |
-address {vip_name|vip_address}/ netmask[/if1[|if2|...]] |
Specify a node-level virtual IP name or address. The address specified by name or IP must match the subnet number of the default network. Note: You must use this parameter for upgrade configurations and new non-DHCP configurations |
–skip |
Optionally, you can use this parameter to skip checking the reachability of the VIP address. |
-subnet subnet/netmask[/if1[|if2|...]] |
Alternative to specifying a node name and address, you can specify a subnet number for the public network. The netmask and interfaces you specify, if any, change those of the default network. Additionally, if you specify a value for the |
-nettype network_type |
Optionally, you can change the network server type to |
-emport em_port |
Optionally, you can change the local port on which Oracle Enterprise Manager listens. Note: You can also modify this attribute using Online Resource Attribute Modification. |
-onslocalport ons_local_port |
Optionally, you can change the port on which the Oracle Notification Service daemon listens for local client connections. Notes:
|
-onsremoteport ons_remote_port |
Optionally, you can change the port on which the Oracle Notification Service daemon listens for connections from remote hosts. Notes:
|
-remoteservers host:[port][,...] |
Optionally, you can modify the comma-delimited list of |
-clientdata file |
Optionally, you can specify the file with a wallet to import, or an empty string to delete a wallet used for SSL to secure Oracle Notification Service communication. Note: You must manually restart the ONS server after updating the ONS security certificate using this parameter. |
-pingtarget "ping_target_list" |
Optionally, you can specify a comma-delimited list of IPs or host names enclosed in double quotation marks ( |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example changes the nodeapps resource on mynode1
to use the application VIP of 100.200.300.40 with a subnet mask of 255.255.255.0 on the network interface eth0
:
$ srvctl modify nodeapps -node mynode1 -addr 100.200.300.40/255.255.255.0/eth0
Note:
You must manually restart the ONS server after updating the ONS security certificate using the-clientdata
parameter.
Parent topic: nodeapps Commands
srvctl remove nodeapps
Removes the node application configuration.
Syntax
srvctl remove nodeapps [-force] [-noprompt] [-verbose]
Parameters
Table A-57 srvctl remove nodeapps Command Parameters
Parameter | Description |
---|---|
-force |
Optionally, you can use this parameter to forcibly remove node application configurations, regardless of any dependencies. |
-noprompt |
Optionally, you can use this parameter to suppress prompts. |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
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.
Parent topic: nodeapps Commands
srvctl setenv nodeapps
Sets the environment variables for the node application configurations.
Syntax
srvctl setenv nodeapps {-envs "name=val[,...]" | -env "name=val"}
[-viponly] [-onsonly] [-verbose]
Parameters
Table A-58 srvctl setenv nodeapps Command Parameters
Parameter | Description |
---|---|
-envs "name=val[,...]" |
Use this parameter to specify a comma-delimited list of name-value pairs of environment variables enclosed in double quotation marks ( |
-env "name=val" |
Alternatively, you can use this parameter to enable a single environment variable that is set to a value which contains commas or other special characters, enclosed in double quotation marks ( |
-viponly |
Optionally, you can use this parameter to modify only the VIP configuration. |
-onsonly |
Optionally, you can use this parameter to modify only the ONS daemon configuration. |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example sets the CLASSPATH
environment variable for all node applications:
$ srvctl setenv nodeapps -env "CLASSPATH=/usr/local/jdk/jre/rt.jar" -verbose
Parent topic: nodeapps Commands
srvctl start nodeapps
Starts node-level applications on a node or all nodes in the cluster.
Syntax
srvctl start nodeapps [-node node_name] [-onsonly] [-adminhelper] [-verbose]
Parameters
Table A-59 srvctl start nodeapps Command Parameters
Parameter | Description |
---|---|
-node node_name |
Optionally, you can specify a node on which to start node-level applications. If you do not use this parameter, then SRVCTL starts the node applications on all active nodes in the cluster. |
-onsonly |
Optionally, you can use this parameter to disable only the Oracle Notification Service (ONS). |
-adminhelper |
Optionally, you can use this parameter to start only an Administrator helper instead of all node applications. |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
Parent topic: nodeapps Commands
srvctl status nodeapps
Displays the status of node applications.
Syntax
srvctl status nodeapps [-node node_name]
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
Optionally, you can specify a node for which to display the status of the node applications.
Parent topic: nodeapps Commands
srvctl stop nodeapps
Stops node-level applications on a node in the cluster.
Syntax
srvctl stop nodeapps [-node node_name] [-onsonly] [-adminhelper] [-force]
[-relocate] [-verbose]
Parameters
Table A-60 srvctl stop nodeapps Command Parameters
Parameter | Description |
---|---|
-node node_name |
Optionally, you can use this parameter to specify a node on which you want to stop node applications. If you do not use this parameter, then the utility stops the node applications on all active nodes in the cluster. |
-onsonly |
Optionally, you can use this parameter to disable only the Oracle Notification Service (ONS). |
-adminhelper |
Optionally, you can use this parameter to stop only the Administrator helper instead of all node applications. |
-force |
Optionally, you can use this parameter to stop node applications regardless of any dependencies. |
-relocate |
Optionally, you can use this parameter to relocate the VIP and possibly-dependent services. Note: If you use this parameter, then you must also specify the |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Clusterware.
Parent topic: nodeapps Commands
srvctl unsetenv nodeapps
Unsets the environment configuration for the node applications.
Syntax
srvctl unsetenv nodeapps -envs "name_list" [-viponly] [-onsonly]
[-verbose]
Parameters
Table A-61 srvctl unsetenv nodeapps Command Parameters
Parameter | Description |
---|---|
-envs "name_list" |
Specify a comma-delimited list of the names of environment variables enclosed in double quotation marks ( |
-viponly |
Optionally, you can use this parameter to unset only the VIP configuration. |
-onsonly |
Optionally, you can use this parameter to unset only the ONS daemon configuration. |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Example
The following example unsets the environment configuration for the specified node applications:
$ srvctl unsetenv nodeapps -envs "test_var1,test_var2"
Parent topic: nodeapps Commands
ons Commands
Use commands with the ons
keyword to manage only Oracle Notification Service instances for Oracle Restart.
You can add, configure, enable, start, obtain the status of, stop, disable, and remove Oracle Notification Service instances for Oracle Restart.
- srvctl add ons
Adds an Oracle Notification Service daemon to an Oracle Restart configuration. - srvctl config ons
Displays configuration information for the Oracle Notification Service daemon. - srvctl disable ons
Disables the Oracle Notification Service (ONS) daemon for Oracle Restart installations. - srvctl enable ons
Enables the Oracle Notification Service daemon. - srvctl export ons
Exports ONS server information into a file. - srvctl modify ons
Modifies the ports used by the Oracle Notification Service daemon that is registered with Oracle Restart. - srvctl remove ons
Removes Oracle Notification Service from the Oracle Grid Infrastructure home. - srvctl start ons
Starts the Oracle Notification Service daemon. - srvctl status ons
Displays the current state of the Oracle Notification Service daemon. - srvctl stop ons
Stops the Oracle Notification Service daemon.
Parent topic: SRVCTL Command Reference
srvctl add ons
Adds an Oracle Notification Service daemon to an Oracle Restart configuration.
Syntax
srvctl add ons [-emport em_port] [-onslocalport ons_local_port] [-onsremoteport ons_remote_port]
[-remoteservers host[:port][,host[:port]...]]
[-clientcluster cluster_name] [-clientdata filename]
Parameters
Table A-62 srvctl add ons Command Parameters
Parameter | Description |
---|---|
-emport em_port |
Local listen port for Oracle Enterprise Manager. The default port number is 2016. |
-onslocalport ons_local_port |
Optionally, you can specify the Oracle Notification Service daemon listening port for local client connections. Note: The local port and remote port must each be unique. |
-onsremoteport ons_remote_port |
Optionally, you can specify the Oracle Notification Service daemon listening port for connections from remote hosts. Note: The local port and remote port must each be unique. |
-remoteservers host[:port][host[:port]...] |
Optionally, you can specify a comma-delimited list of Note: If |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
-clientdata filename |
Specify the path to the file to which credentials data will be written. |
Usage Notes
You can only use this command with Oracle Restart.
Example
An example of this command is:
$ srvctl add ons -onslocalprt 6200
Parent topic: ons Commands
srvctl config ons
Displays configuration information for the Oracle Notification Service daemon.
Syntax
srvctl config ons [-all] [-clientcluster cluster_name]
Usage Notes
-
You can only use this command with Oracle Restart.
-
You can display the configuration for all ONS daemons, or those for a specific client cluster.
Parent topic: ons Commands
srvctl disable ons
Disables the Oracle Notification Service (ONS) daemon for Oracle Restart installations.
Syntax
srvctl disable ons [-clientcluster cluster_name] [-verbose]
Usage Notes
-
You can only use this command with Oracle Restart.
-
You can disable all ONS daemons, or those for a specific client cluster.
-
Optionally, you can use the
-verbose
parameter to display detailed output.
Parent topic: ons Commands
srvctl enable ons
Syntax
srvctl enable ons [-clientcluster cluster_name] [-verbose]
Usage Notes
-
You can only use this command with Oracle Restart.
-
You can enable all ONS daemons, or those for a specific client cluster.
-
Optionally, you can use the
-verbose
parameter to display detailed output.
Parent topic: ons Commands
srvctl export ons
Exports ONS server information into a file.
Syntax
srvctl export ons -clientcluster cluster_name -clientdata filename
Parameters
Table A-63 srvctl export ons Command Parameters
Parameter | Description |
---|---|
-clientcluster cluster_name |
Specify the cluster name. |
-clientdata filename |
Specify the path to the file to which credentials data will be written. |
Parent topic: ons Commands
srvctl modify ons
Syntax
srvctl modify ons [-emport em_port] [-onslocalprt ons_local_port] [-onsremoteport ons_remote_port]
[-remoteservers host[:port][,host[:port],...]]
[-clientcluster cluster_name] [-verbose]
Parameters
Table A-64 srvctl modify ons Command Parameters
Parameter | Description |
---|---|
-emport em_port |
Optionally, you can specify the local port on which Oracle Enterprise Manager listens. The default port is 2016. |
-onslocalprt ons_local_port |
Optionally, you can modify the Oracle Notification Service daemon listening port for local client connections. Note: The local port and remote port must each be unique. |
-onsremoteport ons_remote_port |
Optionally, you can modify the Oracle Notification Service daemon listening port for connections from remote hosts. Note: The local port and remote port must each be unique. |
-remoteservers host[:port][,host[:port],...] |
Optionally, you can specify a list of Note: If you do not specify |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
-verbose |
Optionally, you can use this parameter to display detailed output. |
Usage Notes
You can only use this command with Oracle Restart.
Example
An example of this command is:
$ srvctl modify ons -onslocalprt 6203
Parent topic: ons Commands
srvctl remove ons
Syntax
srvctl remove ons [-clientcluster cluster_name] [-force] [-verbose]
Usage Notes
-
You can only use this command with Oracle Restart.
-
If using the shared SCAN feature, then use the
-clientcluster
parameter to specify the name of the cluster that is running the shared SCAN listener. -
Optionally, you can use the
–force
parameter to remove Oracle Notification Service regardless of dependencies. -
Optionally, you can use the
–verbose
parameter to display detailed output.
Parent topic: ons Commands
srvctl start ons
Syntax
srvctl start ons [-clientcluster cluster_name] [-verbose]
Usage Notes
-
You can only use this command with Oracle Restart.
-
You can enable all ONS daemons, or those for a specific client cluster.
-
Optionally, you can use the
-verbose
parameter to display detailed output.
Parent topic: ons Commands
srvctl status ons
Syntax
srvctl status ons [-clientcluster cluster_name]
Usage Notes
-
You can only use this command with Oracle Restart.
-
You can display the status for all ONS daemons, or those for a specific client cluster.
Parent topic: ons Commands
srvctl stop ons
Syntax
srvctl stop ons [-clientcluster cluster_name] [-force]
Usage Notes
-
You can only use this command with Oracle Restart.
-
You can stop all ONS daemons, or those for a specific client cluster.
-
Optionally, you can use the
–force
parameter to stop the ONS daemons regardless of any dependencies.
Parent topic: ons Commands
pdb Commands
Use commands with the pdb
keyword to manage the Pluggable
Databases (PDBs) in your cluster database.
You can add, modify, remove, list the configuration of, enable, disable, start, stop, and obtain the status of PDBs.
- srvctl add pdb
Adds a Pluggable Database (PDB) configuration to Oracle Clusterware. - srvctl config pdb
Displays the configuration information for a Pluggable Database (PDB). - srvctl disable pdb
Disables a running Pluggable Database (PDB) from Oracle Clusterware management. - srvctl enable pdb
Enables the Pluggable Database (PDB) for Oracle Clusterware management. - srvctl modify pdb
Modifies the configuration for a Pluggable Database (PDB). - srvctl remove pdb
Removes the Pluggable Database (PDB) configuration from Oracle Clusterware management. - srvctl start pdb
Starts a Pluggable Database (PDB) and the associated services based on the management policy of the service. All the services with theAUTOMATIC
management policy will start automatically. - srvctl status pdb
This command displays the current state of the Pluggable Database (PDB). - srvctl stop pdb
Stops a Pluggable Database (PDB) and its services.
Related Topics
Parent topic: SRVCTL Command Reference
srvctl add pdb
Adds a Pluggable Database (PDB) configuration to Oracle Clusterware.
Syntax
srvctl add pdb -db db_unique_name -pdb pdb_name
[-cardinality {num_of_instances | ALL}]
[-maxcpu max_cpu_usage] [-mincpuunit min_cpu_usage]
[-approot approot_database] [-startoption start_options]
[-stopoption stop_options] [-policy policy]
Parameters
Table A-65 srvctl add pdb Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name of the Container Database (CDB). |
-pdb pdb_name |
The name of the PDB. |
-cardinality {num_of_instances | ALL} |
The number of instances of the PDB to be open at any time. If you specify
Note: If this parameter is not set, then the PDB can run on any node on which the cluster database can run. Where the PDB runs is determined by the preferred and available lists of the PDB services. If this parameter is set, then the PDB services must beUNIFORM ,
SINGLETON , or
DUPLEX .
|
-maxcpu max_cpu_usage |
The maximum CPU usage limit for the PDB. |
-mincpuunit min_cpu_usage |
The minimum CPU usage limit for the PDB. |
-approot approot_database |
The application root PDB. |
-startoption start_options |
Startup options for the PDB, such as Note: For multi-word startup options, such asread
only and read write ,
separate the words with a space and enclose in double
quotation marks ("" ). For example,
"read only" .
|
-stoption stop_options |
Stop options for the PDB, such as |
-policy policy |
Management policy for the Pluggable Database, where policy can be one of the following values:
|
Usage Notes
If a PDB's management policy is RESTART
, then the management policy for the CDB must be RANK
.
Related Topics
Parent topic: pdb Commands
srvctl config pdb
Displays the configuration information for a Pluggable Database (PDB).
Syntax
srvctl config pdb -db db_unique_name [-pdb pdb_name] [-detail]
Parameters
Table A-66 srvctl config pdb Command Parameters
Parameter | Description |
---|---|
|
Unique name for the Container Database (CDB). |
-pdb pdb_name |
The name of the PDB. |
|
Print detailed configuration information. |
Example
This examples shows the configuration information for the crmeast
PDB.
srvctl config pdb -db crm -pdb crmeast
Pluggable database name: crmeast
Application Root PDB:
Maximum CPU count (whole CPUs): 0
Minimum CPU count unit (1/100 CPU count): 0
Start Option: open
Stop Option: immediate
Parent topic: pdb Commands
srvctl disable pdb
Disables a running Pluggable Database (PDB) from Oracle Clusterware management.
Syntax
srvctl disable pdb -db db_unique_name -pdb pdb_name [-node node_name]
Parameters
Table A-67 srvctl disable pdb Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name of the Container Database (CDB). |
-pdb pdb_name |
The name of the PDB. |
-node node_name |
The node on which you want to disable the PDB. Note: You can only use this parameter only with Oracle Clusterware. |
Example
The following example disables the PDB crmeast
:
srvctl disable pdb -db crm -pdb crmeast
Parent topic: pdb Commands
srvctl enable pdb
Enables the Pluggable Database (PDB) for Oracle Clusterware management.
Syntax
srvctl enable pdb -db db_unique_name -pdb pdb_name [-node node_name]
Parameters
Table A-68 srvctl enable pdb Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name of the Container Database (CDB). |
-pdb pdb_name |
The name of the PDB that you want to enable. |
-node node_name |
The name of the node on which the PDB resource resides that you want to enable. Note: You can only use this parameter with Oracle Clusterware. |
Example
The following example enables a PDB named crmeast
for Oracle Clusterware management:
srvctl enable pdb -db crm -pdb crmeast
Parent topic: pdb Commands
srvctl modify pdb
Modifies the configuration for a Pluggable Database (PDB).
Syntax
srvctl modify pdb -db db_unique_name -pdb pdb_name
[-cardinality {num_of_instances | ALL}]
[-maxcpu max_cpu_usage] [-mincpuunit min_cpu_usage]
[-rank rank] [-startoption start_options]
[-stopoption stop_options] [-policy policy]
Parameters
Table A-69 srvctl modify pdb Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Unique name for the Container Database (CDB). |
-pdb pdb_name |
The name of the PDB. |
-cardinality {num_of_instances | ALL} |
The number of instances of the PDB to be open at any time. If you specify
Note: You can modify the-cardinality
parameter only if you had set the
-cardinality parameter when
creating the PDB.
|
-maxcpu max_cpu_usage |
The maximum CPU usage limit for the PDB in whole CPUs. Specify a positive integer value that is equal to or greater than 1. You must be logged in as either the |
-mincpuunit min_cpu_usage |
The minimum CPU usage limit for the PDB. Specify a positive integer value that is equal to or greater than 10. The value must be in hundredths of the total CPU count (1/100 CPU count). You must be logged in as either the |
-rank rank |
The rank of the PDB. The range of values you can specify for this parameter is 0 to 5. The default value is 0. You must be logged in as either the |
-startoption start_options |
Startup options for the PDB, such as Note: For multi-word startup options, such as |
-stoption stop_options |
Stop options for the PDB, such as |
-policy policy |
Management policy for the Pluggable Database, where policy can be one of the
following values: |
Related Topics
Parent topic: pdb Commands
srvctl remove pdb
Removes the Pluggable Database (PDB) configuration from Oracle Clusterware management.
Syntax
srvctl remove pdb -db db_unique_name -pdb pdb_name
[-force] [-noprompt] [-verbose]
Parameters
Table A-70 srvctl remove pdb Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Unique name of the Container Database (CDB). |
-pdb pdb_name |
The name of the PDB. |
-force |
Forcibly remove the PDB and ignore any dependencies. |
-noprompt |
Suppress prompts. |
-verbose |
Display verbose output. |
Example
This example shows how to remove configuration from Oracle Clusterware management of the PDB named crmeast
in the Container Database
(CDB) named crm
.
$ srvctl remove pdb -db crm -pdb crmeast
Parent topic: pdb Commands
srvctl start pdb
Starts a Pluggable Database (PDB) and the associated services based on the
management policy of the service. All the services with the AUTOMATIC
management policy will start automatically.
Syntax
srvctl start pdb -db db_unique_name -pdb pdb_name
[-startoption start_options] [-node node_list]
Parameters
Table A-71 srvctl start pdb Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name of the database to start. |
-pdb pdb_name |
The name of the PDB to start. |
-startoption start_options |
Options for the startup command, such as Notes:
|
-node node_list |
Comma-separated list of nodes on which to start the PDB. |
Examples
The following example starts the crmeast
PDB in READ ONLY
mode:
srvctl start pdb -db crm -pdb crmeast -startoption "read only"
Parent topic: pdb Commands
srvctl status pdb
This command displays the current state of the Pluggable Database (PDB).
Syntax
srvctl status pdb -db db_unique_name [-pdb pdb_name]
[-detail]
Parameters
Table A-72 srvctl status pdb Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name of the Container Database (CDB). |
-pdb pdb_name |
The name of the PDB. If you do not specify a PDB name, then information on all the PDBs in that particular database are displayed. |
–detail |
Display detailed status information. |
Examples
This example shows sample output for the status information for the crmeast
and crmnorth
PDBs.
$ srvctl status pdb -db crm -pdb crmeast
Pluggable database crmeast of crm is running on nodes site1, site3.
$ srvctl status pdb -db crm -pdb crmnorth
Pluggable database crmnorth of crm is not running.
Parent topic: pdb Commands
srvctl stop pdb
Stops a Pluggable Database (PDB) and its services.
Syntax
srvctl stop pdb -db db_unique_name -pdb pdb_name [-node node_name]
[-stopoption stop_options] [-drain_timeout timeout]
[-stopsvcoption stop_service_options] [-force]
Parameters
Table A-73 srvctl stop pdb Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
The unique name for the Container Database (CDB). |
-pdb pdb_name |
The name of the PDB to stop. |
-node node_name |
The name of the node on which to stop the PDB. If you do not specify any nodes, then the specified PDB is stopped on all the nodes where the PDB is running. |
-stopoption stop_options |
Options for the shutdown command, such as |
-drain_timeout timeout |
The time, in seconds, for the resource draining action to complete. By default, this parameter is not set. You can specify 0 or any positive integer. An empty string unsets the parameter. If you specify zero, then the agent will perform the actions related to service draining, immediately. Drain timeout is the maximum time the service waits before exiting (in case of |
-stopsvcoption stop_service_options |
Options for stopping services, such as |
-force |
Use this parameter to force stop the PDB and its services, and any dependent resources. |
Example
The following command stops a PDB named crmeast
that is open in the crm
database, allowing 50 seconds for all sessions to drain from the PDB:
srvctl stop pdb -db crm -pdb crmeast -drain_timeout 50
Parent topic: pdb Commands
scan Commands
Use commands with the scan
keyword to add, list the configuration of, modify, enable, disable, start, stop, relocate, obtain the status of, and remove SCAN VIPs.
- srvctl add scan
Adds Oracle Clusterware resources for the given SCAN. - srvctl config scan
Displays the configuration information for all SCAN VIPs, by default, or a specific SCAN VIP identified by ordinal_number. - srvctl disable scan
Disables all SCAN VIPs, by default, or a specific SCAN VIP identified byordinal_number
. - srvctl enable scan
Enables all SCAN VIPs, by default, or a specific SCAN VIP identified by its ordinal number. - srvctl modify scan
Modifies the number of SCAN VIPs to match the number of IP addresses returned by looking up thescan_name
you specify in DNS. - srvctl predict scan
Predicts the consequences of SCAN failure. - srvctl relocate scan
Relocates a specific SCAN VIP from its current hosting node to another node within the cluster. - srvctl remove scan
Removes Oracle Clusterware resources from all SCAN VIPs. - srvctl start scan
Starts all SCAN VIPs, by default, or a specific SCAN VIP, on all nodes or a specific node in the cluster. - srvctl status scan
Displays the status for all SCAN VIPs, by default, or a specific SCAN VIP. - srvctl stop scan
Stops all SCAN VIPs, by default, that are running or in starting state, or stops a specific SCAN VIP identified by an ordinal number.
Parent topic: SRVCTL Command Reference
srvctl add scan
Adds Oracle Clusterware resources for the given SCAN.
Syntax
srvctl add scan -scanname scan_name [-netnum network_number]
Parameters
Table A-74 srvctl add scan Command Parameters
Parameter | Description |
---|---|
-scanname scan_name |
A fully-qualified host name, which includes the domain name. If the network is dynamic, then you do not have to use fully-qualified host name but, if you choose to do so, then the domain must be the GNS subdomain. Note: You can modify this attribute using Online Resource Attribute Modification. |
-netnum network_number |
The optional network number from which SCAN VIPs are obtained. If you do not specify this parameter, then the SCAN VIPs are obtained from the same default network from which the |
Usage Notes
-
This command creates the same number of SCAN VIP resources as the number of IP addresses that SCAN resolves to, or 3 when
network_number
identifies a dynamic network and Oracle GNS configuration. -
For static networks, the addresses to which the SCAN resolves in DNS must match the address type of the subnet.
-
For an IPv4 network, the SCAN must resolve to IPv4 addresses.
-
This command is only available with Oracle Clusterware.
Example
An example of this command is:
# srvctl add scan -scanname scan.mycluster.example.com
Parent topic: scan Commands
srvctl config scan
Displays the configuration information for all SCAN VIPs, by default, or a specific SCAN VIP identified by ordinal_number.
Syntax
srvctl config scan [[-netnum network_number] [-scannumber ordinal_number] | -all]
Parameters
Table A-75 srvctl config scan Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
Use this parameter to view the configuration of a specific SCAN VIP. |
-scannumber ordinal_number |
Use this parameter to specify any one of the three SCAN VIPs, using values from 1 to 3, for which you want to view the configuration. |
-all |
Alternative to specifying network or ordinal numbers, you can use this parameter to view the configuration for all of the SCAN VIPs. |
Usage Notes
This command is only available with Oracle Clusterware.
Example
This command returns output similar to the following:
$ srvctl config scan -scannumber 1
SCAN name: mjk12700890090-r, Network: 1
Subnet IPv4: 198.51.100.1/203.0.113.46/eth0, static
Subnet IPv6:
SCAN 1 IPv4 VIP: 198.51.100.195
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
Parent topic: scan Commands
srvctl disable scan
ordinal_number
.Syntax
srvctl disable scan [-scannumber ordinal_number]
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
Optionally, you can use the
-scannumber
parameter to specify any one of the three SCAN VIPs you want to disable. The parameter takes a range of values from 1 to 3.
Example
The following example disables the first SCAN VIP:
$ srvctl disable scan -scannumber 1
Parent topic: scan Commands
srvctl enable scan
Syntax
srvctl enable scan [-scannumber ordinal_number]
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
Optionally, you can use the
-scannumber
parameter to specify any one of the three SCAN VIPs you want to enable. The parameter takes a range of values from 1 to 3.
Example
The following example enables the first SCAN VIP:
$ srvctl enable scan -scannumber 1
Parent topic: scan Commands
srvctl modify scan
scan_name
you specify in DNS.You use this command when DNS was modified to add, change, or remove IP addresses, and now you must adjust the Oracle Clusterware resource configuration to match.
Syntax
srvctl modify scan -scanname scan_name [-netnum network_number]
Parameters
Table A-76 srvctl modify scan Command Parameters
Parameter | Description |
---|---|
-scanname scan_name |
Identifies the SCAN name that resolves to the SCAN VIPs that you want to modify. Note: You can modify this attribute using Online Resource Attribute Modification. |
-netnum network_number |
The optional network number from which VIPs are obtained. If not specified, the VIPs are obtained from the same default network from which the |
Example
Assume your system currently has a SCAN named scan_name1
, and it resolves to a single IP address in DNS. If you modify the SCAN scan_name1
in DNS to resolve to three IP addresses, then use the following command to create the additional SCAN VIP resources:
$ srvctl modify scan -scanname scan_name1
Parent topic: scan Commands
srvctl predict scan
Syntax
srvctl predict scan -scannumber ordinal_number [-verbose]
Usage Notes
-
Specify an ordinal number that identifies the SCAN VIP for which you want to simulate failure. The range of values you can specify for this parameter is 1 to 3.
-
Optionally, you can use the
–verbose
parameter to display detailed output.
Add additional information about the command here.
Parent topic: scan Commands
srvctl relocate scan
Relocates a specific SCAN VIP from its current hosting node to another node within the cluster.
Syntax
srvctl relocate scan -scannumber ordinal_number [-netnum network_number] [-node node_name]
Parameters
Table A-77 srvctl relocate scan Command Parameters
Parameter | Description |
---|---|
-scannumber ordinal_number |
Specify an ordinal number that identifies which SCAN VIP you want to relocate. The range of values you can specify for this parameter is 1 to 3. |
-netnum
network_number |
The optional network number from which VIPs are
obtained. If not specified, the VIPs are obtained from the same
default network from which the The default network number is 1. |
-node node_name |
Optionally, you can specify the name of a single node to which SRVCTL relocates the SCAN VIP. If you do not use this parameter, then SRVCTL chooses the node to which the SCAN VIP is relocated. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example relocates the first SCAN VIP to node1
:
$ srvctl relocate scan -scannumber 1 -node node1
Parent topic: scan Commands
srvctl remove scan
Syntax
srvctl remove scan [-netnum network_number] [-force] [-noprompt]
Parameters
Table A-78 srvctl remove scan Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
The optional network number from which VIPs are obtained. If not specified, the VIPs are obtained from the same default network from which the |
–force |
Removes the SCAN VIPs even though there are SCAN listeners running that are dependent on the SCAN VIPs. |
–noprompt |
Use this parameter to suppress all prompts. |
Usage Notes
If you use the -force
option, then SCAN VIPs that are running are not stopped before the dependent resources are removed, which may require manual cleanup.
Examples
An example of this command is:
$ srvctl remove scan -force
Parent topic: scan Commands
srvctl start scan
Syntax
srvctl start scan [-scannumber ordinal_number] [-node node_name]
Parameters
Table A-79 srvctl start scan Command Parameters
Parameter | Description |
---|---|
-scannumber ordinal_number |
Optionally, you can specify an ordinal number that identifies which SCAN VIP you want to start. The range of values you can specify for this parameter is 1 to 3. If you do not use this parameter, then SRVCTL starts all the SCAN VIPs. |
-node node_name |
Optionally, you can specify the name of a single node on which the SCAN VIP resides that you want to start. If you do not specify this parameter, then SRVCTL starts the SCAN VIPs on all nodes in the cluster. |
Usage Notes
You can only use this command with Oracle Clusterware.
Example
The following example starts the SCAN VIP identified by the ordinal number 1 on the crm1
node:
$ srvctl start scan -scannumber 1 -node crm1
Parent topic: scan Commands
srvctl status scan
Syntax
srvctl status scan [-scannumber ordinal_number] [-verbose]
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
Optionally, you can specify an ordinal number that identifies a specific SCAN VIP for which you want to display the status. The range of values you can specify for this parameter is 1 to 3. If you do not use this parameter, then SRVCTL displays the status of all SCAN VIPs in the cluster.
-
Optionally, you can use the
–verbose
parameter to display detailed output.
Parent topic: scan Commands
srvctl stop scan
Syntax
srvctl stop scan [-scannumber ordinal_number] [-force]
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
Optionally, you can specify an ordinal number that identifies which SCAN VIP you want to stop. The range of values you can specify for this parameter is 1 to 3. If you do not use this parameter, then SRVCTL stops all the SCAN VIPs.
-
Optionally, you can use the
–force
parameter to stop the SCAN VIPs regardless of any dependencies.
Example
The following example stops the SCAN VIP identified by the ordinal number 1:
$ srvctl stop scan -scannumber 1
Parent topic: scan Commands
scan_listener Commands
Use commands with the scan_listener
keyword to add, list the configuration of, modify, enable, disable, start, stop, relocate, obtain the status of, and remove SCAN listeners.
- srvctl add scan_listener
Adds Oracle Clusterware resources for the SCAN listeners. - srvctl config scan_listener
Displays the configuration information for all SCAN listeners, by default, or a specific listener identified by network number or ordinal_number. - srvctl disable scan_listener
Disables all SCAN listeners, by default, or a specific listener identified by an ordinal number or client cluster. - srvctl enable scan_listener
Enables all SCAN listeners, by default, or a specific listener identified by its ordinal number. - srvctl export scan_listener
Saves the SCAN listener configuration information to a file. - srvctl modify scan_listener
Modifies the SCAN listener to match that of the SCAN VIP, or modifies the SCAN listener endpoints or service registration restrictions. - srvctl predict scan_listener
Predicts the consequences of SCAN listener failure. - srvctl relocate scan_listener
Relocates a specific SCAN listener from its current hosting node to another node within the cluster. - srvctl remove scan_listener
Removes Oracle Clusterware resources from all SCAN listeners. - srvctl start scan_listener
Starts all SCAN listeners, by default, or a specific listener on all nodes or a specific node in the cluster. - srvctl status scan_listener
Displays the status for all SCAN listeners, by default, or a specific listener. - srvctl stop scan_listener
Stops all SCAN listeners, by default, that are in a running or starting state, or a specific listener identified by an ordinal number. - srvctl update scan_listener
Updates the SCAN listeners to listen on the new endpoints.
Parent topic: SRVCTL Command Reference
srvctl add scan_listener
Adds Oracle Clusterware resources for the SCAN listeners.
Syntax
srvctl add scan_listener [-netnum network_number] [-listener lsnr_name_prefix] [-skip]
[-endpoints "[TCP:]port_list[/IPC:key][/NMP:pipe_name]
[/{TCPS|SDP|EXADIRECT}port_list]"]
[-invitednodes "node_list"] [-invitedsubnets "subnet_list"]
[-clientcluster cluster_name] [-clientdata <filename>]
Parameters
Table A-80 srvctl add scan_listener Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
The optional network number from which SCAN VIPs are obtained. If you do not specify this parameter, then the SCAN VIPs are obtained from the same default network from which the |
-listener lsnr_name_prefix |
The SCAN listener name prefix. |
-skip |
Skip checking of the ports. |
-endpoints "[TCP:]port_list[/IPC:key] [/NMP:pipe_name][/{TCPS|SDP|EXADIRECT}port_list]" |
Protocol specifications for the SCAN listener. Use You can also specify endpoints for TCPS, SDP, and EXADIRECT ports. Note: You can modify this attribute using Online Resource Attribute Modification. |
-invitednodes "node_list" |
A comma-delimited list of host names from outside the cluster that are allowed to register with the SCAN listener. |
-invitedsubnets "subnet_list" |
A comma-delimited list of subnets from outside the cluster that are allowed to register with the SCAN listener. You can specify the subnets using either CIDR notation or wildcards (such as 192.168.*). |
-clientcluster cluster_name |
The name of the cluster that is running the SCAN listener you want to share. |
-clientdata file_name |
The name of the cluster that is running the shared SCAN listener. |
Usage Notes
-
The number of SCAN listener resources created is the same as the number of SCAN VIP resources.
-
This command is only available with Oracle Clusterware.
Example
An example of this command is:
# srvctl add scan_listener -listener myscanlistener
Parent topic: scan_listener Commands
srvctl config scan_listener
Displays the configuration information for all SCAN listeners, by default, or a specific listener identified by network number or ordinal_number.
Syntax
srvctl config scan_listener [[-netnum network_number] [-scannumber ordinal_number]
[-clientcluster cluster_name] | -all]
Parameters
Table A-81 srvctl config scan_listener Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
Use this parameter to view the configuration of the listener for a specific SCAN VIP. |
-scannumber ordinal_number |
Use this parameter to specify any one of the three SCAN VIPs, using values from 1 to 3, for which you want to view the configuration of the listener. |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
–all |
Alternative to specifying network or ordinal numbers, you can use this parameter to view the configuration of the listeners for all of the SCAN VIPs. |
Usage Notes
This command is only available with Oracle Clusterware.
Example
This command returns output similar to the following:
$ srvctl config scan_listener -scannumber 1
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1529
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
Parent topic: scan_listener Commands
srvctl disable scan_listener
Syntax
srvctl disable scan_listener [-netnum network_number] [-scannumber ordinal_number]
[-clientcluster cluster_name]
Parameters
Table A-82 srvctl disable scan_listener Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
Use this parameter to disable SCAN listeners for a specific network number. |
-scannumber ordinal_number |
Use this parameter to disable any one of the three SCAN VIPs, using values from 1 to 3. If you do not use this parameter, then SRVCTL disables all SCAN listeners. |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
Usage Notes
This command is only available with Oracle Clusterware.
Example
The following example disables the SCAN listener identified as 1:
$ srvctl disable scan_listener -scannumber 1
Parent topic: scan_listener Commands
srvctl enable scan_listener
Syntax
srvctl enable scan_listener [-netnum network_number] [-scannumber ordinal_number]
[-clientcluster <cluster_name>]
Parameters
Table A-83 srvctl enable scan_listener Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
Use this parameter to enable the listener for a specific SCAN VIP. |
-scannumber ordinal_number |
Use this parameter to enable any one of the three SCAN VIPs, using values from 1 to 3. If you do not use this parameter, then SRVCTL enables all SCAN listeners. |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
Usage Notes
This command is only available with Oracle Clusterware.
Example
The following example enables the SCAN listener identified as 1:
$ srvctl enable scan_listener -scannumber 1
Parent topic: scan_listener Commands
srvctl export scan_listener
Saves the SCAN listener configuration information to a file.
Syntax
srvctl export scan_listener -clientcluster cluster_name -clientdata filename
Parameters
Table A-84 srvctl export scan_listener Command Parameters
Parameter | Description |
---|---|
-clientcluster cluster_name |
Specify the cluster name. |
-clientdata filename |
Specify the path to the file to which credentials data will be written. |
Parent topic: scan_listener Commands
srvctl modify scan_listener
Modifies the SCAN listener to match that of the SCAN VIP, or modifies the SCAN listener endpoints or service registration restrictions.
Syntax
srvctl modify scan_listener {-update | -endpoints "[TCP:]port_list[/IPC:key]
[/NMP:pipe_name][/{TCPS|SDP|EXADIRECT}port_list]"} [-invitednodes "node_list"]
[-invitedsubnets "subnet_list"] [-clientcluster cluster_name]
Parameters
Table A-85 srvctl modify scan_listener Command Parameters
Parameter | Description |
---|---|
-update |
Use this parameter to update SCAN listener configuration to match the current SCAN VIP configuration. This parameter adds new resources or removes existing SCAN listener resources to match the number of SCAN VIP resources. |
-endpoints "[TCP:]port_list[/IPC:key] [/NMP:pipe_name][/{TCPS|SDP|EXADIRECT}port_list]" |
Protocol specifications for the SCAN listener. Use You can also specify endpoints for TCPS, SDP, and EXADIRECT ports. |
-invitednodes "node_list" |
Use this parameter to specify a comma-delimited list of host names from outside the cluster that are allowed to register with the SCAN listener. |
-invitedsubnets "subnet_list" |
Use this parameter to specify a comma-delimited list of subnets from outside the cluster that are allowed to register with the SCAN listener. You can specify the subnets using either CIDR notation or wildcards (such as 192.168.*). |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
Example
Assume your system currently has a SCAN named scan_name1
, and you recently modified the DNS entry to resolve to three IP addresses instead of one. After running the srvctl modify scan
command to create additional SCAN VIP resources, use the following command to create Oracle Clusterware resources for the additional two SCAN listeners to go with the two additional SCAN VIPs:
$ srvctl modify scan_listener -update
Parent topic: scan_listener Commands
srvctl predict scan_listener
Syntax
srvctl predict scan_listener -scannumber ordinal_number [-verbose]
Usage Notes
-
Use the
-scannumber
parameter to specify any one of the three SCAN listeners for which you want to predict the consequences of a failure. The range of values you can specify for this parameter is 1 to 3. -
Optionally, you can use the
–verbose
parameter to display detailed output.
Parent topic: scan_listener Commands
srvctl relocate scan_listener
Syntax
srvctl relocate scan_listener -scannumber ordinal_number [-node node_name]
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
Specify an ordinal number that identifies which SCAN listener you want to relocate. The range of values you can specify for this parameter is 1 to 3.
-
Optionally, you can specify the name of a single node to which you want to relocate the SCAN listener. If you do not specify this parameter, then SRVCTL chooses the node to which the SCAN listener is relocated.
Example
The following example relocates the SCAN listener identified as 3 to node2
of the cluster:
$ srvctl relocate scan_listener -scannumber 3 -node node2
Parent topic: scan_listener Commands
srvctl remove scan_listener
Syntax
srvctl remove scan_listener [-netnum network_number] [-clientcluster cluster_name]
[-force] [-noprompt]
Parameters
Table A-86 srvctl remove scan_listener Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
The optional network number from which SCAN VIPs are obtained. If you do not specify this parameter, then the SCAN VIPs are obtained from the same default network from which the |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
-force |
Removes the SCAN listener without stopping the SCAN listener if it is running. |
–noprompt |
Use this parameter to suppress all prompts. |
Example
An example of this command is:
$ srvctl remove scan_listener -force
Parent topic: scan_listener Commands
srvctl start scan_listener
Syntax
srvctl start scan_listener [-netnum network_number] [-scannumber ordinal_number]
[-node node_name] [-clientcluster cluster_name]
Parameters
Table A-87 srvctl start scan_listener Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
Use this parameter to start SCAN listeners for a specific network number. |
-scannumber ordinal_number |
Use this parameter to start one of the three SCAN VIPs, using values from 1 to 3. If you do not use this parameter, then SRVCTL starts all SCAN listeners. |
-node node_name |
Specify the name of a single node on which you want to start a SCAN listener. If you do not use this parameter, then SRVCTL starts the SCAN listeners on all nodes in the cluster. |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
Usage Notes
This command is only available with Oracle Clusterware.
Example
The following example starts the SCAN listener identified as 1:
$ srvctl start scan_listener -scannumber 1
Parent topic: scan_listener Commands
srvctl status scan_listener
Displays the status for all SCAN listeners, by default, or a specific listener.
Syntax
srvctl status scan_listener [[-netnum network_number] [-scannumber ordinal_number]
| [-clientcluster cluster_name] | -all] [-verbose]
Parameters
Table A-88 srvctl status scan_listener Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
The network number. The default network number is 1. |
-scannumber ordinal_number |
An ordinal number that identifies a specific SCAN listener. The range of values you can specify for this parameter is 1 to 3. If you do not use this parameter, then the utility displays the status of all SCAN listeners in the cluster. |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
-all |
Display the status for SCAN listeners for all networks. |
-verbose |
Display detailed information. |
Usage Notes
This command is only available with Oracle Clusterware.
Parent topic: scan_listener Commands
srvctl stop scan_listener
Syntax
srvctl stop scan_listener [-netnum network_number] [-scannumber ordinal_number]
[-clientcluster cluster_name] [-force]
Parameters
Table A-89 srvctl stop scan_listener Command Parameters
Parameter | Description |
---|---|
-netnum network_number |
Use this parameter to stop SCAN listeners for a specific network number. |
-scannumber ordinal_number |
Use this parameter to stop any one of the three SCAN VIPs, using values from 1 to 3. If you do not use this parameter, then SRVCTL stops all SCAN listeners. |
-clientcluster cluster_name |
The name of the cluster that is running the shared SCAN listener. |
-force |
Stops the SCAN listener regardless of any dependencies. |
Usage Notes
This command is only available with Oracle Clusterware.
Example
The following example stops the SCAN listener identified as 1:
$ srvctl stop scan_listener -scannumber 1
Parent topic: scan_listener Commands
srvctl update scan_listener
Syntax
srvctl update scan_listener
Usage Notes
-
You can only use this command with Oracle Clusterware.
-
This command does not accept any additional parameters, except for
-help
.
Parent topic: scan_listener Commands
service Commands
Use commands with the service
keyword to add, modify, list the configuration of, enable, disable, start, stop, obtain the status of, relocate, and remove services.
- srvctl add service
Adds services to a database and assigns them to instances. - srvctl config service
Displays the configuration for a service. - srvctl disable service
Disables a service. - srvctl enable service
Enables a service for Oracle Clusterware. - srvctl modify service
Modifies a service configuration. - srvctl predict service
Predicts the consequences of service failure. - srvctl relocate service
Temporarily relocates the specified service names from one specified instance to another specified instance. - srvctl remove service
Removes the service from Oracle Clusterware management. - srvctl start service
Starts a service or multiple services on a database, Pluggable Database (PDB) , or instance. - srvctl status service
Displays the status of a service. - srvctl stop service
Stops one or more services globally across the cluster database, or on the specified instance.
Parent topic: SRVCTL Command Reference
srvctl add service
Adds services to a database and assigns them to instances.
Syntax
Use this command with one of the following syntax models.
Note:
The policy-managed database deployment option is desupported in Oracle Database 23ai.To add a service to a database:
srvctl add service -db db_unique_name -service service_name_list [-true_cache_service true_cache_service_list]
[-cardinality {UNIFORM | SINGLETON | DUPLEX} | -preferred "preferred_list"
[-available "available_list"] [-tafpolicy {BASIC | NONE | PRECONNECT}] | [-cardinality {UNIFORM | SINGLETON}] ]
[-netnum network_number] [-role "[PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]"]
[-policy {AUTOMATIC | MANUAL}] [-notification {TRUE | FALSE}] [-dtp {TRUE | FALSE}]
[-clbgoal {SHORT | LONG}] [-rlbgoal {NONE | SMART_CONN | SERVICE_TIME | THROUGHPUT}] [-resetstate {NONE | LEVEL1}]
[-failovertype {NONE|SESSION|SELECT|TRANSACTION|AUTO}] [-failovermethod {NONE | BASIC}] [-failoverretry failover_retries]
[-failoverdelay failover_delay] [-failover_restore {NONE|LEVEL2|LEVEL1|AUTO}] -template_timeout template_timeout [-failback {YES | NO}]
[-edition edition_name] [-pdb pdb_name] [-global {TRUE | FALSE}] [-maxlag max_lag_time]
[-sql_translation_profile sql_translation_profile] [-commit_outcome {TRUE|FALSE}] [-retention retention_time]
[-replay_init_time replay_initiation_time] [-session_state {DYNAMIC | AUTO}] [-pqservice pq_service]
[-gsmflags gsm_flags] [-tablefamilyid table_family_id]
[-drain_timeout timeout] [-stopoption {NONE|IMMEDIATE|TRANSACTIONAL}] [-css_critical {yes | no}]
[-force] [-eval] [-verbose]
To update the preferred and available lists of an existing service:
srvctl add service -db db_unique_name -service "service_name_list"
-update {-preferred "preferred_list" | -available "available_list"} [-force]
[-verbose]
Parameters
The following table lists and describes all the srvctl add service
parameters and whether they can be used when adding a service to either an Oracle RAC database or non-cluster database.
Table A-90 srvctl add service Command Parameters
Parameter | Description |
---|---|
-db db_unique_name |
Unique name for the database. |
-service service_name_list |
The Note: The |
-true_cache_service
true_cache_service_list |
Specify this parameter to associate a primary service with the True Cache service. |
-cardinality {UNIFORM | SINGLETON | DUPLEX} |
The cardinality of the service, which can be one of the following:
Note: This parameter can be used only with Oracle RAC. |
-preferred "preferred_list" |
A comma-separated list of preferred instances on which the service runs. The list of preferred instances must be mutually exclusive with the list of available instances. Note: This parameter can be used only with Oracle RAC. |
-available "available_list" |
A comma-separated list of available instances to which the service fails over. The list of available instances must be mutually exclusive with the list of preferred instances. Note: This parameter can be used only with Oracle RAC. |
-tafpolicy {BASIC|NONE} |
Transparent Application Failover (TAF) policy specification. |
-netnum network_number |
Use this parameter to determine on which network this service is offered. The service is configured to depend on VIPs from the specified network. Notes:
|
-role "[PRIMARY][,PHYSICAL_STANDBY] [,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]" |
The service role. You can specify one or more roles in a comma-delimited list. Use this option to indicate that the service should only be automatically started upon database open when the Oracle Data Guard database role matches one of the specified service roles. Using SRVCTL to manually start a service is not affected by the service role. Note: The |
-policy {AUTOMATIC | MANUAL} |
Service management policy. If If Note: Using CRSCTL to stop and start the Oracle Clusterware restarts the service in the same way that a failure does. |
-notification {TRUE | FALSE} |
Enable Fast Application Notification (FAN) for OCI connections. |
-dtp {TRUE | FALSE} |
Indicates whether Distributed Transaction Processing should be enabled for this service. This service will be a preferred service on a single node in an administrator-managed database. |
-clbgoal {SHORT | LONG} |
Connection Load Balancing Goal. Use a value of |
-rlbgoal {NONE | SMART_CONN | SERVICE_TIME |
THROUGHPUT} |
Runtime Load Balancing Goal (for the Load Balancing Advisory). Set this parameter to
|
-resetstate {NONE | LEVEL1} |
Reset state in a session to clean values. If set to The session state reset excludes SYS CONTEXT and secure roles. |
-failovertype {NONE | SESSION | SELECT | TRANSACTION | AUTO} |
Set the failover type. To enable Application Continuity for Java, set this parameter to To enable TAF for OCI, set this parameter to Note: If you set |
-failovermethod {NONE | BASIC} |
TAF failover method (for backward compatibility only). If the failover type ( Note: This parameter can be used only with Oracle RAC. |
-failoverretry failover_retries |
For Application Continuity and TAF, this parameter determines the number of attempts to connect after an incident. |
-failoverdelay failover_delay |
For Application Continuity and TAF, this parameter specifies the time delay (in seconds) between reconnect attempts per incident at failover. |
-failover_restore {NONE|LEVEL2|LEVEL1|AUTO} |
For Application Continuity, when you set the Use
LEVEL1 for Application Continuity or Transparent Application
Continuity to restore session states using the earlier Oracle Database 19c modifiable
parameter transport. Use wallets to allow restoring server-side session states
transparently.
For OCI applications using TAF or Application Continuity, setting
|
-template_timeout
template_timeout |
Specify the time, in seconds, for template timeout. For Application
Continuity, You are recommended to set higher values so your pools are able to failover following the
overnight maintenance. The default value is If |
-failback {YES | NO} |
If a service fails over to an available instance after the list of preferred instances was exhausted, then, if this parameter is set to YES , the service automatically fails back to a preferred instance when one becomes available.
|
-edition edition_name |
The initial session edition of the service. When an edition is specified for a service, all subsequent connections that specify the service use this edition as the initial session edition. However, if a session connection specifies a different edition, then the edition specified in the session connection is used for the initial session edition. SRVCTL does not validate the specified edition name. During connection, the connect user must have |
-pdb pluggable_database |
The name of the Pluggable Database (PDB). You can specify a PDB property when you create or modify a service. The PDB property associates the service with the specified PDB. You can view the PDB property for a service by querying theALL_SERVICES data dictionary view or, when using the SRVCTL utility, by
running the srvctl config service command.
Note:
Starting with Oracle Database 21c, before using the |
-global {TRUE | FALSE} |
Indicates whether this is a Global Data Services service. Note: This parameter can only be used with Global Data Services. |
-maxlag maximum_lag_time |
Maximum replication lag time in seconds for a global service. Must be a non-negative integer. The default value is |
-sql_translation_profile profile_name |
Use this parameter to specify a SQL translation profile for a service that you are adding after you have migrated applications from a non-Oracle database to an Oracle database. This parameter corresponds to the SQL translation profile parameter in the Notes:
|
-commit_outcome {TRUE | FALSE} |
Enable Transaction Guard; when set to |
-retention retention_time |
If |
-replay_init_time replay_initialization_time |
For Application Continuity, this parameter specifies the difference between the
time, in seconds, of original processing of the first operation of a request and the time
that the replay is ready to start after a successful reconnect. Application Continuity will
not replay after the specified amount of time has passed. This parameter is intended to
avoid the unintentional processing of a transaction when a system is recovered after a long
period. The default is 5 minutes ( |
-session_state { DYNAMIC | AUTO} |
For Application Continuity; this parameter
describes how the non-transactional session state is changed by the application
within a request. Examples of session state are NLS settings, optimizer preferences,
event settings, PL/SQL global variables, and temporary tables. For Transparent
Application Continuity, you can set This parameter is considered only if
If non-transactional values change after the request starts, then set this
parameter to either |
-pqservice pq_service |
Specify a parallel query service name. |
-gsmflags gsm_flags |
Set locality and region failover values for a global service. You must also
specify the |
-tablefamilyid table_family_id |
Set table family ID for a service. See "Shared Table Family" for more information. |
-drain_timeout timeout |
Specify the time, in seconds, allowed for resource draining to be completed. Accepted values are an empty string (""), 0, or any positive integer. The default value is an empty string, which means that this parameter is not set. If it is set to 0, then draining occurs, immediately. The draining period is intended for planned maintenance operations. During the draining period, all current client requests are processed, but new requests are not accepted. When set on the service this value is used when the command line value is not set. |
-stopoption {NONE|IMMEDIATE|TRANSACTIONAL} |
Specify the default method of stopping the service. When set on the service,
this value is used if you do not include the
|
-css_critical {yes | no} |
You can add weight to a service by setting this parameter to
|
-update { |
Add a new preferred or available instance to the service configuration.
|
-force |
Force the add operation even though a listener is not configured for a network. |
-eval |
Use this parameter to hypothetically evaluate the impact of the command on the system. |
-verbose |
Display verbose output. |
Usage Notes
This command does not accept placement parameters for Oracle RAC One Node databases.
Examples
Use the following examples to create your services:
Basic Service
$ srvctl add service -db mydb -service MYSERVICE –preferred inst1 -available inst2
-pdb mypdb -notification TRUE -drain_timeout 300 -stopoption IMMEDIATE -role PRIMARY
Transparent Application Continuity Service
$ srvctl add service -db mydb -service TACSERVICE -pdb mypdb –preferred inst1 -available inst2
-failover_restore AUTO -commit_outcome TRUE -failovertype AUTO -replay_init_time 600 -retention 86400
-notification TRUE -drain_timeout 300 -stopoption IMMEDIATE -role PRIMARY
Application Continuity Service
$ srvctl add service -db mydb -service ACSERVICE -pdb mypdb -preferred inst1 -available inst2
-failover_restore LEVEL1 -commit_outcome TRUE -failovertype TRANSACTION -session_state dynamic
-replay_init_time 600 -retention 86400 -notification TRUE -drain_timeout 300 -stopoption IMMEDIATE -role PRIMARY
TAF Select Plus Service
$ srvctl add service -db mydb -service TAFSERVICE -pdb mypdb -preferred inst1 -available inst2
-failover_restore LEVEL1 -commit_outcome TRUE -failovertype SELECT -notification TRUE -drain_timeout 300
-stopoption TRANSACTIONAL -role PRIMARY
Service Attribute Validation Matrix
The following table describes service attribute dependency for FAILOVER_TYPE
and COMMIT_OUTCOME
driver attributes.
Table A-91 Service Attribute Dependency Validation
Parent Attribute | Value | Dependent Attribute | Valid Value |
---|---|---|---|
failover_type |
AUTO |
failover_restore |
AUTO | LEVEL1 |
failover_type |
AUTO |
session_state_consistency |
AUTO |
failover_type |
AUTO |
commit_outcome |
TRUE |
failover_type |
TRANSACTION |
failover_restore |
LEVEL1 | NONE | LEVEL2 |
failover_type |
TRANSACTION |
session_state_consistency |
DYNAMIC |
failover_type |
TRANSACTION |
commit_outcome |
TRUE |
failover_type |
SELECT |
failover_restore |
LEVEL1 | NONE |
failover_type |
SELECT |
failover_method |
BASIC | NONE |
failover_type |
SELECT |
commit_outcome |
TRUE | FALSE |
failover_type |
SESSION |
failover_restore |
NONE |
failover_type |
SESSION |
failover_method |
BASIC | NONE |
failover_type |
SESSION |
commit_outcome |
FALSE |
failover_type |
NONE |
failover_restore |
NONE |
failover_type |
NONE |
failover_method |
NONE |
failover_type |
NONE |
commit_outcome |
FALSE | TRUE |
commit_outcome |
FALSE |
commit_outcome_fastpath |