Oracle Golden Gate commands on the wrong node if using RAC HA

If you’re using a RAC High Availability resource for your Golden Gate nodes, you can quickly learn how bad it is to run GGSCI commands on the node that isn’t the Golden Gate node. I just spent a of time trying to undo problems caused by someone doing that.  Also, as you might know, it sometimes doesn’t matter how many times you can point it out or document it, it still keeps happening. So, this is pretty self-explanatory, but I thought I’d post it as it might be your best defense. Basically just a little addition to the .bash_profile:

# check for Golden Gate 
export num_extracts=$(ps -ef | grep -v grep | grep -i ggs | grep -i extract | wc -l)
export num_replicats=$(ps -ef | grep -v grep | grep -i ggs | grep -i replicat | wc -l)
export this_node=$(hostname)
export gg_node=$(/oracle/11.2.0.3/grid/bin/crsctl stat res gg_app | grep STATE | awk '{print $3}')
if [[ $this_node -eq $gg_node ]]; then
  echo This appears to be the Golden Gate node
  echo There are $num_extracts extracts
  echo There are $num_replicats replicats
else
  echo 
  echo STOP AND THINK
  echo This does not appear to be the Golden Gate node, get on the correct node if you plan to use GGSCI
  echo This node is $this_node
  echo Golden Gate node is $gg_node
  echo There are $num_extracts extracts
  echo There are $num_replicats replicats
  echo STOP AND THINK
  echo
fi

One response to “Oracle Golden Gate commands on the wrong node if using RAC HA

  1. Pingback: [OGG]: Setting up High Availability for Golden Gateor | JAY

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s