while true do heredoc golden gate info all

While monitoring a Golden Gate Extract ‘catching up’ I got tired of typing ‘info all’ and a tail -f on the report rpt file gives me more information than I want. I’m just interseted in the status of my Extract and my ‘Lag at checkpoint’.

Shell snippet below echoes ggsci info all output to my screen every 10 (sleep 10) seconds.

while true
do
  ./ggsci <<EOF
info all
exit
EOF
  sleep 10
done



Use Ctrl^C to break out of the while loop

GGSCI (********) 1>
Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EL****      13:45:11      00:00:08
EXTRACT     RUNNING     EP****      47:42:56      00:00:05


GGSCI (********) 2>
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.14 17547423 OGGCORE_11.2.1.0.0OGGBP_PLATFORMS_131022.0605
AIX 5L, ppc, 64bit (optimized), Oracle 11g on Oct 22 2013 09:35:16

Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.



GGSCI (********) 1>
Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EL****      13:43:13      00:00:10
EXTRACT     RUNNING     EP****      47:42:55      00:00:06


GGSCI (********) 2>

OK great the Extract it’s catching up swiftly – the Lag at Checkpoint will be zero just before the weekend starts.

I never knew the <<EOF ( <<WHATEVERPANCAKE ) was called ‘Here Document’. Now I know //en.wikipedia.org/wiki/Here_document.

Add date and some more formatting:

while true
do
  echo "// -----------------------"
  echo "// Golden Gate status as of :"
  date
  ./ggsci <<EOF
info all
exit
EOF

  sleep 60
done



Leave a Reply

Helpful? - leave your note below so I can brag

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>