Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: RAC nodes list?

Re: RAC nodes list?

From: Alan J. Gagne <alan.gagne_at_comcast.net>
Date: Fri, 03 Aug 2007 10:50:56 -0400
Message-Id: <1186152656.4567.3.camel@agagne.int.demandware.com>


I do something similar where I use the CRS status script that I got off Metalink.

I have also used the script to build the data for an external table. You just need the output to be stored in a shared area so all instances can access.

Alan

#!/usr/bin/ksh
#
# Sample 10g CRS resource status query script
#
# Description:
# - Returns formatted version of crs_stat -t, in tabular
# format, with the complete rsc names and filtering keywords
# - The argument, $RSC_KEY, is optional and if passed to the script,
will
# limit the output to HA resources whose names match $RSC_KEY.
# Requirements:
# - $ORA_CRS_HOME should be set in your environment
CRS_HOME=/opt/crs_ora/product/10.2.0.3/crs

RSC_KEY=$1
QSTAT=-u
AWK=/usr/bin/awk # if not available use /usr/xpg4/bin/awk

# Table header:echo ""

$AWK \
  'BEGIN {printf "%-45s %-10s %-18s\n", "HA Resource", "Target", "State";

          printf "%-45s %-10s %-18s\n", "-----------", "------", "-----";}'

# Table body:

$CRS_HOME/bin/crs_stat $QSTAT | $AWK \
 'BEGIN { FS="="; state = 0; }
  $1~/NAME/ && $2~/'$RSC_KEY'/ {appname = $2; state=1};   state == 0 {next;}
  $1~/TARGET/ && state == 1 {apptarget = $2; state=2;}   $1~/STATE/ && state == 2 {appstate = $2; state=3;}   state == 3 {printf "%-45s %-10s %-18s\n", appname, apptarget, appstate; state=
0;}'

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 03 2007 - 09:50:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US