GGSCI Commands : History and Command (!) recall

Ever get tired of typing commands?  Ever wish there was a way to recall commands from GGSCI?  Well, you are in luck!  There are two ways this can be done (listed below).

Commands:
1. History
2. ! (command)

The first option, History, is a command that allows you to view a list of the most recent commands executed in the GGSCI interface since the session started.  

Example:

GGSCI> history

Output:

GGSCI Command History

    3: stats ext ext
    4: stats exti
    5: info all
    6: info manager
    7: edit mgr
    8: edit manager
    9: edit params mgr
   10: set editor vi
   11: edit params mgr
   12: history

Notice that the last 10 commands are listed with the history command.  This list can be tailered by using a number after the history command.

Example:

GGSCI> history [n]

Output:
GGSCI Command History

    9: edit params mgr
   10: set editor vi
   11: edit params mgr
   12: history
   13: history 5

By using the a number with the history command, the last N commands will be displayed.  In the example above, I wanted the last five commands.  So commands that meet this requriement are displayed including the command ran.

Now that we can see a list of the last commands ran, how can we execute the command that we would like to execute from the list.  This is quite simple, just use the command (!) option.  An exclamation point (!) in Oracle GoldenGate acts as a command recall/execution.

Example:

GGSCI> !

In the example above, the command (!) will execute the last command in the list of commands store in the session history.  By adding a number to the command (!), we can tell GGSCI to excute that command.

Example:

GGSCI> ! 5

In the example above, I’m asking to rerun the “info all” command that can be seen in the history earlier in the post.  The output from running the command will be a listing of the current status of the Oracle GoldenGate environment.

Output:

GGSCI (oel.acme.com) 15> ! 5
info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
JAGENT      RUNNING
EXTRACT     RUNNING     EXT         00:00:00      00:00:02  
EXTRACT     RUNNING     EXTI        00:00:06      00:00:09  Description “Integrated Extract”
EXTRACT     RUNNING     PMP         00:00:00      00:00:00
EXTRACT     RUNNING     PMPI        00:00:00      00:00:05  Description “Integrated Pump”

Both of these commands can be used to cut down on typing in the GGSCI utility and make working a bit easier. 

Enjoy!

about.me: http://about.me/dbasolved

Please follow and like:
Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Enquire now

Give us a call or fill in the form below and we will contact you. We endeavor to answer all inquiries within 24 hours on business days.