Database Reference
In-Depth Information
The status of each resource managed by Clusterware can be viewed using the crsctl utility, as shown here:
[oracle@rac12node1 ~]$ /u01/app/12.1.0.1/grid/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
[...]
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac12node2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac12node1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac12node1 STABLE
A resource can be either local to a cluster node or a cluster resource. A local resource always stays on the cluster
node and does not relocate to other nodes. A cluster resource, however, is aware that it is deployed in a cluster and
can react to node failures. Two prerequisites are to be met to register a custom resource. The first is a so-called action
script that implements callbacks to start, stop, and check the resource. The action script is referenced in the resource
description, called a profile. First, an action script is needed. A very basic script implementing the minimum amount of
code is subsequently provided. It lacks elegance and sufficient error checking; you are encouraged to improve as needed.
#!/bin/bash
[[ "$TRACE" == "YES" ]] && {
set -x
}
PATH=/usr/local/bin:$PATH
ORACLE_SID=apclu
ORACLE_HOME=/u01/app/oracle/product/12.1.0.1/dbhome_1
ORACLE_BASE=/u01/app/oracle
export PATH ORACLE_SID ORACLE_HOME ORACLE_BASE
PS=/bin/ps
SU=/bin/su
# avoid "standard in must be a tty" error when executing the script as RDBMS_OWNER
[[ $(whoami) != "$RDBMS_OWNER" ]] && {
SWITCH_USER="$SU - $RDBMS_OWNER -c"
}
case $1 in
'start')
$SWITCH_USER $ORACLE_HOME/bin/sqlplus / as sysdba <<EOF
startup
exit
EOF
Search WWH ::




Custom Search