Oracle's low level clusterware tools are great for digging into real
issues or reconfiguring the cluster as a whole; however, there are
several high level tools that are used for every day needs, such as:
-
Listing cluster resources
-
Starting and stopping cluster resources
-
Relocating resources
-
Registering and unregistering resources
-
Enabling and disabling resources
Keep in mind that a resource is any part of the cluster system as a
whole: VIP, GSD, ONS, ASM, the listener, the database, instances, and
services.
crs_stat
crs_stat
is probably the most commonly used of all Oracle RAC tools.
This script accepts many different parameters to display
information about all cluster resources.
By itself, the
crs_statommand
will list each resource registered with clusterware and show its
status.
NAME=ora.racnode2.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on racnode2
NAME=ora.racnode2.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on racnode2
NAME=ora.racnode2.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on racnode2
Specifying the
-t option will display information in tabular form.
For instance:
[oracle@racnode1 ~]$ crs_stat -t
Name
Type
Target
State
Host
------------------------------------------------------------
ora.racdb.db
application
ONLINE
ONLINE
racnode2
ora....b1.inst application
ONLINE
ONLINE
racnode1
ora....b2.inst application
OFFLINE
OFFLINE
ora....SM1.asm application
ONLINE
ONLINE
racnode1
ora....E1.lsnr application
ONLINE
ONLINE
racnode1
ora....de1.gsd application
ONLINE
ONLINE
racnode1
ora....de1.ons application
ONLINE
ONLINE
racnode1
ora....de1.vip application
ONLINE
ONLINE
racnode1
ora....SM2.asm application
ONLINE
ONLINE
racnode2
ora....E2.lsnr application
ONLINE
ONLINE
racnode2
ora....de2.gsd application
ONLINE
ONLINE
racnode2
ora....de2.ons application
ONLINE
ONLINE
racnode2
ora....de2.vip application
ONLINE
ONLINE
racnode2
Another popular pair of options is a combination of -a and either -g
or -r.
-
-a
allows a specific
resource_name to be entered
-
-g
will return 0 if the resource is registered with clusterware, 1 if
it is not
-
-r
will return 0 if the resource is running currently, and 1 if it is
not
- This can also be combined with
-c cluster_node
to narrow the query to a specific node
The
-p option is also highly used as it prints the profile
of any resource. This
profile can be used to re-register resources later.
Other miscellaneous but useful options are:
- Can optionally include a
resource_name
crs_start
crs_start
is used to start resources, either one at a time or for the entire
cluster.
To start all resources across a cluster, the
crs_start
command can be used with the -all option:
$ crs_start -all
To force a resource to start, all required prerequisites from that
resource must be met.
After that, the
crs_start
command can use the -f option to force startup.
This is useful in cases like VIP failover, when the VIP must be
relocated to another node.
If the -all option is not specified, a resource name must be given.
For instance:
$ crs_start ora.racnode1.vip
Tip:
If one only wants to start a resource on a given node, the
-c node_nameoption can be specified.