Understanding and using tokens in Oracle #GoldenGate
Recently, I’ve been doing some work with a client where tokens need to be used. It came to my attention that the basic usage of tokens is misunderstood. Let’s see if I can clear this up a bit for people reading.
In Oracle GoldenGate, tokens are a way to capture and store data in the header of the trail file (more info on trail headers here). Once a token has been defined, captured and stored in the header, it can be retrieved, on the apply side, and used in many ways to customize what information is delivered by Oracle GoldenGate.
Defining a token is pretty simple; however, keep these three points in mind:
- You define the token and associated data
- The token header in the trail file header permits up to a total of 2,000 bytes (token name, associated data, and length of data)
- Use the TOKEN option of the TABLE parameter in Extracts
In order to define a token in an extract, the definition should follow this basic syntax:
TABLE <schema>.<table>, TOKENS( SRC_CSN_TS = @GETENV(‘GGHEADER’,’COMMITTIMESTAMP’));
In the example above, the token will be populated with the timestamp of the last commit on the table it is defined against. After restarting the extract, the token (SRC_CSN_TS) will be included in the header of the trail file.
Once the trail file is shipped to the target side and read by the replicat, the token is mapped to a column in the target table.
MAP <schema>.<table>, target <schema>.<table>, COLMAP ( SRC_CSN_TS=@token(’SRC_CSN_TS’) );
Image 1, is a view of a table where I have mapped the token (SRC_CSN_TS) to a target table to keep track of the committed timestamps of a transaction on the source system.
Image 1:
Tokens are simple to create, use, and are a powerful feature for mapping data between environments.
Enjoy!!
twitter: @dbasolved
blog: https://dbasolved.com
Bobby Curtis
I’m Bobby Curtis and I’m just your normal average guy who has been working in the technology field for awhile (started when I was 18 with the US Army). The goal of this blog has changed a bit over the years. Initially, it was a general blog where I wrote thoughts down. Then it changed to focus on the Oracle Database, Oracle Enterprise Manager, and eventually Oracle GoldenGate.
If you want to follow me on a more timely manner, I can be followed on twitter at @dbasolved or on LinkedIn under “Bobby Curtis MBA”.
The appearances change from a neutrophilic vasculitis with hemorrhage, through a phase with arterial wall necrosis, to eschar covered ulceration and subcutaneous necrosis cheap lasix online
nenarazili jste někdy na problémy s plagorismem nebo porušováním autorských práv? Moje webové stránky mají spoustu unikátního obsahu, který jsem vytvořil.
Tak Hej der til alle, det indhold, der findes på denne
bookmarked!!, I love your web site.
I simply couldn’t leave your site prior to suggesting that I actually enjoyed the usual info an individual provide in your guests? Is gonna be again steadily to inspect new posts
Great goods from you, man. I’ve understand your stuff
previous to and you are just extremely excellent. I actually like what you have acquired here, really like what you’re stating and the way in which you say
it. You make it enjoyable and you still care for to keep it wise.
I can not wait to read far more from you. This
is actually a terrific site.
Look into my web site nordvpn coupons inspiresensation (t.co)
Fastidious answer back in return of this question with solid arguments and explaining all on the topic of
that.
Check out my website – nordvpn coupons inspiresensation
Thanks for sharing your info. I truly appreciate your efforts and I am waiting for your further post thank
you once again.
Feel free to surf to my web site; nordvpn coupons inspiresensation
350fairfax nordvpn
Attractive element of content. I simply stumbled upon your weblog and in accession capital to say that I get in fact loved
account your blog posts. Any way I’ll be subscribing to your augment and even I success you get right of entry to persistently rapidly.
Feel free to surf to my blog post nord vpn coupon codes