2 Replies Latest reply: Jan 31, 2013 5:07 AM by jfa_ RSS

    Something similar to 'gcstartup'  for automatic  start / stop

    jfa_
      Hi @ll
      Is there any similar to ‘/etc/rc.d/init.d/gcstartup’ script for an automatic start / stop for GoldenGate manager on a Server.
      I use an OBEY command in a start.txt file with start_ogg.sh file, but there are an OEM agent , a listener and the database on this machine and I would like to start all of them automatic at ones.

      Regards

      jfa
        • 1. Re: Something similar to 'gcstartup'  for automatic  start / stop
          Nick.W-Oracle
          I'm not aware of anything like this. There are some AUTOSTART parameters in the manager process that, when configured, can automatically start any Extracts or Replicats running under that manager.

          For example,

          AUTOSTART EXTRACT ABC*

          or

          AUTOSTART REPLICAT *

          But you'll still have to start manager. As for order of operations, you don't want OGG started at the same time as the database. There could be a race condition where the database is still starting up, and Extract attempts to connect to the database. Since it's not up, it will abend and fail. Then you'll have to come back and start it again.

          The order should be something similar to this:

          Start database
          Start OGG Manager
          Start Extracts and Replicats
          Start listener
          • 2. Re: Something similar to 'gcstartup'  for automatic  start / stop
            jfa_
            Hi Nic:_W
            Thank for the answer.

            I have just modified the gcstartup like that :

            #!/bin/sh
            #Source Function Library
            SU=/bin/su
            DBST="N"

            ......

            if [ -f /etc/oratab ]
            then
            oratab="/etc/oratab"
            else
            if [ -f /var/opt/oracle/oratab ]
            then
            oratab="/var/opt/oracle/oratab"
            fi
            fi
            if [ -f "$oratab" ]
            then
            for i in `cat $oratab | grep -v '^#' | cut -d ":" -f2`;
            do

            .......

            ##############
            if [ -f "$i/start_goldgate.sh" ] ;
            then
            user=`ls -l $i/start_goldgate.sh|awk '{print $3}'`;
            if [ $1 = start ];
            then
            DBST='Y'
            $SU - $user -c "$i/start_goldgate.sh ";
            else
            DBST='N'
            $SU - $user -c "$i/stop_goldgate.sh ";
            fi;
            fi;
            ####################
            done
            fi

            and it works fine

            the content of start_goldgate.sh
            is
            cd /orasoft/app/ogg
            /orasoft/app/ogg/ggsci << EOF
            OBEY /orasoft/app/ogg/startup_ogg.txt
            EOF

            the content of startup_ogg.txt
            is :
            START MANAGER
            INFO ALL
            exit

            automatic restart of REPLICAT und EXTRACT parameters are in mgr.prm file.

            Analogue for stop*/shutdown* files with 'STOP MANAGER'

            regards
            jfa