Forum Stats

  • 3,874,814 Users
  • 2,266,777 Discussions
  • 7,911,968 Comments

Discussions

Shell Script + GoldenGate (Logdump utility)

844166
844166 Member Posts: 27
edited Apr 2, 2011 5:52PM in GoldenGate
Can anyone help me in this?

As we know in oracle goldengate using Logdump utility we can retrieve the previous RBA by these commands.

open <trail file>
pos <current RBA>
sfh prev

it gives previous RBA

Now I want to extract this RBA using shell script. And I want to save this RBA for the further use.

Can anybody help me out?

Answers

  • stevencallan
    stevencallan Member Posts: 3,459
    edited Mar 3, 2011 8:37PM
    Pass in the RBA as input. Shift arguments, or prompt for user input.

    #!/bin/ksh

    ./logdump << EOF
    open ./dirdat/rt000016
    pos 0
    n
    EOF



    [[email protected] ggs]$ chmod 744 dolog.ksh
    [[email protected] ggs]$ dolog.ksh

    Oracle GoldenGate Log File Dump Utility
    Version 11.1.1.0.0 Build 078

    Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.



    Logdump 253 >Current LogTrail is /u01/app/ggs/dirdat/rt000016
    Logdump 254 >Reading forward from RBA 0
    Logdump 255 >
    2011/02/16 21:39:05.787.043 FileHeader Len 1557 RBA 0
    Name: FileHeader
    3000 0416 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0...0...GG..TL..1...
    0002 3200 0004 2000 0000 3300 0008 02f1 c2a6 6f00 | ..2... ...3.......o.
    7ea3 3400 0021 001f 7572 693a 6f65 6c33 323a 6163 | ~.4..!..uri:oel32:ac
    6d65 3a63 6f6d 3a3a 7530 313a 6170 703a 6767 7335 | me:com::u01:app:ggs5
    0002 7535 0000 2100 1f75 7269 3a6f 656c 3332 3a61 | ..u5..!..uri:oel32:a
    636d 653a 636f 6d3a 3a75 3031 3a61 7070 3a67 6773 | cme:com::u01:app:ggs
    3500 0021 001f 7572 693a 6f65 6c33 323a 6163 6d65 | 5..!..uri:oel32:acme

    Logdump 256 >[[email protected] ggs]$
    stevencallan
  • 844166
    844166 Member Posts: 27
    thanks

    ok you mean, using this below code

    #!/bin/ksh
    ./logdump << EOF
    open ./dirdat/rt000016
    pos 0
    n
    EOF


    in shell script the output will reflact to any file..

    it a production environment so only i m confirming it again and again.


    now if you are true then same from ggsci uility we can also retrieve currunt rba and current trailfile isn't it?

    thanks so much dear friend.
  • 844166
    844166 Member Posts: 27
    Hi friend your answer is help me a lot. I tried and used this query in GOLDENGATE and got my desired outcome. Thanks a lot
This discussion has been closed.