Академический Документы
Профессиональный Документы
Культура Документы
You can use a crsctl command as follows to stop Oracle Clusterware and
its related resources on a specific node:
crsctl stop crs
You can use a crsctl command as follows to start Oracle Clusterware and
its related resources on a specific node:
crsctl start crs
Run the following command to disable the startup of all of the Oracle
Clusterware daemons:
crsctl disable crs
DB EXPERTS 9866465379 1
DB EXPERTS 9866465379
This command displays the status of the CSSD, EVMD, and CRSD
processes. Run the following command to determine the health of
individual daemons where daemon is crsd, cssd or evmd:
crsctl check daemon
Log files for the CRSD process (crsd) can be found in the following
directories:
CRS home/log/hostname/crsd
You can find CSS information that the OCSSD generates in log files in
the following locations:
CRS Home/log/hostname/cssd
DB EXPERTS 9866465379 2
DB EXPERTS 9866465379
The Oracle RAC high availability trace files are located in the following
two locations:
CRS home/log/hostname/racg
$ORACLE_HOME/log/hostname/racg
Core files are in the sub-directories of the log directories. Each RACG
executable has a sub-directory assigned exclusively for that executable.
The name of the RACG executable sub-directory is the same as the name
of the executable.
This section explains how to use the OCRDUMP utility to view OCR
content for troubleshooting. The OCRDUMP utility enables you to view
the OCR contents by writing OCR content to a file or stdout in a readable
format.
Writes the OCR content to a file called MYFILE in the current directory.
ocrdump -stdout -keyname SYSTEM
Writes the OCR content from the subtree of the key SYSTEM to stdout.
ocrdump -stdout -xml
DB EXPERTS 9866465379 3
DB EXPERTS 9866465379
The OCRCHECK utility displays the version of the OCR's block format,
total space available and used space, OCRID, and the OCR locations that
you have configured. OCRCHECK performs a block-by-block checksum
operation for all of the blocks in all of the OCRs that you have
configured. It also returns an individual status for each file as well as a
result for the overall OCR integrity check. The following is a sample of
the OCRCHECK output:
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262144
Used space (kbytes) : 16256
Available space (kbytes) : 245888
ID : 1918913332
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File Name : /oradata/mirror.ocr
Device/File integrity check succeeded
DB EXPERTS 9866465379 4
DB EXPERTS 9866465379
crs_getperm
Inspects the permissions associated with a resource.
crs_profile
Creates, validates, deletes, and updates an Oracle Clusterware application
profile
crs_register
DB EXPERTS 9866465379 5
DB EXPERTS 9866465379
crs_stop
Example of crs_getperm
To list the permissions associated with the postman application, use the
following command:
crs_getperm postman
crs_stat
DB EXPERTS 9866465379 6
DB EXPERTS 9866465379
DB EXPERTS 9866465379 7
DB EXPERTS 9866465379
CRS-218: Could not restart the resource '%s' on the original node.
Cause: There was an internal error while restarting the resource.
Action: Check the CRS daemon log file.
CRS-253: CRS configuration error, the CRS default directory is not set in
OCR.
Cause: The OCR key which contains the user default CRS key is not
initialised.
Action: Check the CRS configuration. If necessary reinstall CRS.
DB EXPERTS 9866465379 8
DB EXPERTS 9866465379
resource.
Action: Check the permissions associated with the resource using
crs_getperm.
DB EXPERTS 9866465379 9
DB EXPERTS 9866465379
running.
DB EXPERTS 9866465379 10
DB EXPERTS 9866465379
For example, to export the OCR contents to a binary file, use the
ocrconfig command with the following syntax where file_name is the file
to which you want to export the OCR contents as follows:
ocrconfig -export file_name
Server Control Utility Reference
This chapter describes how to administer Oracle Real Application
Clusters (RAC) databases and instances using the Server Control Utility
(SRVCTL)
DB EXPERTS 9866465379 11
DB EXPERTS 9866465379
To see help for all SRVCTL commands, from the command line enter:
srvctl -h
DB EXPERTS 9866465379 12
DB EXPERTS 9866465379
srvctl add
Lists the configuration for the node applications, database, ASM instance,
or service.
srvctl enable
DB EXPERTS 9866465379 13
DB EXPERTS 9866465379
srvctl start
Sets and unsets the environment variable in the configuration for the node
applications, database, database instance, or service.
SRVCTL Objects (Nouns) and Abbreviations
Object Abbreviati
Noun Name on Purpose
asm asm To add, configure, enable, start, obtain the status
of, stop, disable, and remove ASM instances.
DB EXPERTS 9866465379 14
DB EXPERTS 9866465379
Object Abbreviati
Noun Name on Purpose
database db To add, configure, modify, manage environment
variables for, enable, start, obtain the status of,
stop, disable, and remove databases.
instance inst To add, configure, modify, manage environment
variables for, enable, start, obtain the status of,
stop, and remove database instances.
nodeapps no To add, configure, modify, manage environment
abbreviation variables for, start, obtain the status of, stop, and
remove node applications.
service serv To add, configure, modify, manage environment
variables for, enable, start, obtain the status of,
relocate, disable, stop, and remove services from
your cluster database.
srvctl add
The SRVCTL add command adds the configuration and the Oracle
Clusterware applications to the OCR for the cluster database, named
instances, named services, or for the named nodes. To perform srvctl add
operations, you must be logged in as the database administrator and be
the Oracle account owner on UNIX-based systems, or you must be
logged on as a user with Administrator privileges on Windows-based
systems.
When adding an instance, the name that you specify with -i must match
the ORACLE_SID parameter. The database name given with -d
db_unique_name must match the DB_UNIQUE_NAME initialization
parameter setting. If DB_UNIQUE_NAME is unspecified, then match the
DB_NAME initialization parameter setting. The default setting for
DB_UNIQUE_NAME uses the setting for DB_NAME. Also, the domain
name given with -m db_domain must match the DB_DOMAIN setting.
srvctl add Summary
Command Description
srvctl add database Adds a database and configuration.
srvctl add instance Adds one or more instances and configurations.
srvctl add service Adds services.
DB EXPERTS 9866465379 15
DB EXPERTS 9866465379
Command Description
srvctl add nodeapps Adds node applications.
srvctl add asm Adds ASM instances.
Example
DB EXPERTS 9866465379 16
DB EXPERTS 9866465379
Use the srvctl add instance command with the following syntax:
srvctl add instance -d db_unique_name -i inst_name -n node_name
Examples
Use the srvctl add asm command with the following syntax:
srvctl add asm -n node_name -i asm_instance_name -o oracle_home
DB EXPERTS 9866465379 17
DB EXPERTS 9866465379
Example
srvctl config
Use the srvctl config database command with the following syntax:
srvctl config database [-d db_unique_name [-a] [-t]]
DB EXPERTS 9866465379 18
DB EXPERTS 9866465379
Option Description
-d db_unique_name Unique name for the database
-a Additional attributes
-t Display sample TNS entries
Examples
Use the srvctl config asm command with the following syntax:
srvctl config asm -n node_name
The only option available for this command is -n to specify the node
name.
Example
DB EXPERTS 9866465379 19
DB EXPERTS 9866465379
Use the srvctl config listener command with the following syntax:
srvctl config listener -n node_name
The only option available for this command is -n to specify the node
name.
Example
srvctl enable
The SRVCTL enable command enables the named object so that it can
run under Oracle Clusterware for automatic startup, failover, or restart.
The Oracle Clusterware application supporting the object may be up or
down to use this function. Enable is the default value. If the object is
already enabled, then the command is ignored. Enabled objects can be
started, and disabled objects cannot be started.
srvctl enable Summary
Command Description
srvctl enable database Enables the database.
srvctl enable instance Enables the instance.
srvctl enable service Enables a service.
srvctl enable asm Enables an ASM instance.
Enables the Oracle Clusterware resources for a database and enables the
database's instances if the database was previously disabled.
DB EXPERTS 9866465379 20
DB EXPERTS 9866465379
Use the srvctl enable database command with the following syntax:
srvctl enable database -d db_unique_name
The only option available for this command is -d to specify the database
name.
Example
Use the srvctl enable instance command with the following syntax:
srvctl enable instance -d db_unique_name -i inst_name_list
Example
DB EXPERTS 9866465379 21
DB EXPERTS 9866465379
Use the srvctl enable service command with the following syntax:
srvctl enable service -d db_unique_name {-s service_name_list | -s
service_name -i inst_name}
Examples
DB EXPERTS 9866465379 22
DB EXPERTS 9866465379
Use the srvctl enable asm command with the following syntax:
srvctl enable asm -n node_name [-i asm_inst_name]
Example
DB EXPERTS 9866465379 23
DB EXPERTS 9866465379
Use the srvctl disable database command with the following syntax:
srvctl disable database -d db_unique_name
The only option available for this command is -d to specify the database
name.
Example
Disables an instance. If the instance that you disable with this command
is the last enabled instance, then this operation also disables the database.
Use the srvctl disable instance command with the following syntax:
srvctl disable instance -d db_unique_name -i inst_name_list
Example
DB EXPERTS 9866465379 24
DB EXPERTS 9866465379
Use the srvctl disable service command with the following syntax:
srvctl disable service -d db_unique_name {-s service_name_list | -s
service_name -i inst_name}
Examples
DB EXPERTS 9866465379 25
DB EXPERTS 9866465379
Use the srvctl disable asm command with the following syntax:
srvctl disable asm -n node_name [-i asm_inst_name]
srvctl disable asm Option
Option Description
-n node_name Node name
-i inst_name ASM instance name.
Example
DB EXPERTS 9866465379 26
DB EXPERTS 9866465379
Command Description
srvctl start listener Starts the specified Listener or Listeners.
Use the srvctl start database command with the following syntax:
srvctl start database -d db_unique_name [-o start_options] [-c connect_str
| -q]
Example
DB EXPERTS 9866465379 27
DB EXPERTS 9866465379
Use the srvctl start instance command with the following syntax:
srvctl start instance -d db_unique_name -i inst_name_list [-o
start_options] [-c connect_str | -q]
srvctl start instance Options
Option Description
-d db_unique_name Unique name for the database.
-i inst_name_list Comma-delimited instance names.
-o start_options Options for startup command (for example: open,
mount, or nomount).
-c connect_str Connect string (default: / as sysdba).
-q Prompt for user credentials connect string from
standard input.
Example
Use the srvctl start service command with the following syntax:
srvctl start service -d db_unique_name [-s service_name_list [-i
inst_name]] [-o start_options] [-c connect_str | -q]
DB EXPERTS 9866465379 28
DB EXPERTS 9866465379
Option Description
-d Unique name for the database
db_unique_name
-s Comma-delimited service names; the service name list is
service_name_lis optional and if not provided, the SRVCTL starts all of
t the database's services
-i inst_name Instance name
-o start_options Options to startup command (for example: open, mount,
or nomount)
-c connect_str Connect string (default: / as sysdba)
-q Query connect string from standard input
Examples
The following example starts named service names. If the instances that
support these services, including available instances that the service uses
for failover, are not running but are enabled, then they are started:
srvctl start service -d crm -s crm
Use the srvctl start nodeapps command with the following syntax:
srvctl start nodeapps -n node_name
The only option available for this command is -n to specify the node
name.
DB EXPERTS 9866465379 29
DB EXPERTS 9866465379
Example
Use the srvctl start asm command with the following syntax:
srvctl start asm -n node_name [-i asm_inst_name] [-o start_options] [-c
connect_str | -q]
srvctl start asm Option
Option Description
-n node_name Node name
-i inst_name ASM instance name.
-o start_options Options to startup command, for example open,
mount, or nomount.
-c connect_string Connect string where the default is forward slash (/).
-q Query connect string from standard input.
-h Display help.
Examples
DB EXPERTS 9866465379 30
DB EXPERTS 9866465379
Use the srvctl start listener command with the following syntax:
srvctl start listener -n node_name [-l listener_name_list]
Example
Stops the Oracle Clusterware applications for the database, all or named
instances, all or named service names, or node level applications. Only
the Oracle Clusterware applications that are starting or running are
stopped. Objects running outside of Oracle Clusterware are not stopped.
Stops node-level applications and all dependent Oracle Clusterware
applications on the node.
You should disable an object that you intend to remain stopped after you
issue a SRVCTL stop command. Refer to the SRVCTL disable command
starting with srvctl disable database.
Note:
If the object is stopped and is not disabled, then it can restart as a
result of another planned operation. That is, the object will not restart
as a result of a failure. Oracle recommends that you disable an object
that should remain stopped after you issue a stop command.
DB EXPERTS 9866465379 31
DB EXPERTS 9866465379
Command Description
srvctl stop service Stops the service
srvctl stop nodeapps Stops the node-level applications
srvctl stop asm Stops ASM instances
srvctl stop listener Stops the specified Listener or Listeners.
Use the srvctl stop database command with the following syntax:
srvctl stop database -d db_unique_name [-o stop_options] [-c connect_str
| -q]
Example
DB EXPERTS 9866465379 32
DB EXPERTS 9866465379
Stops instances and stops all enabled and non-running services that have
these instances as either preferred or available instances.
Use the srvctl stop instance command with the following syntax:
srvctl stop instance -d db_unique_name -i inst_name_list [-o
stop_options] [-c connect_str | -q]
Example
Stops one or more services globally across the cluster database, or on the
specified instance.
DB EXPERTS 9866465379 33
DB EXPERTS 9866465379
Use the srvctl stop service command with the following syntax:
srvctl stop service -d db_unique_name [-s service_name_list [-i
inst_name]] [-c connect_str | -q] [-f]
Examples
DB EXPERTS 9866465379 34
DB EXPERTS 9866465379
Use the srvctl stop nodeapps command with the following syntax:
srvctl stop nodeapps -n node_name
The only option for this command is the -n option, which specifies the
node name.
Example
Use the srvctl stop asm command with the following syntax:
srvctl stop asm -n node_name [-i inst_name] [-o stop_options] [-c
connect_str | -q]
DB EXPERTS 9866465379 35
DB EXPERTS 9866465379
Example
Use the srvctl stop listener command with the following syntax:
srvctl stop listener -n node_name [-l listener_name_list]
Example
DB EXPERTS 9866465379 36
DB EXPERTS 9866465379
Use the srvctl modify database command with the following syntax:
srvctl modify database -d db_unique_name [-n db_name] [-o
oracle_home] [-m domain_name] [-p spfile] [-r {PRIMARY |
PHYSICAL_STANDBY | LOGICAL_STANDBY}] [-s start_options] [-
y {AUTOMATIC | MANUAL}]
Example
DB EXPERTS 9866465379 37
DB EXPERTS 9866465379
Modifies the configuration for a database instance from its current node
to another node or changes the dependency between and ASM instance
and a database instance.
Use the srvctl modify instance command with the following syntax:
srvctl modify instance -d db_unique_name -i inst_name {-n node_name |
-s asm_instance_name | -r}
Examples
DB EXPERTS 9866465379 38
DB EXPERTS 9866465379
Important:
Oracle recommends that you limit
configuration changes to the minimum
requirement and that you not perform other
service operations while the online service
modification is in progress.
Use the srvctl modify service command with the following syntax:
srvctl modify service -d db_unique_name -s service_name -i
old_inst_name -t new_inst_name [-f]
DB EXPERTS 9866465379 39
DB EXPERTS 9866465379
Option Description
-s service_name Service name.
-i old_inst_name Old instance name.
-t new_inst_name New instance name.
-f Disconnect all sessions during stop or relocate
service operations.
You can also use the srvctl modify service command to change an
available instance to a preferred instance as follows:
srvctl modify service -d db_unique_name -s service_name -i
avail_inst_name -r [-f]
Examples
To change the status of multiple instances, you can use the srvctl modify
DB EXPERTS 9866465379 40
DB EXPERTS 9866465379
service command to list which instances are to be the preferred and which
are to be the available instances for a service as follows:
srvctl modify service -d db_unique_name -s service_name -n -i
pref_inst_list [-a avail_inst_list] [-f]
Example
Use the srvctl modify nodeapps command with the following syntax:
srvctl modify nodeapps -n node_name [-o oracle_home] [-A
new_vip_address]
DB EXPERTS 9866465379 41
DB EXPERTS 9866465379
srvctl status
Use the srvctl status database command with the following syntax:
srvctl status database -d db_unique_name [-f] [-v]
DB EXPERTS 9866465379 42
DB EXPERTS 9866465379
Example
Use the srvctl status instance command with the following syntax:
srvctl status instance -d db_unique_name -i inst_name_list [-f] [-v]
Example
Use the srvctl status service command with the following syntax:
DB EXPERTS 9866465379 43
DB EXPERTS 9866465379
Example
Use the srvctl status nodeapps command with the following syntax:
srvctl status nodeapps -n node_name
The only option available for this command is -n to specify the node
name.
Example
DB EXPERTS 9866465379 44
DB EXPERTS 9866465379
Use the srvctl status asm command with the following syntax:
srvctl status asm -n node_name
The only option available for this command is -n to specify the node
name.
Example
srvctl getenv
Gets and displays values for the environment from the configuration file.
Use SRVCTL with the set, get, and unset environment configuration
verbs to administer the environment configurations for databases,
instances, services, and node applications.
DB EXPERTS 9866465379 45
DB EXPERTS 9866465379
Use the srvctl getenv database command with the following syntax:
srvctl getenv database -d db_unique_name [-t name_list]
Example
Use the srvctl getenv instance command with the following syntax:
srvctl getenv instance -d db_unique_name -i inst_name [-t name_list]
DB EXPERTS 9866465379 46
DB EXPERTS 9866465379
Example
Use the srvctl getenv service command with the following syntax:
srvctl getenv service -d db_unique_name -s service_name [-t name_list]
Example
Use the srvctl getenv nodeapps command with the following syntax:
DB EXPERTS 9866465379 47
DB EXPERTS 9866465379
Example
The following example lists all environment variables for the node
applications:
srvctl getenv nodeapps -n crmnode1
DB EXPERTS 9866465379 48
DB EXPERTS 9866465379
Command Description
srvctl unsetenv service Unsets service environment configurations
srvctl unsetenv Unsets node application environment configurations
nodeapps
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}
srvctl remove
DB EXPERTS 9866465379 49
DB EXPERTS 9866465379
Command Description
srvctl remove database Removes a database and configuration.
srvctl remove instance Removes one or more instances and
configurations.
srvctl remove service Removes services.
srvctl remove nodeapps Removes node applications.
srvctl remove asm Removes ASM instances
Use the srvctl remove database command with the following syntax:
srvctl remove database -d db_unique_name [-f]
Example
DB EXPERTS 9866465379 50
DB EXPERTS 9866465379
Use the srvctl remove instance command with the following syntax:
srvctl remove instance -d db_unique_name -i inst_name [-f]
Example
DB EXPERTS 9866465379 51
DB EXPERTS 9866465379
Options Description
-s service_name Service name.
-i inst_name Instance name.
-f Force remove.
Examples
Removes the node application configuration from the specified node. You
must have full administrative privileges to run this command. On UNIX-
based systems, you must be logged in as root and on Windows-based
systems, you must be logged in as a user with Administrator privileges.
Syntax
DB EXPERTS 9866465379 52
DB EXPERTS 9866465379
Example
Use the srvctl remove asm command with the following syntax:
srvctl remove asm -n node_name [-i asm_inst_name]
Example
DB EXPERTS 9866465379 53