24
Examine Oracle GoldenGate Trail Files: How and when to use the LogDump Utility IOUG Collaborate 2015 Session: 768 Date: 4/15/2015 @ 8 am Room: Palm C

Examining Oracle GoldenGate Trail Files

Embed Size (px)

Citation preview

Page 1: Examining Oracle GoldenGate Trail Files

Examine Oracle GoldenGate Trail Files:

How and when to use the LogDump Utility

IOUG Collaborate 2015

Session: 768

Date: 4/15/2015 @ 8 am

Room: Palm C

Page 2: Examining Oracle GoldenGate Trail Files

@dbasolved

http://dbasolved.com

Work: [email protected]

Personal: [email protected]

Bobby CurtisDouglasville, Georgia

Infrastructure Principle

IOUG (RACSIG/DI SIG), RMOUG, GAOUG

Page 3: Examining Oracle GoldenGate Trail Files

Part of Accenture’s Infrastructure Services:

- 52,000 Oracle professionals

- 17,000 Infrastructure Services professionals

Oracle Database & Engineered Systems Solutions:

- Database Migrations

- Oracle Applications on Engineered Systems

- Cloud-based solutions leveraging Engineered Systems

Oracle “Specialized” in the following areas:

- Oracle Database, Oracle Database Security, Oracle Real Application Cluster (RAC),

Oracle Data Warehouse, Oracle Database Performance Turning, Oracle Linux

- Egineered Systems: Oracle Exadata, Oracle Exalogic, Oracle Exalytics

Accenture Enkitec Group

Page 4: Examining Oracle GoldenGate Trail Files

Accenture Enkitec Group• Our Accenture Enkitec Group resources are members of several Oracle

Database groups such as Oak Table, Oracle ACE, etc and speak frequently

at events across the globe (Oracle Use Groups (OUG), Oracle Open World

(OOW), etc..

• Our team have authored several widely used books specific to Oracle

Database topics ranging from Exadata, performance & tuning to best

practices.

Page 5: Examining Oracle GoldenGate Trail Files

Accenture EnkitecGroupE4The only conference with a focus on the Oracle Exadata platform

REGISTER TODAYJune 1–2, 2015Dallas, Texaswww.enkitec.com/e4/register

Page 6: Examining Oracle GoldenGate Trail Files

What is GoldenGate?

Page 7: Examining Oracle GoldenGate Trail Files

GoldenGate ArchitecturesUnidirectionalQuery Offloading

Zero-Downtime Migration

Data Integration Cloud or

On-Premise

Bi-DirectionalActive-Active for Multi-

Master/HA

Cloud or On-Premises

Data Distributionvia Messaging

Cloud Apps Integration

Big Data DeliveryReal/Time and Batch Delivery

Structured Data to Data Reservoir

Page 8: Examining Oracle GoldenGate Trail Files

CaptureTrail

FilesPump

DeliveryTrail

Files

Capture (extract): committed transactions are captured (and can be filtered) as they occur by reading the transaction logs. As

of V.11.2.1, GoldenGate offers two options for capture for Oracle; Classic & Integrated Capture

Trail: stages and queues data for routing.

Pump: distributes data for routing to target(s).

Route: data is compressed, encrypted for routing to target(s).

Delivery: applies data with transaction integrity. New with

GoldenGate 12c, Integrated Delivery (replicat).

MGRMGR

GoldenGate Architecture Example

Page 9: Examining Oracle GoldenGate Trail Files

What are Trail Files?

Page 10: Examining Oracle GoldenGate Trail Files

Create Trails

Local

- EXTTRAILADD EXTTRAIL ./dirdat/lt, EXTRACT <group>, MEGABYTES <size>

Remote

- RMTTRAIL

ADD RMTTRAIL ./dirdat/rt, EXTRACT <group>, MEGABYTES <size>

Page 11: Examining Oracle GoldenGate Trail Files

Change Trail File Size

Local

- EXTTRAILALTER EXTTRAIL ./dirdat/lt, EXTRACT <group>, MEGABYTES <size>

Remote

- RMTTRAIL

ALTER RMTTRAIL ./dirdat/rt, EXTRACT <group>, MEGABYTES <size>

RolloverSEND EXTRACT <group>, rollover

Page 12: Examining Oracle GoldenGate Trail Files

CaptureTrail

FilesPump

DeliveryTrail

Files

GoldenGate Trail Files

./dirdat/lt ./dirdat/rt

./dirdat/lt00000# ./dirdat/rt00000#

Page 13: Examining Oracle GoldenGate Trail Files

CaptureTrail

FilesPump

DeliveryTrail

Files

GoldenGate Trail Files

./dirdat/lt00000#

File

HeaderTrans

Rec* * * *

Trans

Rec

Trans

Rec

Record

HeaderUser

TokensGGS

TokensGHDR DATA

Record

Trailer

Page 14: Examining Oracle GoldenGate Trail Files

When should Trail Files be

consulted?

Page 15: Examining Oracle GoldenGate Trail Files

How do you interact with Trail Files?

Page 16: Examining Oracle GoldenGate Trail Files

Logdump Utility

Located at:$OGG_HOME/logdump

Page 17: Examining Oracle GoldenGate Trail Files

Logdump Basic Commands

Command Description

OPEN Open Trail File

GHDR ON View record header

DETAIL [ ON | OFF | DETAIL] Adds column information/HEX & ASCII

data

USERTOKEN [ ON | OFF ] Display any user tokens

GGSTOKEN [ ON | OFF ] Display any automatically generated

tokens

RECLEN <integer> Controls the length of the record

displayed

Page 18: Examining Oracle GoldenGate Trail Files

Trail File NavigationCommand Description

NEXT First record then move to the next, in order

SKIP Skips down <count> records

POSITION <RBA> Set position in file [ <rba> | FIRST | LAST | EOF ]

SCANFORRBA Find the next record with rba

SCANFORHEADER Search for the start of a header

SCANFORTYPE Find the next record of <type>

SCANFORTIME Find the next record with timestamp

SCANFORENDTRANS Find the end of the current transaction

SCANFORNEXTTRANS Find start of the next transaction

Page 19: Examining Oracle GoldenGate Trail Files

Trail File Navigation (cont)

Command Description

FILTER Filter the display of records

DUMP Display the specific number of bytes of data from the

current position

ARGENTNODATACHAN

GES |

ARSTOPNODATACHAN

GES

Include/Excludes records that did not result in

changes to the database

Page 20: Examining Oracle GoldenGate Trail Files

EXAMPLE

Page 21: Examining Oracle GoldenGate Trail Files

Logdump Record Hdr-Ind : E (x45) Partition : . (x04)

UndoFlag : . (x00) BeforeAfter: A (x41)

RecLength : 157 (x009d) IO Time : 2015/04/07 21:48:58.000.000

IOType : 5 (x05) OrigNode : 255 (xff)

TransInd : . (x01) FormatType : R (x52)

SyskeyLen : 0 (x00) Incomplete : . (x00)

AuditRBA : 622 AuditPos : 14273756

Continued : N (x00) RecCount : 1 (x01)

2015/04/07 21:48:58.000.000 Insert Len 157 RBA 1818

Name: GGPDB.SOE.ADDRESSES

After Image: Partition 4 G m

0000 000a 0000 0000 0000 0016 e361 0001 000a 0000 | .............a......

0000 0000 000f 4241 0002 0015 0000 3230 3135 2d30 | ......BA......2015-0

342d 3037 3a32 313a 3438 3a30 3000 0300 0700 0000 | 4-07:21:48:00.......

0331 3432 0004 000f 0000 000b 5374 7265 6574 204e | .142........Street N

616d 6500 0500 0a00 0000 0649 7276 696e 6500 0600 | ame........Irvine...

0f00 0000 0b57 6573 7420 5375 7373 6578 0007 000d | .....West Sussex....

0000 0009 4c69 7468 7561 6e69 6100 0800 0c00 0000 | ....Lithuania.......

Column 0 (x0000), Len 10 (x000a)

0000 0000 0000 0016 e361 | .........a

Column 1 (x0001), Len 10 (x000a)

0000 0000 0000 000f 4241 | ........BA

.......

GGS tokens:

5200 0014 4141 4157 6b35 4141 5141 4141 4153 6d41 | R...AAAWk5AAQAAAASmA

4259 0001 | BY..

.

Logdump 1 >open ./dirdat/lt000000

Logdump 2 >ghdr on

Logdump 3 >detail on

Logdump 4 >detail data

Logdump 5 >usertoken on

Logdump 6 >ggstoken on

Logdump 7 >next

Page 22: Examining Oracle GoldenGate Trail Files

Examine Record - Header

Hdr-Ind : E (x45) Partition : . (x04)

UndoFlag : . (x00) BeforeAfter: A (x41)

RecLength : 157 (x009d) IO Time : 2015/04/07 21:48:58.000.000

IOType : 5 (x05) OrigNode : 255 (xff)

TransInd : . (x01) FormatType : R (x52)

SyskeyLen : 0 (x00) Incomplete : . (x00)

AuditRBA : 622 AuditPos : 14273756

Continued : N (x00) RecCount : 1 (x01)

.

Page 23: Examining Oracle GoldenGate Trail Files

Examine Record - Body

2015/04/07 21:48:58.000.000 Insert Len 157 RBA 1818

Name: GGPDB.SOE.ADDRESSES

After Image: Partition 4 G m

0000 000a 0000 0000 0000 0016 e361 0001 000a 0000 | .............a......

0000 0000 000f 4241 0002 0015 0000 3230 3135 2d30 | ......BA......2015-0

342d 3037 3a32 313a 3438 3a30 3000 0300 0700 0000 | 4-07:21:48:00.......

0331 3432 0004 000f 0000 000b 5374 7265 6574 204e | .142........Street N

616d 6500 0500 0a00 0000 0649 7276 696e 6500 0600 | ame........Irvine...

0f00 0000 0b57 6573 7420 5375 7373 6578 0007 000d | .....West Sussex....

0000 0009 4c69 7468 7561 6e69 6100 0800 0c00 0000 | ....Lithuania.......

Column 0 (x0000), Len 10 (x000a)

0000 0000 0000 0016 e361 | .........a

Column 1 (x0001), Len 10 (x000a)

0000 0000 0000 000f 4241 | ........BA

.......

GGS tokens:

5200 0014 4141 4157 6b35 4141 5141 4141 4153 6d41 | R...AAAWk5AAQAAAASmA

4259 0001 | BY..

.

Page 24: Examining Oracle GoldenGate Trail Files