Crsctl
The
crsctl utility is used, along with the srvctl utility, to manage and monitor Oracle Clusterware resources and components. crsctl is stored under the GRID_HOME/bin directory and most crsctl 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
crsctlcommands - Oracle RAC environment
crsctlcommands - Oracle Restart environment
crsctlcommands
Contents |
Dual environment crsctl commands
The following lists the variouscrsctl commands and their functions are available for Oracle RAC and Oracle Restart environments:-
crsctl add [resource|type]-
[resource]- Register resources to be managed by Clusterware. A resource might be an application process, a database, a service, a listener and so on. -
[type]- Create resource types
-
-
crcs check css- Check the status of Cluster Synchronization Services (CSS).
-
crsctl delete [resource|type]-
[resource]- delete resources to be managed by Clusterware. A resource might be an application process, a database, a service, a listener and so on. -
[type]- delete resource types
-
-
crsctl get hostname- Retrieves the host name of the local server
-
crsctl getperm [resource|type]-
[resource]- Get user and group permissions for a specific resource. -
[type]- Get permissions for a specific resource type.
-
-
crsctl modify[resource|type]-
[resource]- Modify attributes of a specific Clusterware resource. -
[type]- Modify attributes of a specific Clusterware type.
-
-
crsctl setperm [resource|type]-
[resource]- Set permissions for a specific Clusterware resource. -
[type]- Set permissions for a specific Clusterware type.
-
-
crsctl start resource- Start idle resources in the cluster.
-
crsctl status [resource|type]-
[resource]- Determine the status of a specific Clusterware resource. -
[type]- Determine the status of a specific Clusterware type.
-
-
crsctl stop resource- Stop a running resource.
Oracle RAC environment CRSCTL commands
The following lists the variouscrsctl commands and their functions which are available to manage the following components:- Oracle Clusterware
- Oracle ASM
- CSS
- Cluster Time Synchronization Services
-
crsctl add [crs administrator|css votedisk|serverpool]-
[crs administrator]- Add a user to the list of cluster administrators. -
[css votedisk]- Add one or more voting disks to the cluster. -
[serverpool]- Add a server pool to the cluster.
-
-
crsctl check [cluster|crs|resource|ctss]-
[cluster]- Used to check the status of cluster. You can check the entire cluster or a specific node. -
[crs]- Checks the status of Oracle HA Services and Clusterware on the local server. -
[resource]- Check application specific agents assigned to a specific resource. -
[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]-
[crs administrator]- Remove a crs administrator. -
[css votedisk]- Remove a voting disk from the cluster. -
[node]- Remove a node from the cluster. -
[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]-
[css]- Get the value of a specific parameter related to css. -
[css ipmiaddr]- get the address of the local IPMI device. -
[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]-
[administrator]- Display the list of users with Clusterware administrative privileges. -
[activeversion]- Display the active version of Clusterware on the local node. -
[releaseversion]- Display the release version of Clusterware. -
[software version]- Display the software version on a specific server in the cluster.
-
-
crsctl query css [ipnidevice|votedisk]-
[ipnidevice]- Determine if a IPMI device driver is present on the node the command is run on. -
[votedisk]- Display information on the voting disks.
-
-
crsctl relocate [resource|server]-
[resource]- Relocate resources to another server in the cluster. -
[server]- Relocate a server to a different server pool.
-
-
crsctl replace [discoverystring|votedisk]-
[discoverystring]- Replace the existing discovery string used to locate the voting disk files. -
[votedisk]- Move or replace the existing voting disks.
-
-
crsctl set css- Set the value of a css parameter -
crsctl set css ipmiaddr- Store the address of the local IPMI device. -
crsctl set css ipmiadmin- Store the logon information of the IPMI administrator. -
crsctl setperm serverpool- Set permissions for a specific server pool. -
crsctl start [cluster|crs]-
[cluster]- Start the Clusterware stack - Can be run from any node. -
[crs]- Start Oracle HA Services on the local server.
-
-
crsctl 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.
-
-
crsctl 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.
-
-
crsctl unpin css- Unpin one or more servers. -
crsctl unset css- Restore a css parameter to its default value.
Oracle Restart environment CRSCTL commands
The following lists the variouscrsctl 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
-
crsctl check has- Check the status of ohasd -
crsctl config has- Display the automatic startup configuration of OHAS on the server. -
crsctl disable has- Disable OHAS services on the server when the server reboots. -
crsctl enable has- Enable OHAS services on the server when the server reboots. -
crsctl query has [releaseversions|softwareversion]-
releaseversions- Display the release version of the Oracle Clusterware software on the local node. -
softwareversion- Display the software version on the local node.
-
-
crsctl start has- Start OHAS on the local server. -
crsctl stop has- Stop OHAS on the local server.
Examples of Most Commonly Used CRSCTL commands
This section provides some examples of the use of thecrsctl command to manage Oracle Clusterware Version 11 Release 2.Checking the Cluster
Use thecrsctl 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 onlineYou 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 onlineThe 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 addresses that are being used are correct. For example:dig @rac1.localhost
Starting and Stopping the Cluster
Use thecrsctl 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
Thecrsctl 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 votediskYou 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/votediskYou 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_DGWe 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/votediskYou 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-GUIDThese 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 thecrsctl 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 thecrsctl command to add a cluster administrator as seen in this example:crsctl delete crs administrator -u remove_user_nameNote 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 thecrsctl command as seen here:crsctl query crs administrator
Relocate a Resource
Use thecrsctl 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