That’s Me

Gavin Soorma
  • Oracle Certified Professional
  • 7.3, 8i, 9i,10g, 11g
  • 11i Apps DBA OCP
  • 10g RAC OCE
  • Certified GoldenGate Implementation Specialist
  • 10g OCM
  • 11g OCM

  • Feedback

    2,409,840 hits

    Thanks A MILLION for your support!

    Please send me your valuable feedback and suggestions






    Useful GoldenGate commands - SHELL, OBEY, HELP, HISTORY,VERSIONS

    There are a number of other useful GoldenGate commands which we can run from the GGSCI interface.

    The GoldenGate Reference Guide has information in more detail, but I have tried out a few and found some to be very useful which I am highlighting below.

    HISTORY: To view a list of the most recently issued GGSCI commands since the GGSCI session started

    GGSCI (linux01.oncalldba.com) 4> history

    GGSCI Command History

    1: show all
    2: info all
    3: start extract ext3
    4: history

    ! : Use the ! command to execute a previous GGSCI command without modifications.

    GGSCI (linux01.oncalldba.com) 3> info extract ext3

    EXTRACT EXT3 Last Started 2010-07-21 14:29 Status RUNNING
    Checkpoint Lag 01:07:22 (updated 00:00:02 ago)
    Log Read Checkpoint Oracle Redo Logs
    2010-07-21 13:22:28 Seqno 188, RBA 49576960

    GGSCI (linux01.oncalldba.com) 4> !
    info extract ext3

    EXTRACT EXT3 Last Started 2010-07-21 14:29 Status RUNNING
    Checkpoint Lag 01:07:22 (updated 00:00:04 ago)
    Log Read Checkpoint Oracle Redo Logs
    2010-07-21 13:22:28 Seqno 188, RBA 49576960

    We can also use a combination of “!” and HISTORY to run a particular command listed in the history.
    For example, to run the command 3 listed in the history, we can just run “! 3″.

    VERSIONS: to display operating system and database version information. Use DBLOGIN to connect to the database first

    GGSCI (linux01.oncalldba.com) 11> dblogin userid ggs_owner, password ggs_owner
    Successfully logged into database.

    GGSCI (linux01.oncalldba.com) 12> versions
    Operating System:
    Linux
    Version #1 SMP Mon Mar 29 20:19:03 EDT 2010, Release 2.6.18-194.el5PAE
    Node: linux01.oncalldba.com
    Machine: i686

    Database:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 – Production
    PL/SQL Release 11.1.0.6.0 – Production
    CORE 11.1.0.6.0 Production
    TNS for Linux: Version 11.1.0.6.0 – Production
    NLSRTL Version 11.1.0.6.0 – Production

    SHELL: to execute shell commands from within the GGSCI interface.

    GGSCI (linux01.oncalldba.com) 13> shell ls -l /home/oracle/goldengate/dirdat/

    total 50588
    -rw-rw-rw- 1 oracle oinstall 985 Jul 16 14:57 lt000000
    -rw-rw-rw- 1 oracle oinstall 9999629 Jul 19 13:09 lt000001

    HELP: to obtain information about a GoldenGate command. The basic command returns a list of command categories and the associated commands

    GGSCI (linux01.oncalldba.com) 15> help

    GGSCI Command    Summary
    SUBDIRS          CREATE SUBDIRS
    ER               INFO ER, KILL ER, LAG ER, SEND ER, STATUS ER,
                     START ER, STATS ER, STOP ER
    EXTRACT          ADD, ALTER, CLEANUP, DELETE, INFO, KILL,
                     LAG, SEND, START, STATS, STATUS, STOP
    EXTTRAIL         ADD, ALTER, DELETE, INFO
    GGSEVT           VIEW
    MANAGER          INFO, REFRESH, SEND, START, STOP, STATUS
    MARKER           INFO
    PARAMS           EDIT, VIEW
    REPLICAT         ADD, ALTER, CLEANUP, DELETE, INFO, KILL,
                     LAG, SEND, START, STATS, STATUS, STOP
    REPORT           VIEW
    RMTTRAIL         ADD, ALTER, DELETE, INFO
    TRACETABLE       ADD, DELETE, INFO
    TRANDATA         ADD, DELETE, INFO
    Database         DBLOGIN, LIST TABLES,
                     ENCRYPT PASSWORD
    DDL              DUMPDDL
    CHECKPOINTTABLE  ADD CHECKPOINTTABLE, DELETE CHECKPOINTTABLE,
                     CLEANUP CHECKPOINTTABLE, INFO CHECKPOINTTABLE
    Miscellaneous    FC, HELP, HISTORY, INFO ALL, INFO MARKER, OBEY,
                     SET, SHELL, SHOW, VERSIONS, !
    
    For help on a specific command, type HELP  [command] [object]
    
    Example: HELP ADD REPLICAT
    

    OBEY: to process a file that contains a list of GoldenGate commands. OBEY is useful for executing commands that are frequently used in sequence.

    Suppose we want to run some Goldengate commands and execute those from a Unix shell script which can be called via say cron.

    So we have a start_goldgate.sh shell script which will use the GGSCI command OBEY to call a text file which has the Goldengate commands which we would like to run in sequence.

    [oracle@linux01 goldengate]$ cat start_goldgate.sh
    cd /home/oracle/goldengate
    ./ggsci < EOF
    OBEY /home/oracle/goldengate/startup.txt
    EOF

    [oracle@linux01 goldengate]$ cat startup.txt
    START MANAGER
    START EXTRACT EXT3
    START EXTRACT DPUMP
    INFO ALL

    [oracle@linux01 goldengate]$ ./start_goldgate.sh

    Oracle GoldenGate Command Interpreter for Oracle
    Version 10.4.0.19 Build 002
    Linux, x86, 32bit (optimized), Oracle 11 on Sep 29 2009 08:50:50
    
    Copyright (C) 1995, 2009, Oracle and/or its affiliates.  All rights reserved.
    
    GGSCI (linux01.oncalldba.com) 1>
    GGSCI (linux01.oncalldba.com) 2> START MANAGER
    
    Manager started.
    
    GGSCI (linux01.oncalldba.com) 3> START EXTRACT EXT3
    
    EXTRACT EXT3 is already running.
    
    GGSCI (linux01.oncalldba.com) 4> START EXTRACT DPUMP
    
    EXTRACT DPUMP is already running.
    
    GGSCI (linux01.oncalldba.com) 5> INFO ALL
    
    Program     Status      Group       Lag           Time Since Chkpt
    
    MANAGER     RUNNING
    EXTRACT     RUNNING     DPUMP       00:00:00      00:00:01
    EXTRACT     ABENDED     EXT2        00:00:00      172:36:58
    EXTRACT     RUNNING     EXT3        00:00:00      00:00:04
    

    5 comments to Useful GoldenGate commands – SHELL, OBEY, HELP, HISTORY,VERSIONS

    • Hi Farhan – what is the problem you are facing? – what errors are you getting? – see if the below works for you and drop me a line to let me know

      create a file start_goldgate.sh with contents as shown below

      cd /home/oracle/goldengate
      ./ggsci < EOF
      OBEY /home/oracle/goldengate/startup.txt
      EOF

      create another file called startup.txt with the contents as shown below

      START MANAGER
      START EXTRACT EXT3
      START EXTRACT DPUMP
      INFO ALL

      execute the shell script

      ./start_goldgate.sh

    • umesh

      It wasn’t working with EOF keyword, so replaced it with end_ggsci…rest all kept as it is. It worked.

    • umesh

      it works with “./ggsci << EOF" as well.

    • BC

      But how you output “INFO ALL” to a .txt file?

    • Try this – have created a simple shell script – you can build on this

      /export/home/oracle/gg/ggsci < output.txt
      info all
      EOF

    Leave a Reply

      

      

      

    You can use these HTML tags

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>