Está en la página 1de 6

CRSCTL

The crsctl utility is used, along with the srvctl, to manage and monitor Oracle Clusterware resources
and components. crsctl is stored under the GRID_HOME/bin directory and mostcrsctl commands are
only available to Clusterware administrators. You can use crsctl from any node in the cluster. There
are three different types of crsctl commands:
Dual environment crsctl commands
Oracle RAC environment crsctl commands
Oracle Restart environment crsctl commands

Dual environment crsctl commands

The following lists the various crsctl commands and their functions are available for Oracle RAC and
Oracle Restart environments:
crsctl add [resource|type]
o [resource] Register resources to be managed by Clusterware. A resource might be an
application process, a database, a service, a listener and so on.
o
[type] Create resource types
Crcs check css
o Check the status of Cluster Synchronization Services (CSS).
Crsctl delete [resource|type]
o [resource] delete resources to be managed by Clusterware. A resource might be an
application process, a database, a service, a listener and so on.
o [type] delete resource types
Crsctl get hostname
o Retrieves the host name of the local server
Crsctl getperm [resource|type]
o [resource] Get user and group permissions for a specific resource.
o [type] Get permissions for a specific resource type.
Crsctl modify[resource|type]
o [resource] Modify attributes of a specific Clusterware resource.
o [type] Modify attributes of a specific Clusterware type.
Crsctl setperm [resource|type]
o [resource] Set permissions for a specific Clusterware resource.
o [type] Set permissions for a specific Clusterware type.
Crsctl start resoruce
o Start idle resources in the cluster.
Crsctl status [resource|type]
o [resource] Determine the status of a specific Clusterware resource.
o [type] Determine the status of a specific Clusterware type.
Crsctl stop resource
o Stop a running resource.

Oracle RAC environment CRSCTL commands

The following lists the various crsctl commands and their functions which are available to manage the
following components:
Oracle Clusterware
Oracle ASM
CSS
Cluster Time Synchronization Services
These commands are:
Crsctl add [crs administrator|css votedisk|serverpool]
o [crs administrator] Add a user to the list of cluster administrators.
o [css votedisk] Add one or more voting disks to the cluster.
o [serverpool] Add a server pool to the cluster.
Crsctl check [cluster|crs|resrouce|ctss]
o [cluster] Used to check the status of cluster. You can check the entire cluster or a specific
node.
o [crs] Checks the status of Oracle HA Services and Clusterware on the local server.
o [resource] Check application specific agents assigned to a specific resource.
o [ctss] Check the status of the Cluster Time Synchronization services
Crsctl config crs Display the Oracle HA Services automatic startup configuration.
Crsctl delete [crs administrator|css votedisk|node|serverpool]
o [crs administrator] Remove a crs administrator.
o [css votedisk] Remove a voting disk from the cluster.
o [node] Remove a node from the cluster.
o [serverpool] Remove a server pool from the cluster.
Crsctl disable crs Do not allow automatic startup of Oracle High Availability Services when the server
boots up.
Crsctl enable crs Allow automatic startup of Oracle HA Services when the service boots up.
Crsctl get [css|css ipmiaddr|nodename]
o [css] Get the value of a specific parameter related to css.
o [css ipmiaddr] get the address of the local IPMI device.
o [nodename] Get the node name of the local node.
Crsctl getperm serverpool Used to get permissions for a specific server pool.
crsctl lsmodules List components of modules available for debugging. You can list components for
css, crs and evm.
crsctl modify serverpool Modify settings for a given server pool.
crsctl pin css Pin a node name with a specific node number.
crsctl query crs [administrator|activeversion|releaseversion|softwareversion]
o [administrator] Display the list of users with Clusterware administrative privileges.
o [activeversion] Display the active version of Clusterware on the local node.
o [releaseversion] Display the release version of Clusterware.
o [software version] Display the software version on a specific server in the cluster.
crsctl query css [ipnidevice|votedisk|
o [ipnidevice] Determine if a IPMI device driver is present on the node the command is run on.
o [votedisk] Display information on the voting disks.
crsctl relocate [resource|server]
o [resource] Relocate resources to another server in the cluster.
o [server] Relocate a server to a different server pool.
crsctl replace [discoverystring|votedisk]
o [discoverystring] Replace the existing discovery string used to locate the voting disk files.
o [votedisk] Move or replace the existing voting disks.

crsctl
crsctl
crsctl
crsctl
crsctl

o
o

crsctl

o
o

crsctl

o
o

crsctl
crsctl

set css Set the value of a css parameter


set css ipmiaddr Store the address of the local IPMI device.
set css ipmiadmin Store the logon information of the IPMI administrator.
setperm serverpool Set permissions for a specific server pool.
start [cluster|crs]
[cluster] Start the Clusterware stack Can be run from any node.
[crs] Start Oracle HA Services on the local server.
status [server|serverpool]
[server] Display the status and configuration of one or more servers.
[serverpool] Display the status and configuration of one or more server pools.
stop [cluster|crs]
[cluster] Stop the Oracle Clusterware stack on any node of the cluster.
[crs] Stop the Oracle HA Services on the local server.
unpin css Unpin one or more servers.
unset css Restore a css parameter to its default value.

Oracle Restart environment CRSCTL commands

The following lists the various crsctl commands and their functions that are available to manage the
Oracle High Availability Services (OHAS) stack. This stack includes:
Oracle High Availability Services daemon (ohasd)
Oracle ASM
Cluster Synchronization Services (OSS) if ASM is installed
These commands only impact the cluster node that they are run on. The Oracle Restart Environment
CRSCTL commands are:

Crsctl
Crsctl
Crsctl
Crsctl
Crsctl

o
o

Crsctl
Crsctl

check has Check the status of ohasd


config has Display the automatic startup configuration of OHAS on the server.
disable has Disable OHAS services on the server when the server reboots.
enable has Enable OHAS services on the server when the server reboots.
query has [releaseverions|softwareversion]
Releaseversions Display the release version of the Oracle Clusterware software on the local
node.
Softwareversion Display the software version on the local node.
start has Start OHAS on the local server.
stop has Stop OHAS on the local server.

Examples of Most Commonly Used CRSCTL commands


This section provides some examples of the use of the crsctl command to manage Oracle Clusterware
Version 11 Release 2.

Checking the Cluster

Use the crsctl command to determine if the cluster is working on a specific node as seen in this
example:
$GRID_HOME/bin/crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
You can also use the crsctl command to check if CSS is running across all nodes of the cluster:
$GRID_HOME/bin/crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
The following crsctl command will provide a report on all the cluster resources and if they are
running.
$GRID_HOME/bin/crsctl stat res t
[oracle@rac1 oraagent_oracle]$ crsctl stat res -t

NAME
TARGET STATE
SERVER
STATE_DETAILS

Local Resources

ora.DATA.dg ONLINE ONLINE


rac1
ora.LISTENER.lsnr ONLINE ONLINE
rac1
ora.asm ONLINE ONLINE
rac1
Started
ora.eons ONLINE ONLINE
rac1
ora.gsd OFFLINE OFFLINE
rac1
ora.net1.network ONLINE ONLINE
rac1
ora.ons ONLINE ONLINE
rac1
ora.registry.acfs ONLINE ONLINE
rac1

Cluster Resources

ora.LISTENER_SCAN1.lsnr 1
ONLINE ONLINE
rac1
ora.oc4j 1
OFFLINE OFFLINE
ora.orcl.db 1
ONLINE ONLINE
rac1
Open
ora.repos.db 1
OFFLINE OFFLINE
ora.rac1.vip 1
ONLINE ONLINE
rac1
ora.scan1.vip 1
ONLINE ONLINE
rac1
In the output above you see the status of each resource (for example the listener, asm, the database,
the scan listener and so on. You might also want to use the dig command to check that the addressed
that are being used are correct. For example:
Dig @rac1.localhost

Starting and Stopping the Cluster


Use the crsctl command to start and stop the cluster on a specific node. This example starts the
cluster and the following example stops the cluster.
$GRID_HOME/bin/crsctl start crs

$GRID_HOME/bin/crsctl stop crs

Enable or Disable Oracle Clusterware Daemons


Oracle Clusterware will automatically restart when a node is rebooted. There may be cases (like
performing system maintenance) where you do not want clusterware to restart on a given node. The
first command in the following example will keep Clusterware from stopping on the node that the
command is executed on:. The second command in the following example will re-enable Clusterware
on that node.
$GRID_HOME/bin/crsctl disable crs
$GRID_HOME/bin/crsctl enable crs

Managing the Voting Disks


The crsctl command is also useful for managing the voting disks. This command locates all the voting
disks that you have allocated:
$GRID_HOME/bin/crsctl query css votedisk
You may want to add voting disks and the crsctl command is the way to do it. In this example we add
a voting disk to a shared, non-ASM, disk system:
$GRID_HOME/bin/crsctl add css votedisk /ora05/shared/votedisk
You can add voting disks to ASM too, but the command syntax is a bit different as seen in this
example where we use the crsctl command to add a voting disk to an ASM disk group called
+VOTEDISK_DG:
$GRID_HOME/bin/crsctl replace votedisk +VOTEDISK_DG
We can also remove voting disks as seen in this example where we remove the voting disk we
previously created (yes, we are a bit fickle!). Again, this is for non ASM filesystems:
$GRID_HOME/bin/crsctl delete css votedisk /ora05/shared/votedisk
You would delete a voting disk by using the voting disk GUID and the crsctl command as seen here:
$GRID_HOME/bin/crsctl delete css votedisk voting-disk-GUID
These commands can be executed without taking down the cluster and are very helpful when
migrating voting disk to/from ASM. You can also move voting disks from one location to another
using the crsctl command as seen here:
$GRID_HOME/bin/crsctl replace votedisk {+VOTEDISK_DG

Adding a Cluster Administrator


You can use the crsctl command to add a cluster administrator as seen in this example:
Crsctl add crs administrator u new_user_name

Removing a Cluster Administrator


You can use the crsctl command to add a cluster administrator as seen in this example:
Crsctl delete crs administrator u remove_user_name

Note that when enabling role-separate management, you will need to remove the * value as seen
here:
Crsctl delete crs administrator u *

Listing Cluster Administrators


To list the users that are cluster administrators use the crsctl command as seen here:
Crsctl query crs administrator

Relocate a Resource
Use the crsctl command if you have a resource on one host that you need to locate to another host.
For example, if you wanted to locate a resource called delta_one from host rac1 to host rac2 then you
would issue the following command:
$GRID_HOME/bin/crsctl relocate resource delta_one n rac1 s rac2

También podría gustarte