Sample script to start Oracle GoldenGate processes in an automated way. This script can come in handy to DBA/admins who are a little lazy like me to run multiple commands to start the GoldenFate processes.
1. Here is an example of simple script:
$ cat start_goldengate.sh cd /home/oracle/goldengate ./ggsci < EOF OBEY /home/oracle/goldengate/startup.txt EOF
Here, OBEY is a way to process a file that contains a list of GoldenGate commands. OBEY is useful for executing commands that are frequently used in sequence.
2. start_goldgate.sh is a shell script which will use the GGSCI command OBEY to call a text file which has the Goldengate commands supposed to run in sequence
$ cat startup.txt START MANAGER START EXTRACT EXT START EXTRACT DPUMP INFO ALL
3. Lets run the shell script start_goldengate.sh:
$./start_goldengate.sh Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. GGSCI (mylinux.myoracle1.com) 1> GGSCI (mylinux.myoracle1.com) 2> START MANAGER Manager started. GGSCI (mylinux.myoracle1.com) 3> START EXTRACT EXT3 EXTRACT EXT3 is already running. GGSCI (mylinux.goldengate.com) 4> START EXTRACT DPUMP EXTRACT DPUMP is already running. GGSCI (mylinux.myoracle1.com) 5> INFO ALL Program Status Group Lag Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING DPUMP 00:00:00 00:00:01 EXTRACT RUNNING EXT2 00:00:00 00:00:03 EXTRACT RUNNING EXT3 00:00:00 00:00:03