Skip Headers
Oracle® Database Administrator's Guide
11g Release 2 (11.2)

Part Number E25494-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

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

SRVCTL Command Reference for Oracle Restart

This section provides details about the syntax and options for SRVCTL commands specific to Oracle Restart. See Oracle Real Application Clusters Administration and Deployment Guide for the full list of SRVCTL commands.

ADMIN12739SRVCTL Command Syntax and Options Overview

SRVCTL expects the following command syntax:

srvctl command object options

where:

Note:

On the Windows platform, when specifying a comma-delimited list, you must enclose the list within double-quotes ("...,..."). You must also use double-quotes on the UNIX and Linux platforms if any list member contains shell metacharacters.

ADMIN12832Case Sensitivity SRVCTL commands and components are case insensitive. Options are case sensitive. Database and database service names are case insensitive and case preserving.

ADMIN12950Table 4-7 Summary of SRVCTL Commands

Command Description

add

Adds a component to the Oracle Restart configuration.

config

Displays the Oracle Restart configuration for a component.

disable

Disables management by Oracle Restart for a component.

enable

Reenables management by Oracle Restart for a component.

getenv

Displays environment variables in the Oracle Restart configuration for a database, Oracle ASM instance, or listener.

modify

Modifies the Oracle Restart configuration for a component.

remove

Removes a component from the Oracle Restart configuration.

setenv

Sets environment variables in the Oracle Restart configuration for a database, Oracle ASM instance, or listener.

start

Starts the specified component.

status

Displays the running status of the specified component.

stop

Stops the specified component.

unsetenv

Unsets environment variables in the Oracle Restart configuration for a database, Oracle ASM instance, or listener.


ADMIN12740SRVCTL Components Summary

Table 4-8 lists the keywords that can be used for the object portion of SRVCTL commands. You can use either the full name or the abbreviation for each component keyword.

ADMIN12951Table 4-8 Component Keywords and Abbreviations

Component Abbreviation Description

asm

asm

Oracle ASM instance

database

db

Database instance

diskgroup

dg

Oracle ASM disk group

filesystem

filesystem

Oracle ASM file system

home

home

Oracle home or Oracle Clusterware home

listener

lsnr

Oracle Net listener

service

serv

Database service

ons

ons

Oracle Notification Services (ONS)


ADMIN5009

add

The srvctl add command adds the specified component to the Oracle Restart configuration, and optionally sets Oracle Restart configuration parameters for the component. After a component is added, Oracle Restart begins to manage it, restarting it when required.

To perform srvctl add operations, you must be logged in to the database host computer with the proper user account. See "Preparing to Run SRVCTL" for more information.

ADMIN12952Table 4-9 srvctl add Summary

Command Description

srvctl add asm

Adds an Oracle ASM instance.

srvctl add database

Adds a database.

srvctl add listener

Adds a listener.

srvctl add ons

Adds an ONS (used by Oracle Data Guard configurations with Oracle Data Guard Broker).

srvctl add service

Adds a database service managed by Oracle Restart.


Note:

There is no srvctl add command for Oracle ASM disk groups. Disk groups are automatically added to the Oracle Restart configuration when they are first mounted. If you remove a disk group from the Oracle Restart configuration and later want to add it back, connect to the Oracle ASM instance with SQL*Plus and use an ALTER DISKGROUP ... MOUNT command.
ADMIN5015

srvctl add asm

Adds an Oracle ASM instance to the Oracle Restart configuration.

ADMIN12741

Syntax and Options

Use the srvctl add asm command with the following syntax:

srvctl add asm [-l listener_name [-p spfile] [-d asm_diskstring]]

ADMIN12953Table 4-10 srvctl add asm Options

Option Description
-l listener_name

Name of the listener with which Oracle ASM should register. A weak dependency is established with this listener. (Before starting the Oracle ASM instance, Oracle Restart attempts to start the listener. If the listener does not start, the Oracle ASM instance is still started. If the listener later fails, Oracle Restart does not restart Oracle ASM.)

If omitted, defaults to the listener named listener.

-p spfile

The full path of the server parameter file for the database. If omitted, the default SPFILE is used.

-d asm_diskstring

Oracle ASM disk group discovery string. An Oracle ASM discovery string is a comma-delimited list of strings that limits the set of disks that an Oracle ASM instance discovers. The discovery strings can include wildcard characters. Only disks that match one of the strings are discovered.



ADMIN12742

Example

An example of this command is:

srvctl add asm -l crmlistener

See Also:

Oracle Automatic Storage Management Administrator's Guide for more information about Oracle ASM disk group discovery strings

ADMIN5011

srvctl add database

Adds a database to the Oracle Restart configuration.

After adding a database to the Oracle Restart configuration, if the database then accesses data in an Oracle ASM disk group, a dependency between the database that disk group is created. Oracle Restart then ensures that the disk group is mounted before attempting to start the database.

However, if the database and Oracle ASM instance are not running when you add the database to the Oracle Restart configuration, you must manually establish the dependency between the database and its disk groups by specifying the -a option in the SRVCTL command. See the example later in this section.

Important:

When you manually add a database to the Oracle Restart configuration, you must also add the Oracle grid infrastructure software owner as a member of the OSDBA group of that database. This is because the grid infrastructure components must be able to connect to the database as SYSDBA to start and stop the database.

For example, if the host user who installed the grid infrastructure home is named grid and the OSDBA group of the new database is named dba, then user grid must be a member of the dba group.

ADMIN12743

Syntax and Options

Use the srvctl add database command with the following syntax:

srvctl add database -d db_unique_name -o oracle_home [-m domain_name] 
  [-n db_name] [-p spfile] [-s start_options] [-t stop_options]
  [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}]
  [-y {automatic | manual}] [-a disk_group_list]

ADMIN12954Table 4-11 srvctl add database Options

Syntax Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-o Oracle_home

The full path of Oracle home for the database.

-m domain_name

The domain for the database. Must match the DB_DOMAIN initialization parameter

-n db_name

If provided, must match the DB_NAME initialization parameter setting. You must include this option if DB_NAME is different from the unique name given by the -d option

-p spfile

The full path of the server parameter file for the database. If omitted, the default SPFILE is used.

-s start_options

Startup options for the database (OPEN, MOUNT, or NOMOUNT). If omitted, defaults to OPEN.

-t stop_options

Shutdown options for the database (NORMAL, IMMEDIATE, TRANSACTIONAL, or ABORT). If omitted, defaults to IMMEDIATE.

-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}

The current role of the database (PRIMARY, PHYSICAL_STANDBY, SNAPSHOT_STANDBY, or LOGICAL_STANDBY). Applicable in Oracle Data Guard environments only.

-y {AUTOMATIC | MANUAL}

Management policy for the database. If AUTOMATIC (the default), the database is automatically restored to its previous running condition (started or stopped) upon restart of the database host computer. If MANUAL, the database is never automatically restarted upon restart of the database host computer. A MANUAL setting does not prevent Oracle Restart from monitoring the database while it is running and restarting it if a failure occurs.

-a disk_group_list

List of disk groups upon which the database is dependent. When starting the database, Oracle Restart first ensures that these disk groups are mounted. This option is required only if the database instance and the Oracle ASM instance are not started when adding the database. Otherwise, the dependency is recorded automatically between the database and its disk groups.



ADMIN12744

Examples

This example adds the database with the DB_UNIQUE_NAME dbcrm:

srvctl add database -d dbcrm -o /u01/app/oracle/product/11.2.0/dbhome_1

This example adds the same database and also establishes a dependency between the database and the disk groups DATA and RECOVERY.

srvctl add database -d dbcrm -o /u01/app/oracle/product/11.2.0/dbhome_1
  -a "DATA,RECOVERY"

ADMIN12745

srvctl add listener

Adds a listener to the Oracle Restart configuration.

ADMIN12833

Syntax and Options

Use the srvctl add listener command with the following syntax:

srvctl add listener [-l listener_name] [-p endpoints] [-s] [-o Oracle_home]

ADMIN12955Table 4-12 srvctl add listener Options

Option Description
-l listener_name

Listener name. If omitted, defaults to LISTENER

-p endpoints

Comma separated TCP ports or listener endpoints. If omitted, defaults to TCP:1521. endpoints syntax is:

"[TCP:]port[, ...] [/IPC:key] [/NMP:pipe_name] [/TCPS:s_port] [/SDP:port]"
-s

Skip checking for port conflicts with the supplied endpoints

-o Oracle_home

Oracle home for the listener. If omitted, the Oracle Grid Infrastructure home is assumed.



ADMIN12834

Example

The following command adds a listener (named LISTENER) running out of the database Oracle home and listening on TCP port 1522:

srvctl add listener -p TCP:1522 -o /u01/app/oracle/product/11.2.0/dbhome_1

ADMIN13206

srvctl add ons

Adds an ONS to an Oracle Restart configuration.

ONS must be added to an Oracle Restart configuration to enable the sending of Fast Application Notification (FAN) events after an Oracle Data Guard failover.

When ONS is added to an Oracle Restart configuration, it is initially disabled. You can enable it with the srvctl enable ons command.

ADMIN13207

Syntax and Options

Use the srvctl add ons command with the following syntax:

srvctl add ons [-e em_port] [-l ons_local_port] [-r ons_remote_port] [-t host[:port],[host[:port]...]] [-v]

ADMIN13208Table 4-13 srvctl add ons Options

Option Description
-e em_port

ONS listening port for Oracle Enterprise Manager. The default is 2016.

-l ons_local_port

ONS listening port for local client connections. The default is 6100.

-r ons_remote_port

ONS listening port for connections from remote hosts. The default is 6200.

-t host[:port],[host[:port],...

A list of host:port pairs of remote hosts that are part of the ONS network

Note: If port is not specified for a remote host, then ons_remote_port is used.

-v

Verbose output



ADMIN5013

srvctl add service

Adds a database service to the Oracle Restart configuration. Creates the database service if it does not exist. This method of creating a service is preferred over using the DBMS_SERVICE PL/SQL package.

ADMIN12748

Syntax and Options

Use the srvctl add service command with the following syntax:

srvctl add service -d db_unique_name -s service_name
  [-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]]
  [-y {AUTOMATIC | MANUAL}] [-e {NONE | SESSION | SELECT}] [-m {NONE | BASIC}]
  [-w integer] [-z integer] [-j {SHORT | LONG}]
  [-B {SERVICE_TIME | THROUGHPUT | NONE}] [-q {TRUE | FALSE}] -t edition_name

ADMIN12956Table 4-14 srvctl add service Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name

The database service name

-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]

A list of service roles. Applicable in Oracle Data Guard environments only. When this option is present, upon database startup, the service is started only when one of its service roles matches the current database role.

-y {AUTOMATIC | MANUAL}

Management policy for the service. If AUTOMATIC (the default), the service is automatically started upon restart of the database, either by a planned restart (with SRVCTL) or after a failure. Automatic restart is also subject to the service role, however (the -l option). If MANUAL, the service is never automatically restarted upon planned restart of the database (with SRVCTL). A MANUAL setting does not prevent Oracle Restart from monitoring the service when it is running and restarting it if a failure occurs.

-e {NONE |SESSION | SELECT}

Failover type. For standalone servers, applicable in Oracle Data Guard environments only.

-m {NONE | BASIC}

Failover method. For standalone servers, applicable in Oracle Data Guard environments only.

-w integer

Failover delay. For standalone servers, applicable in Oracle Data Guard environments only.

-z integer

Failover retries. For standalone servers, applicable in Oracle Data Guard environments only.

-j {SHORT | LONG}

Connection load balancing goal

-B {SERVICE_TIME | THROUGHPUT | NONE}

Run-time load balancing goal

-q {TRUE | FALSE}

Send Oracle Advanced Queuing (AQ) HA notifications. For standalone servers, applicable in Oracle Data Guard environments only.

-t 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 USE privilege on the specified edition. If the edition does not exist or if the connect user does not have USE privilege on the specified edition, then an error is raised.



ADMIN12749

Example

This example adds the sales service for the database with DB_UNIQUE_NAME dbcrm. The service is started only when dbcrm is in PRIMARY mode.

srvctl add service -d dbcrm -s sales -l PRIMARY

See Also:


ADMIN5016

config

The srvctl config command displays the Oracle Restart configuration of the specified component or set of components.

ADMIN12957Table 4-15 srvctl config Summary

Command Description

srvctl config asm

Displays the Oracle Restart configuration information for the Oracle ASM instance

srvctl config database

Displays the Oracle Restart configuration information for the specified database, or lists all databases managed by Oracle Restart

srvctl config listener

Displays the Oracle Restart configuration information for all listeners or for the specified listener

srvctl config ons

Displays the current configuration information for ONS.

srvctl config service

For the specified database, displays the Oracle Restart configuration information for the specified database service or for all database services


ADMIN5020

srvctl config asm

Displays the Oracle Restart configuration information for the Oracle ASM instance.

ADMIN12750

Syntax and Options

Use the srvctl config asm command with the following syntax:

srvctl config asm [-a]

ADMIN12958Table 4-16 srvctl config asm Options

Option Description
-a

Display enabled/disabled status also



ADMIN12751

Example

An example of this command is:

srvctl config asm -a

asm home: /u01/app/oracle/product/11.2.0/grid
ASM is enabled.

ADMIN5017

srvctl config database

Displays the Oracle Restart configuration information for the specified database, or lists all databases managed by Oracle Restart.

ADMIN12752

Syntax and Options

Use the srvctl config database command with the following syntax:

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

ADMIN12959Table 4-17 srvctl config database Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-a

Display enabled/disabled status also



ADMIN12753

Examples

An example of this command to list all Oracle Restart–managed databases is:

srvctl config database

dbcrm
orcl

An example of this command to display configuration and enabled/disabled status for the database with the DB_UNIQUE_ID orcl is:

srvctl config database -d orcl -a

Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/orcl/spfileorcl.ora
Domain: us.example.com
Start options: open
Stop options: immediate
Database role:
Management policy: automatic
Disk Groups: DATA
Services: mfg,sales
Database is enabled

ADMIN5099

srvctl config listener

Displays the Oracle Restart configuration information for all Oracle Restart–managed listeners or for the specified listener.

ADMIN12754

Syntax and Options

Use the srvctl config listener command with the following syntax:

srvctl config listener [-l listener_name]

ADMIN12960Table 4-18 srvctl config listener Options

Option Description
-l listener_name

Listener name. If omitted, configuration information for all Oracle Restart–managed listeners is displayed.



ADMIN12755

Example

This example displays the configuration information and enabled/disabled status for the default listener:

srvctl config listener

Name: LISTENER
Home: /u01/app/oracle/product/11.2.0/dbhome_1
End points: TCP:1521
Listener is enabled.

ADMIN13211

srvctl config ons

Displays the current configuration information for ONS.

ADMIN13212

Syntax and Options

Use the srvctl config ons command with the following syntax:

srvctl config ons

ADMIN5018

srvctl config service

For the specified database, displays the Oracle Restart configuration information for the specified database service or for all Oracle Restart–managed database services.

ADMIN12756

Syntax and Options

Use the srvctl config service command with the following syntax:

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

ADMIN12961Table 4-19 srvctl config service Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name

Database service name. If omitted, SRVCTL displays configuration information for all Oracle Restart–managed services for the database

-a

Display detailed configuration information



ADMIN12757

Example

An example of this command is:

srvctl config service -d dbcrm -s sales

Service name: sales
Service is enabled
Cardinality: SINGLETON
Disconnect: true
Service role: PRIMARY
Management policy: automatic
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: NONE
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition: e2

ADMIN5026

disable

Disables a component, which suspends management of that component by Oracle Restart. The srvctl disable command is intended to be used when a component must be repaired or shut down for maintenance, and should not be restarted automatically. When you disable a component:

To perform srvctl disable operations, you must be logged in to the database host computer with the proper user account. See "Preparing to Run SRVCTL" for more information.

See Also:

The enable command

ADMIN12962Table 4-20 srvctl disable Summary

Command Description

srvctl disable asm

Disables the Oracle ASM instance

srvctl disable database

Disables a database

srvctl disable diskgroup

Disables an Oracle ASM disk group

srvctl disable listener

Disables the specified listener or all listeners

srvctl disable ons

Disables ONS

srvctl disable service

Disables one or more database services for the specified database


ADMIN5030

srvctl disable asm

Disables the Oracle ASM instance.

ADMIN12764

Syntax and Options

Use the srvctl disable asm command with the following syntax:

srvctl disable asm

ADMIN03262

srvctl disable database

Disables the specified database.

ADMIN12766

Syntax and Options

Use the srvctl disable database command with the following syntax:

srvctl disable database -d db_unique_name

ADMIN12963Table 4-21 srvctl disable database Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.



ADMIN12767

Example

An example of this command is:

srvctl disable database -d dbcrm

ADMIN12835

srvctl disable diskgroup

Disables an Oracle ASM disk group.

ADMIN12836

Syntax and Options

Use the srvctl disable diskgroup command with the following syntax:

srvctl disable diskgroup -g diskgroup_name

ADMIN12964Table 4-22 srvctl disable diskgroup Options

Option Description
-g diskgroup_name

Disk group name



ADMIN12837

Example

An example of this command is:

srvctl disable diskgroup -g DATA

ADMIN12838

srvctl disable listener

Disables the specified listener or all listeners.

ADMIN12839

Syntax and Options

Use the srvctl disable listener command with the following syntax:

srvctl disable listener [-l listener_name]

ADMIN12965Table 4-23 srvctl disable listener Options

Option Description
-l listener_name

Listener name. If omitted, all listeners are disabled.



ADMIN12840

Example

An example of this command is:

srvctl disable listener -l crmlistener

ADMIN13216

srvctl disable ons

Disables ONS.

ADMIN13217

Syntax and Options

Use the srvctl disable ons command with the following syntax:

srvctl disable ons -v

ADMIN13218Table 4-24 srvctl disable ons Options

Option Description
-v

Verbose output



ADMIN5029

srvctl disable service

Disables one or more database services.

ADMIN12768

Syntax and Options

Use the srvctl disable service command with the following syntax:

srvctl disable service -d db_unique_name -s service_name_list

ADMIN12966Table 4-25 srvctl disable service Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name_list

Comma-delimited list of database service names



ADMIN12769

Example

The following example disables the database service sales and mfg:

srvctl disable service -d dbcrm -s sales,mfg

ADMIN5021

enable

The srvctl enable command reenables the specified disabled component so that:

If the component is already enabled, then the command is ignored.

When you add a component to the Oracle Restart configuration, it is enabled by default.

To perform srvctl enable operations, you must be logged in to the database host computer with the proper user account. See "Preparing to Run SRVCTL" for more information.

ADMIN12967Table 4-26 srvctl enable Summary

Command Description

srvctl enable asm

Enables an Oracle ASM instance.

srvctl enable database

Enables a database.

srvctl enable diskgroup

Enables an Oracle ASM disk group.

srvctl enable listener

Enables the specified listener or all listeners.

srvctl enable ons

Enables ONS.

srvctl enable service

Enables one or more database services for the specified database.


See Also:

The disable command
ADMIN5025

srvctl enable asm

Enables an Oracle ASM instance.

ADMIN12758

Syntax and Options

Use the srvctl enable asm command with the following syntax:

srvctl enable asm

ADMIN5022

srvctl enable database

Enables the specified database.

ADMIN12760

Syntax and Options

Use the srvctl enable database command with the following syntax:

srvctl enable database -d db_unique_name

ADMIN12968Table 4-27 srvctl enable database Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.



ADMIN12761

Example

An example of this command is:

srvctl enable database -d dbcrm

ADMIN12841

srvctl enable diskgroup

Enables an Oracle ASM disk group.

ADMIN12842

Syntax and Options

Use the srvctl enable diskgroup command with the following syntax:

srvctl enable diskgroup -g diskgroup_name

ADMIN12969Table 4-28 srvctl enable diskgroup Options

Option Description
-g diskgroup_name

Disk group name



ADMIN12843

Example

An example of this command is:

srvctl enable diskgroup -g DATA

ADMIN12844

srvctl enable listener

Enables the specified listener or all listeners.

ADMIN12845

Syntax and Options

Use the srvctl enable listener command with the following syntax:

srvctl enable listener [-l listener_name]

ADMIN12970Table 4-29 srvctl enable listener Options

Option Description
-l listener_name

Listener name. If omitted, all listeners are enabled.



ADMIN12846

Example

An example of this command is:

srvctl enable listener -l crmlistener

ADMIN13222

srvctl enable ons

Enables ONS.

ADMIN13223

Syntax and Options

Use the srvctl enable ons command with the following syntax:

srvctl enable ons -v

ADMIN13224Table 4-30 srvctl enable ons Options

Option Description
-v

Verbose output



ADMIN5024

srvctl enable service

Enables one or more database services for the specified database.

ADMIN12762

Syntax and Options

Use the srvctl enable service command with the following syntax:

srvctl enable service -d db_unique_name -s service_name_list

ADMIN12971Table 4-31 srvctl enable service Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name_list

Comma-delimited list of database service names



ADMIN12763

Examples

The following example enables the database services sales and mfg in the database with DB_UNIQUE_NAME dbcrm:

srvctl enable service -d dbcrm -s "sales,mfg"

ADMIN5058

getenv

Gets and displays environment variables and their values from the Oracle Restart configuration for a database, listener, or Oracle ASM instance.

ADMIN12972Table 4-32 srvctl getenv Summary

Command Description

srvctl getenv asm

Displays the configured environment variables for the Oracle ASM instance

srvctl getenv database

Displays the configured environment variables for the specified database instance

srvctl getenv listener

Displays the configured environment variables for the specified listener


ADMIN12847

srvctl getenv asm

Displays the configured environment variables for the Oracle ASM instance.

ADMIN12848

Syntax and Options

Use the srvctl getenv asm command with the following syntax:

srvctl getenv asm [-t name_list]

ADMIN12973Table 4-33 srvctl getenv asm Options

Options Description
-t name_list

Comma-delimited list of names of environment variables to display. If omitted, SRVCTL displays all configured environment variables for Oracle ASM.



ADMIN12849

Example

The following example displays all configured environment variables for the Oracle ASM instance:

srvctl getenv asm

ADMIN12850

srvctl getenv database

Displays the configured environment variables for the specified database.

ADMIN12851

Syntax and Options

Use the srvctl getenv database command with the following syntax:

srvctl getenv database -d db_unique_name [-t name_list]

ADMIN12974Table 4-34 srvctl getenv database Options

Options Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-t name_list

Comma-delimited list of names of environment variables to display. If omitted, SRVCTL displays all configured environment variables.



ADMIN12852

Example

The following example displays all configured environment variables for the database with DB_UNIQUE_NAME dbcrm:

srvctl getenv database -d dbcrm

ADMIN12853

srvctl getenv listener

Displays the configured environment variables for the specified listener.

ADMIN12854

Syntax and Options

Use the srvctl getenv listener command with the following syntax:

srvctl getenv listener [-l listener_name] [-t name_list]

ADMIN12975Table 4-35 srvctl getenv listener Options

Options Description
-l listener_name

Listener name. If omitted, SRVCTL lists environment variables for all listeners.

-t name_list

Comma-delimited list of names of environment variables to display. If omitted, SRVCTL displays all configured environment variables.



ADMIN12855

Example

The following example displays all configured environment variables for the listener named crmlistener:

srvctl getenv listener -l crmlistener

ADMIN5044

modify

Modifies the Oracle Restart configuration of a component. The change takes effect when the component is next restarted.

To perform srvctl modify operations, you must be logged in to the database host computer with the proper user account. See "Preparing to Run SRVCTL" for more information.

ADMIN12976Table 4-36 srvctl modify Summary

Command Description

srvctl modify asm

Modifies the configuration for Oracle ASM

srvctl modify database

Modifies the configuration for a database

srvctl modify listener

Modifies the configuration for the specified listener or all listeners

srvctl modify ons

Modifies ONS

srvctl modify service

Modifies the configuration for a database service


ADMIN12789

srvctl modify asm

Modifies the Oracle Restart configuration for the Oracle ASM instance.

ADMIN12790

Syntax and Options

Use the srvctl modify asm command with the following syntax:

srvctl modify asm [-l listener_name] [-p spfile] [-d asm_diskstring]

ADMIN12977Table 4-37 srvctl modify asm Options

Option Description
-l listener_name

Name of the listener with which Oracle ASM must register. A weak dependency is established with this listener. (Before Oracle ASM is started, Oracle Restart ensures that this listener is started.)

-p spfile

The full path of the server parameter file for the database. If omitted, the default SPFILE is used.

-d asm_diskstring

Oracle ASM disk group discovery string. An Oracle ASM discovery string is a comma-delimited list of strings that limits the set of disks that an Oracle ASM instance discovers. The discovery strings can include wildcard characters. Only disks that match one of the strings are discovered.



ADMIN12791

Example

An example of this command is:

srvctl modify asm -l crmlistener

See Also:

Oracle Automatic Storage Management Administrator's Guide for more information about Oracle ASM disk group discovery strings

ADMIN5045

srvctl modify database

Modifies the Oracle Restart configuration for a database.

ADMIN12792

Syntax and Options

Use the srvctl modify database command with the following syntax:

srvctl modify database -d db_unique_name [-o oracle_home] [-u oracle_user] 
  [-m domain_name] [-n db_name] [-p spfile] [-s start_options] 
  [-t stop_options] [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | 
  SNAPSHOT_STANDBY}] [-y {automatic | manual}] [-a disk_group_list] [-z]

ADMIN12978Table 4-38 srvctl modify database Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-u oracle_user

Name of the Oracle user who owns the Oracle home directory

-z

Remove the database's dependency on Oracle ASM disk groups

(Other options)

See Table 4-11



ADMIN12793

Example

The following example changes the role of the database with DB_UNIQUE_NAME dbcrm to LOGICAL_STANDBY:

srvctl modify database -d dbcrm -r logical_standby

ADMIN5098

srvctl modify listener

Modifies the Oracle Restart configuration for the specified listener or all listeners.

ADMIN12794

Syntax and Options

Use the srvctl modify listener command with the following syntax:

srvctl modify listener [-l listener_name] [-p endpoints] [-o Oracle_home]

ADMIN12979Table 4-39 srvctl modify listener Options

Option Description
-l listener_name

Listener name. If omitted, all listener configurations are modified.

-p endpoints

Comma separated TCP ports or listener endpoints. endpoints syntax is:

"[TCP:]port[, ...] [/IPC:key] [/NMP:pipe_name] [/TCPS:s_port] [/SDP:port]"
-o Oracle_home

New Oracle home for the listener



ADMIN12795

Example

This example modifies the TCP port on which the listener named crmlistener listens:

srvctl modify listener -l crmlistener -p TCP:1522

ADMIN13228

srvctl modify ons

Modifies ONS.

ADMIN13229

Syntax and Options

Use the srvctl modify ons command with the following syntax:

srvctl modify ons [-e em_port] [-l ons_local_port] [-r ons_remote_port] [-t host[:port],[host[:port]...]] [-v]

ADMIN13230Table 4-40 srvctl modify ons Options

Option Description
-e em_port

ONS listening port for Oracle Enterprise Manager. The default is 2016.

-l ons_local_port

ONS listening port for local client connections

-r ons_remote_port

ONS listening port for connections from remote hosts

-t host[:port],[host[:port],...

A list of host:port pairs of remote hosts that are part of the ONS network

Note: If port is not specified for a remote host, then ons_remote_port is used.

-v

Verbose output



ADMIN5047

srvctl modify service

Modifies the Oracle Restart configuration of a database service.

Important:

Oracle recommends that you limit configuration changes to the minimum requirement and that you not perform other service operations while the online service modification is in progress.
ADMIN12796

Syntax and Options

Use the srvctl modify service command with the following syntax:

srvctl modify service -d db_unique_name -s service_name]
  [-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]]
  [-y {AUTOMATIC | MANUAL}] [-e {NONE | SESSION | SELECT}] [-m {NONE | BASIC}]
  [-w integer] [-z integer] [-j {SHORT | LONG}]
  [-B {SERVICE_TIME | THROUGHPUT | NONE}] [-q {TRUE | FALSE}] -t edition_name

ADMIN12980Table 4-41 srvctl modify service Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name

Service name

-t edition_name

The initial session edition of the service

If this option is not specified, then the edition is not modified for the service.

If this option is specified but edition_name is empty, then the edition is set to NULL. A NULL edition has no effect.

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 USE privilege on the specified edition. If the edition does not exist or if the connect user does not have USE privilege on the specified edition, then an error is raised.

(other options)

See Table 4-14



ADMIN12798

Example

For the database with a DB_UNIQUE_NAME of dbcrm, the following command changes the Oracle Data Guard role of the database service named support to standby:

srvctl modify service -d dbcrm -s support -l standby

ADMIN5072

remove

Removes the specified component from the Oracle Restart configuration. Oracle Restart no longer manages the component. Any environment variable settings for the component are also removed.

Before you remove a component from the Oracle Restart configuration, you must use SRVCTL to stop it. Oracle recommends that you disable the component before removing it, but this is not required.

To perform srvctl remove operations, you must be logged in to the database host computer with the proper user account. See "Preparing to Run SRVCTL" for more information.

ADMIN12981Table 4-42 srvctl remove Summary

Command Description

srvctl remove asm

Removes the Oracle ASM instance

srvctl remove database

Removes a database

srvctl remove diskgroup

Removes an Oracle ASM disk group

srvctl remove listener

Removes a listener

srvctl remove ons

Removes an ONS

srvctl remove service

Removes one or more database services


See Also:

ADMIN5077

srvctl remove asm

Removes an Oracle ASM instance.

ADMIN12813

Syntax and Options

Use the srvctl remove asm command with the following syntax:

srvctl remove asm  [-f]

ADMIN12982Table 4-43 srvctl remove asm Options

Options Description
-f

Force remove, even when disk groups and databases that use Oracle ASM exist or when the Oracle ASM instance is running.



ADMIN12856

Example

An example of this command is:

srvctl remove asm

ADMIN5073

srvctl remove database

Removes a database. Prompts for confirmation first.

ADMIN12814

Syntax and Options

Use the srvctl remove database command with the following syntax:

srvctl remove database -d db_unique_name [-f] [-y] [-v]

ADMIN12983Table 4-44 srvctl remove database Options

Options Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-f

Force. Removes the database even if it is running.

-y

Suppresses the confirmation prompt and removes immediately

-v

Verbose output. A success or failure message is displayed.



ADMIN12857

Example

An example of this command is:

srvctl remove database -d dbcrm

ADMIN12858

srvctl remove diskgroup

Removes an Oracle ASM disk group.

ADMIN12859

Syntax and Options

Use the srvctl remove diskgroup command with the following syntax:

srvctl remove diskgroup -g diskgroup_name [-f]

ADMIN12984Table 4-45 srvctl remove diskgroup Options

Option Description
-g diskgroup_name

Disk group name

-f

Force. Removes the disk group even if files are open on it.



ADMIN12860

Examples

This example removes the disk group named DATA. An error is returned if files are open on this disk group.

srvctl remove diskgroup -g DATA

ADMIN12816

srvctl remove listener

Removes the specified listener or all listeners.

ADMIN12817

Syntax and Options

Use the srvctl remove listener command with the following syntax:

srvctl remove listener [-l listener_name] [-a] [-f]

ADMIN12985Table 4-46 srvctl remove listener Options

Options Description
-l listener_name

Name of the listener that you want to remove. If omitted, then the default is LISTENER.

-a

Remove all listeners

-f

Force. Removes the listener even if databases are using it.



ADMIN12818

Example

The following command removes the listener lsnr01:

srvctl remove listener -l lsnr01

ADMIN13234

srvctl remove ons

Removes ONS.

ADMIN13235

Syntax and Options

Use the srvctl remove ons command as follows:

srvctl remove ons -f -v

ADMIN13236Table 4-47 srvctl remove ons Options

Options Description
-f

Force. Removes ONS even if it is enabled.

-v

Verbose output



ADMIN5075

srvctl remove service

Removes the specified database service.

ADMIN12819

Syntax and Options

Use the srvctl remove service command as follows:

srvctl remove service -d db_unique_name -s service_name] [-f]

ADMIN12986Table 4-48 srvctl remove service Options

Options Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name

Service name

-f

Force. Removes the service even if the service is running. Transactions in any active sessions that are connected to the service are rolled back and sessions are disconnected.



ADMIN12820

Example

An example of this command is:

srvctl remove service -d dbcrm -s sales

ADMIN12806

setenv

The setenv command sets values of environment variables in the Oracle Restart configuration for a database, a listener, or the Oracle ASM instance.

To perform srvctl setenv operations, you must be logged in to the database host computer with the proper user account. See "Preparing to Run SRVCTL" for more information.

ADMIN12987Table 4-49 srvctl setenv and unsetenv Summary

Command Description

srvctl setenv asm

Sets environment variables in the Oracle Restart configuration for an Oracle ASM instance

srvctl setenv database

Sets environment variables in the Oracle Restart configuration for a database instance

srvctl setenv listener

Sets environment variables in the Oracle Restart configuration for the specified listener or all listeners


ADMIN12861

srvctl setenv asm

Sets the values of environment variables in the Oracle Restart configuration for the Oracle ASM instance. Before starting the instance, Oracle Restart sets environment variables to the values stored in the configuration.

ADMIN12862

Syntax and Options

Use the srvctl setenv asm command with the following syntax:

srvctl setenv asm {-t name=val[,name=val,...] | -T name=val}

ADMIN12988Table 4-50 srvctl setenv database Options

Options Description
-t name=val[,name=val,...]

Comma-delimited list of name/value pairs of environment variables

-T name=val

Enables single environment variable to be set to a value that contains commas or other special characters



ADMIN12863

Example

The following example sets the AIX operating system environment variable AIXTHREAD_SCOPE in the Oracle ASM instance configuration:

srvctl setenv asm -t AIXTHREAD_SCOPE=S

ADMIN12864

srvctl setenv database

Sets the values of environment variables in the Oracle Restart configuration for a database instance. Before starting the instance, Oracle Restart sets environment variables to the values stored in the configuration.

ADMIN12865

Syntax and Options

Use the srvctl setenv database command with the following syntax:

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

ADMIN12989Table 4-51 srvctl setenv database Options

Options Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-t name=val[,name=val,...]

Comma-delimited list of name/value pairs of environment variables

-T name=val

Enables single environment variable to be set to a value that contains commas or other special characters



ADMIN12866

Example

The following example sets the LANG environment variable in the configuration of the database with a DB_UNIQUE_NAME of dbcrm:

srvctl setenv database -d dbcrm -t LANG=en

ADMIN12867

srvctl setenv listener

Sets the values of environment variables in the Oracle Restart configuration for a listener. Before starting the listener, Oracle Restart sets environment variables to the values stored in the configuration.

ADMIN12868

Syntax and Options

Use the srvctl setenv listener command with the following syntax:

srvctl setenv listener [-l listener_name] {-t name=val[,name=val,...] | 
  -T name=val}

ADMIN12990Table 4-52 srvctl setenv listener Options

Options Description
-l listener_name

Listener name. If omitted, sets the specified environment variables in all listener configurations.

-t name=val[,name=val,...]

Comma-delimited list of name/value pairs of environment variables

-T name=val

Enables single environment variable to be set to a value that contains commas or other special characters



ADMIN12869

Example

The following example sets the AIX operating system environment variable AIXTHREAD_SCOPE in the configuration of the listener named crmlistener:

srvctl setenv listener -l crmlistener -t AIXTHREAD_SCOPE=S

ADMIN5031

start

Starts the specified component or components.

ADMIN12991Table 4-53 srvctl start Summary

Command Description

srvctl start asm

Starts the Oracle ASM instance

srvctl start database

Starts the specified database

srvctl start diskgroup

Starts (mounts) the specified Oracle ASM disk group

srvctl start home

Starts all of the components managed by Oracle Restart in the specified Oracle home

srvctl start listener

Starts the specified listener or all Oracle Restart–managed listeners

srvctl start ons

Starts ONS

srvctl start service

Starts the specified database service or services


ADMIN5036

srvctl start asm

Starts the Oracle ASM instance.

For this command, SRVCTL connects "/ as sysasm" to perform the operation. To run such operations, the owner of the executables in the Oracle Grid Infrastructure home must be a member of the OSASM group, and users running the commands must also be in the OSASM group.

ADMIN12770

Syntax and Options

Use the srvctl start asm command with the following syntax:

srvctl start asm [-o start_options]

ADMIN12992Table 4-54 srvctl start asm Option

Option Description
-o start_options

Comma-delimited list of options for the startup command (OPEN, MOUNT, NOMOUNT, or FORCE). If omitted, defaults to normal startup (OPEN).



ADMIN12771

Examples

This example starts the Oracle ASM instance, which then mounts any disk groups named in the ASM_DISKGROUPS initialization parameter:

srvctl start asm

This example starts the Oracle ASM instance without mounting any disk groups:

srvctl start asm -o nomount

ADMIN5032

srvctl start database

Starts the specified database instance.

For this command, SRVCTL connects "/ as sysdba" to perform the operation. To run such operations, the owner of the Oracle executables in the database Oracle home must be a member of the OSDBA group (for example, the dba group on UNIX and Linux), and users running the commands must also be in the OSDBA group.

ADMIN12772

Syntax and Options

Use the srvctl start database command with the following syntax:

srvctl start database -d db_unique_name [-o start_options]

ADMIN12993Table 4-55 srvctl start database Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-o start_options

Comma-delimited list of options for the startup command (for example: OPEN, MOUNT, NOMOUNT, RESTRICT, PFILE=path, and so on)



ADMIN12773

Example

An example of this command is:

srvctl start database -d dbcrm -o pfile=testparm,nomount

ADMIN12870

srvctl start diskgroup

Starts (mounts) an Oracle ASM disk group.

ADMIN12871

Syntax and Options

Use the srvctl start diskgroup command with the following syntax:

srvctl start diskgroup -g diskgroup_name

ADMIN12994Table 4-56 srvctl start diskgroup Options

Option Description
-g diskgroup_name

Disk group name



ADMIN12872

Example

An example of this command is:

srvctl start diskgroup -g DATA

ADMIN13240

srvctl start home

Starts all of the components that are managed by Oracle Restart in the specified Oracle home. The Oracle home can be an Oracle Database home or an Oracle Grid Infrastructure home.

This command starts the components that were stopped by a srvctl stop home. This command uses the information in the specified state file to identify the components to start.

Note:

Use this command to restart components after you install a patch in an Oracle home.
ADMIN13241

Syntax and Options

Use the srvctl start home command with the following syntax:

srvctl start home -o oracle_home -s state_file

ADMIN13242Table 4-57 srvctl start home Options

Option Description

-o

Complete path of the Oracle home

-s

Complete path of the state file. The state file contains the current state information for the components in the Oracle home and is created when the srvctl stop home command or the srvctl status home command is run.



ADMIN5097

srvctl start listener

Starts the specified listener or all listeners.

ADMIN12776

Syntax and Options

Use the srvctl start listener command with the following syntax:

srvctl start listener [-l listener_name]

ADMIN12995Table 4-58 srvctl start listener Options

Option Description
-l listener_name

Listener name. If omitted, all Oracle Restart–managed listeners are started.



ADMIN12873

Example

An example of this command is:

srvctl start listener -l listener

ADMIN13243

srvctl start ons

Starts ONS.

ADMIN13244

Syntax and Options

Use the srvctl start ons command with the following syntax:

srvctl start ons -v

ADMIN13245Table 4-59 srvctl start ons Options

Option Description
-v

Verbose output



ADMIN5034

srvctl start service

Starts the specified database service or services.

ADMIN12778

Syntax and Options

Use the srvctl start service command with the following syntax:

srvctl start service -d db_unique_name [-s service_name_list] [-o start_options]

ADMIN12996Table 4-60 srvctl start service Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name_list

Comma-delimited list of service names. The service name list is optional and if not provided, SRVCTL starts all of the database's services

-o start_options

Options for database startup (for example: OPEN, MOUNT, NOMOUNT and so on) if the database must be started first



ADMIN12779

Example

For the database with a DB_UNIQUE_NAME of dbcrm, the following example starts the sales database service:

srvctl start service -d dbcrm -s sales

ADMIN5052

status

Displays the running status of the specified component or set of components.

ADMIN12997Table 4-61 srvctl status Summary

Command Description

srvctl status asm

Displays the running status of the Oracle ASM instance

srvctl status database

Displays the running status of a database

srvctl status diskgroup

Displays the running status of an Oracle ASM disk group

srvctl status home

Displays the running status of all of the components that are managed by Oracle Restart in the specified Oracle home

srvctl status listener

Displays the running status of the specified listener or all Oracle Restart–managed listeners

srvctl status ons

Displays the running status of ONS

srvctl status service

Displays the running status of one or more services


ADMIN5057

srvctl status asm

Displays the running status of the Oracle ASM instance.

ADMIN12799

Syntax and Options

Use the srvctl status asm command with the following syntax:

srvctl status asm [-a]

ADMIN12998Table 4-62 srvctl status asm Options

Option Description
-a

Display enabled/disabled status also



ADMIN12874

Example

An example of this command is:

srvctl status asm

ASM is running on dbhost

ADMIN5053

srvctl status database

Displays the running status of the specified database.

ADMIN12800

Syntax and Options

Use the srvctl status database command with the following syntax:

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

ADMIN12999Table 4-63 srvctl status database Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-f

Display a message if the database is disabled

-v

Verbose output. Lists the database services that are running.



ADMIN12875

Example

An example of this command is:

srvctl status database -d dbcrm -v

Database dbcrm is running with online services mfg,sales

ADMIN12876

srvctl status diskgroup

Displays the running status of an Oracle ASM disk group.

ADMIN12877

Syntax and Options

Use the srvctl status diskgroup command with the following syntax:

srvctl status diskgroup -g diskgroup_name [-a]

ADMIN13000Table 4-64 srvctl status diskgroup Options

Option Description
-g diskgroup_name

Disk group name

-a

Display enabled/disabled status also



ADMIN12878

Example

An example of this command is:

srvctl status diskgroup -g DATA

Disk Group DATA is running on dbhost

ADMIN13248

srvctl status home

Displays the running status of all of the components that are managed by Oracle Restart in the specified Oracle home. The Oracle home can be an Oracle Database home or an Oracle Grid Infrastructure home.

This command writes the current status of the components to the specified state file.

ADMIN13249

Syntax and Options

Use the srvctl status home command with the following syntax:

srvctl status home -o oracle_home -s state_file

ADMIN13250Table 4-65 srvctl status home Options

Option Description

-o

Complete path of the Oracle home

-s

Complete path of the state file



ADMIN12879

srvctl status listener

Displays the running status of the specified listener or of all Oracle Restart–managed listeners.

ADMIN12880

Syntax and Options

Use the srvctl status listener command with the following syntax:

srvctl status listener -l listener_name

ADMIN13001Table 4-66 srvctl status listener Options

Option Description
-l listener_name

Listener name. If omitted, the status of all listeners is displayed.



ADMIN12881

Example

An example of this command is:

srvctl status listener -l crmlistener

Listener CRMLISTENER is running on dbhost

ADMIN13251

srvctl status ons

Displays the running status of ONS.

ADMIN13252

Syntax and Options

Use the srvctl status ons command with the following syntax:

srvctl status ons

ADMIN5055

srvctl status service

Displays the running status of one or more database services.

ADMIN12802

Syntax and Options

Use the srvctl status service command with the following syntax:

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

ADMIN13002Table 4-67 srvctl status service Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name_list

Comma-delimited list of service names. If omitted, status is listed for all database services for the designated database.

-f

Display a message if a service is disabled

-v

Verbose output



ADMIN12803

Example

For the database with the DB_UNIQUE_NAME of dbcrm, the following example displays the running status of the service sales:

srvctl status service -d dbcrm -s sales

Service sales is running on dbhost

ADMIN5037

stop

Stops the specified component or components.

If you want a component to remain stopped after you issue a srvctl stop command, disable the component. See the disable command.

Note:

If a component is stopped and is not disabled, it could restart as a result of another planned operation. That is, although a stopped component will not restart as a result of a failure, it might be started if a dependent component is started with a srvctl start command.

ADMIN13003Table 4-68 srvctl stop Summary

Command Description

srvctl stop asm

Stops the Oracle ASM instance

srvctl stop database

Stops the specified database instance

srvctl stop diskgroup

Stops (dismounts) the specified Oracle ASM disk group

srvctl stop home

Stops all of the components managed by Oracle Restart in the specified Oracle home

srvctl stop listener

Stops the specified listener or all listeners

srvctl stop ons

Stops ONS

srvctl stop service

Stops the specified database service or services


ADMIN5043

srvctl stop asm

Stops the Oracle ASM instance.

ADMIN12780

Syntax and Options

Use the srvctl stop asm command with the following syntax:

srvctl stop asm [-o stop_options] [-f]

ADMIN13004Table 4-69 srvctl stop asm Option

Option Description
-o stop_options

Options for the shutdown operation, for example, NORMAL, TRANSACTIONAL, IMMEDIATE, or ABORT

-f

Force. Must be present if disk groups are currently started (mounted). This option enables SRVCTL to stop the disk groups before stopping Oracle ASM. Each dependent database instance is also stopped according to its stop options, or with the ABORT option if the configured stop options fail.



ADMIN12781

Example

An example of this command is:

srvctl stop asm -o abort -f

ADMIN5039

srvctl stop database

Stops a database.

ADMIN12782

Syntax and Options

Use the srvctl stop database command with the following syntax:

srvctl stop database -d db_unique_name [-o stop_options] [-f]

ADMIN13005Table 4-70 srvctl stop database Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-o stop_options

SHUTDOWN command options (for example: NORMAL, TRANSACTIONAL, IMMEDIATE, or ABORT). Default is IMMEDIATE.

-f

Force. Performs a SHUTDOWN ABORT of the database.



ADMIN12783

Example

An example of this command is:

srvctl stop database -d dbcrm

ADMIN12882

srvctl stop diskgroup

Stops (dismounts) an Oracle ASM disk group.

ADMIN12883

Syntax and Options

Use the srvctl stop diskgroup command with the following syntax:

srvctl stop diskgroup -g diskgroup_name [-f]

ADMIN13006Table 4-71 srvctl stop diskgroup Options

Option Description
-g diskgroup_name

Disk group name

-f

Force. Dismount the disk group even if some files in the disk group are open.



ADMIN12884

Examples

This example stops the disk group named DATA. An error is returned if files are open on this disk group.

srvctl stop diskgroup -g DATA

ADMIN13256

srvctl stop home

Stops all of the components that are managed by Oracle Restart in the specified Oracle home. The Oracle home can be an Oracle Database home or an Oracle Grid Infrastructure home.

This command identifies the components that it stopped in the specified state file.

Note:

  • Before stopping the components in an Oracle Grid Infrastructure home, stop the components in a dependent Oracle Database home.

  • Use this command to stop components before you install a patch in an Oracle home.

ADMIN13257

Syntax and Options

Use the srvctl stop home command with the following syntax:

srvctl stop home -o oracle_home -s state_file [-t stop_options] [-f]

ADMIN13258Table 4-72 srvctl stop home Options

Option Description

-o

Complete path of the Oracle home

-s

Complete path of the state file

-t stop_options

SHUTDOWN command options for the database (for example: NORMAL, TRANSACTIONAL, IMMEDIATE, or ABORT). Default is IMMEDIATE.

-f

Force stop each component



ADMIN12784

srvctl stop listener

Stops the designated listener or all Oracle Restart–managed listeners. Stopping a listener does not cause databases that are registered with the listener to be stopped.

ADMIN12785

Syntax and Options

Use the srvctl stop listener command with the following syntax:

srvctl stop listener [-l listener_name] [-f]

ADMIN13007Table 4-73 srvctl stop listener Options

Option Description
-l listener_name

Listener name. If omitted, all Oracle Restart–managed listeners are stopped.

-f

Force. Passes the stop command with the -f option to Oracle Clusterware. See Oracle Clusterware Administration and Deployment Guide for more information about the Oracle Clusterware -f option.



ADMIN12786

Example

An example of this command is:

srvctl stop listener -l crmlistener

ADMIN13259

srvctl stop ons

Stops ONS.

ADMIN13260

Syntax and Options

Use the srvctl stop ons command with the following syntax:

srvctl stop ons -v

ADMIN13261Table 4-74 srvctl stop ons Options

Option Description
-v

Verbose output



ADMIN5041

srvctl stop service

Stops one or more database services.

ADMIN12787

Syntax and Options

Use the srvctl stop service command with the following syntax:

srvctl stop service -d db_unique_name [-s service_name_list] [-f]

ADMIN13008Table 4-75 srvctl stop service Options

Option Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-s service_name_list

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

-f

Force. This option disconnects all of the stopped services' sessions immediately. Uncommitted transactions are rolled back. If this option is omitted, active sessions remain connected to the services, but no further connections to the services can be made.



ADMIN12788

Examples

The following example stops the sales database service on the database with a DB_UNIQUE_NAME of dbcrm:

srvctl stop service -d dbcrm -s sales

ADMIN12821

unsetenv

The unsetenv command deletes one or more environment variables from the Oracle Restart configuration for a database, a listener, or an Oracle ASM instance.

To perform srvctl unsetenv operations, you must be logged in to the database host computer with the proper user account. See "Preparing to Run SRVCTL" for more information.

ADMIN13009Table 4-76 srvctl unsetenv Command Summary

Command Description

srvctl unsetenv asm

Removes the specified environment variables from the Oracle Restart configuration for the Oracle ASM instance

srvctl unsetenv database

Removes the specified environment variables from the Oracle Restart configuration for a database

srvctl unsetenv listener

Removes the specified environment variables from the Oracle Restart configuration for a listener or all listeners


ADMIN12885

srvctl unsetenv asm

Removes the specified environment variables from the Oracle Restart configuration for the Oracle ASM instance.

ADMIN12886

Syntax and Options

Use the srvctl unsetenv asm command with the following syntax:

srvctl unsetenv asm -t name_list

ADMIN13010Table 4-77 srvctl unsetenv asm Options

Options Description
-t name_list

Comma-delimited list of environment variables to remove



ADMIN12887

Example

The following example removes the AIX operating system environment variable AIXTHREAD_SCOPE from the Oracle ASM instance configuration:

srvctl unsetenv asm -t AIXTHREAD_SCOPE

ADMIN5068

srvctl unsetenv database

Removes the specified environment variables from the Oracle Restart configuration for the specified database.

ADMIN12822

Syntax and Options

Use the srvctl unsetenv database command as follows:

srvctl unsetenv database -d db_unique_name -t name_list

ADMIN13011Table 4-78 srvctl unsetenv database Options

Options Description
-d db_unique_name

Unique name for the database. Must match the DB_UNIQUE_NAME initialization parameter setting. If DB_UNIQUE_NAME is unspecified, then this option must match the DB_NAME initialization parameter setting. The default setting for DB_UNIQUE_NAME uses the setting for DB_NAME.

-t name_list

Comma-delimited list of environment variables to remove



ADMIN12823

Example

The following example deletes the AIXTHREAD_SCOPE environment variable from the Oracle Restart configuration for the database with a DB_UNIQUE_NAME of dbcrm:

srvctl unsetenv database -d dbcrm -t AIXTHREAD_SCOPE

ADMIN12888

srvctl unsetenv listener

Removes the specified environment variables from the Oracle Restart configuration for the specified listener or all listeners.

ADMIN12889

Syntax and Options

Use the srvctl unsetenv listener command with the following syntax:

srvctl unsetenv listener [-l listener_name] -t name_list

ADMIN13012Table 4-79 srvctl unsetenv listener Options

Options Description
-l listener_name

Listener name. If omitted, the specified environment variables are removed from the configurations of all listeners.

-t name_list

Comma-delimited list of environment variables to remove



ADMIN12890

Example

The following example removes the AIX operating system environment variable AIXTHREAD_SCOPE from the listener configuration for the listener named crmlistener:

srvctl unsetenv listener -l crmlistener -t AIXTHREAD_SCOPE

Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Page

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF