auto start Goldengate on Linux CentOS release 5.2 (Final)

4 Sep

1. create parameter startGoldenGate
[oracle@pmr01 gg]$ vi /u01/app/oracle/product/gg/startGoldenGate
start manager

start extract *
start replicat *

exit

2. test parameter startGoldenGate
[oracle@pmr01 gg]$ ./ggsci  PARAMFILE /u01/app/oracle/product/gg/startGoldenGate
Oracle GoldenGate Command Interpreter for Oracle
Version 10.4.0.19 Build 002
Linux, x64, 64bit (optimized), Oracle 10 on Sep 22 2009 14:18:08
Copyright (C) 1995, 2009, Oracle and/or its affiliates.  All rights reserved.
GGSCI (pmr01) 1> start manager
Manager started.
GGSCI (pmr01) 2>
GGSCI (pmr01) 2> start extract *
Sending START request to MANAGER …
EXTRACT EXTFD02 starting
Sending START request to MANAGER …
EXTRACT PUMPFD02 starting
GGSCI (pmr01) 3> start replicat *
Sending START request to MANAGER …
REPLICAT REPFD01 starting
GGSCI (pmr01) 4>
GGSCI (pmr01) 4> exit
[oracle@pmr01 gg]$

3. create script linux untuk startup goldengate
[oracle@pmr01 gg]$ vi /u01/app/oracle/product/gg/startgoldengate
#!/bin/sh
# Start the oracle listener
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_SID=pmr01
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export GGATE=/u01/app/oracle/product/gg
export PATH=$ORACLE_HOME/bin:$PATH:$GGATE
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/u01/app/oracle/product/gg
$GGATE/ggsci PARAMFILE startGoldenGate

[oracle@pmr01 gg]$ chmod a+x /u01/app/oracle/product/gg/startgoldengate

4. create parameter stopGoldenGate
[oracle@pmr01 gg]$ vi /u01/app/oracle/product/gg/stopGoldenGate
stop extract *
stop replicat *

STOP MANAGER !
exit

5. test parameter stopGoldenGate
[oracle@pmr01 gg]$ ./ggsci  PARAMFILE /u01/app/oracle/product/gg/stopGoldenGate
Oracle GoldenGate Command Interpreter for Oracle
Version 10.4.0.19 Build 002
Linux, x64, 64bit (optimized), Oracle 10 on Sep 22 2009 14:18:08
Copyright (C) 1995, 2009, Oracle and/or its affiliates.  All rights reserved.
GGSCI (pmr01) 1> stop extract *
Sending STOP request to EXTRACT EXTFD02 …
Request processed.
Sending STOP request to EXTRACT PUMPFD02 …
Request processed.
GGSCI (pmr01) 2> stop replicat *
Sending STOP request to REPLICAT REPFD01 …
Request processed.
GGSCI (pmr01) 3>
GGSCI (pmr01) 3> STOP MANAGER !
Sending STOP request to MANAGER …
Request processed.
Manager stopped.
GGSCI (pmr01) 4> exit

6. create script linux untuk shutdown goldengate
[oracle@pmr01 gg]$ vi /u01/app/oracle/product/gg/stopgoldengate
#!/bin/sh
# Start the oracle listener
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_SID=pmr01
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export GGATE=/u01/app/oracle/product/gg
export PATH=$ORACLE_HOME/bin:$PATH:$GGATE
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/u01/app/oracle/product/gg

$GGATE/ggsci PARAMFILE stopGoldenGate
exit 0

[oracle@pmr01 gg]$ chmod a+x /u01/app/oracle/product/gg/stopgoldengate

7. create service script linux untuk automatic startup & shutdown goldengate
[oracle@pmr01 gg]$ vi /u01/app/oracle/product/gg/xgoldengate
#!/bin/sh
#
# chkconfig: 345 51 49
# description: startup and shutdown the Oracle 11g goldengate
#
echo “Goldengate start/stop”
ORA_OWNER=oracle
GG_HOME=/u01/app/oracle/product/gg

case “$1” in
‘start’)
# Start the goldengate
echo -n “Starting the goldengate : ”
su – $ORA_OWNER -c $GG_HOME/startgoldengate
echo
;;

‘stop’)
# Stop the goldengate
echo -n “Shutting down goldengate : ”
su – $ORA_OWNER -c $GG_HOME/stopgoldengate
echo
;;

‘restart’)
# Restart the Oracle databases:
echo -n “Restarting goldengate : ”
$0 stop
$0 start
echo
;;

*)
echo “Usage: xgoldengate [ start | stop | restart }”
exit 1

esac
exit 0

[oracle@pmr01 gg]$ chmod a+x /u01/app/oracle/product/gg/xgoldengate

8. test script automatic startup & shutdown goldengate
[oracle@pmr01 gg]$ su – root
Password:
[root@pmr01 ~]# cp /u01/app/oracle/product/gg/xgoldengate /etc/rc.d/init.d/
[root@pmr01 ~]# cd /etc/rc.d/init.d/
[root@pmr01 init.d]# chmod 700 /etc/rc.d/init.d/xgoldengate

[root@pmr01 init.d]# ./xgoldengate
Goldengate start/stop
Usage: xgoldengate [ start | stop | restart }

[root@pmr01 init.d]# ./xgoldengate start
Goldengate start/stop
Starting the goldengate :
Oracle GoldenGate Command Interpreter for Oracle
Version 10.4.0.19 Build 002
Linux, x64, 64bit (optimized), Oracle 10 on Sep 22 2009 14:18:08
Copyright (C) 1995, 2009, Oracle and/or its affiliates.  All rights reserved.
GGSCI (pmr01) 1> start manager
Manager started.
GGSCI (pmr01) 2>
GGSCI (pmr01) 2> start extract *
Sending START request to MANAGER …
EXTRACT EXTFD02 starting

Sending START request to MANAGER …
EXTRACT PUMPFD02 starting

GGSCI (pmr01) 3> start replicat *
Sending START request to MANAGER …
REPLICAT REPFD01 starting

GGSCI (pmr01) 4>
GGSCI (pmr01) 4> exit

[root@pmr01 init.d]# ./xgoldengate stop
Goldengate start/stop
Shutting down goldengate :
Oracle GoldenGate Command Interpreter for Oracle
Version 10.4.0.19 Build 002
Linux, x64, 64bit (optimized), Oracle 10 on Sep 22 2009 14:18:08
Copyright (C) 1995, 2009, Oracle and/or its affiliates.  All rights reserved.
GGSCI (pmr01) 1> stop extract *
Sending STOP request to EXTRACT EXTFD02 …
Request processed.

Sending STOP request to EXTRACT PUMPFD02 …
Request processed.

GGSCI (pmr01) 2> stop replicat *
Sending STOP request to REPLICAT REPFD01 …
Request processed.
GGSCI (pmr01) 3>
GGSCI (pmr01) 3> STOP MANAGER !

Sending STOP request to MANAGER …
Request processed.
Manager stopped.
GGSCI (pmr01) 4> exit

9. chkconfig script goldengate
[root@pmr01 init.d]# /sbin/chkconfig –add xgoldengate
[root@pmr01 init.d]# /sbin/chkconfig –list xgoldengate
listener11g 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@pmr01 init.d]# /sbin/chkconfig xgoldengate on

3 Responses to “auto start Goldengate on Linux CentOS release 5.2 (Final)”

  1. Liu April 22, 2011 at 12:18 pm #

    There is one question: is there any relationship between oracle instance :orcl with goldengate manager or extract ,replicat process? Extract ,replicat processes must start after oracle instance ,like orcl?
    And I encounter a situation, after I reboot the source computer (the target computer on work) , the goldengate manger (the source ) and the extract process can start normal,but the replicat process can not be started. There is the tips:: there is a problem in network communicat
    ion, a remote file problem, encryption keys for target and source do not match (
    if using ENCRYPT) or an unknown error. (Reply received is Unable to open file “D
    :\V22232-01\dirdat\r1000003” (error 997, I/O )).
    That is , the source and the target is normal at common times, but when I reboot the source or the target computer , the data can not be sent to the target database().

    • setijoagus April 23, 2011 at 2:15 am #

      yes, must start after oracle instance.

  2. ANDRIAMAMPIANINA June 6, 2012 at 8:13 am #

    how to add user mail address at linux CentOs 5.2 release (final)?

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

%d bloggers like this: