Friday, March 20, 2020

OGG-01184 Expected 4 bytes, but got 0 bytes



 While starting my extract  it is getting ABENDED with below error

DB version  : 19c
OGG version : 19c
OS version : RHEL 7

GGSCI (myoraqe.domain.com) 4> start EXTQE

Sending START request to MANAGER ...
EXTRACT EXTQE starting

GGSCI (myoraqe.domain.com) 6> info EXTQE

EXTRACT    EXTQE   Last Started 2019-02-13 12:06   Status ABENDED
Checkpoint Lag       00:00:07 (updated 30:48:03 ago)
Log Read Checkpoint  Oracle Integrated Redo Logs
                     2019-02-12 05:18:53
                     SCN 88.3221809052 (381178931100)

2019-02-13 12:06:27  ERROR   OGG-01184  Expected 4 bytes, but got 0 bytes, in trail /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001148, seqno 1148, reading record trailer token at RBA 1525.

2019-02-13 12:06:27  ERROR   OGG-01668  PROCESS ABENDING.


Extract Abends with "Expected <n> bytes, but got <n> bytes, in trail " (Doc ID 1968574.1)


GGSCI (myoraqe.domain.com) 10> info PXTQE

EXTRACT    PXTQE   Last Started 2019-02-08 16:43   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:08 ago)
Process ID           170397
Log Read Checkpoint  File /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001148
                     First Record  RBA 0


GGSCI (myoraqe.domain.com) 11> send PXTQE logend

Sending LOGEND request to EXTRACT PXTQE ...
YES.


GGSCI (myoraqe.domain.com) 12> stop PXTQE

Sending STOP request to EXTRACT PXTQE ...
STOP request pending. Recovery is not complete.
This normal stop will wait and checkpoint recovery's work when recovery has finished.
To force Extract to stop now, use the SEND EXTRACT PXTQE, FORCESTOP command..


GGSCI (myoraqe.domain.com) 13> info PXTQE

EXTRACT    PXTQE   Last Started 2019-02-08 16:43   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:06 ago)
Process ID           170397
Log Read Checkpoint  File /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001148
                     First Record  RBA 0


GGSCI (myoraqe.domain.com) 14> !
info PXTQE

EXTRACT    PXTQE   Last Started 2019-02-08 16:43   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:06 ago)
Process ID           170397
Log Read Checkpoint  File /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001148
                     First Record  RBA 0


GGSCI (myoraqe.domain.com) 15> send PXTQE logend

Sending LOGEND request to EXTRACT PXTQE ...
YES.


GGSCI (myoraqe.domain.com) 16> stop PXTQE !

Sending FORCESTOP request to EXTRACT PXTQE ...
STOP request will be executed immediately (recovery aborted).


GGSCI (myoraqe.domain.com) 17> alter EXTQE ETROLLOVER

2019-02-13 12:11:38  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.
EXTRACT altered.


GGSCI (myoraqe.domain.com) 18> start EXTQE

Sending START request to MANAGER ...
EXTRACT EXTQE starting


GGSCI (myoraqe.domain.com) 19> info EXTQE

EXTRACT    EXTQE   Last Started 2019-02-13 12:11   Status RUNNING
Checkpoint Lag       25:04:57 (updated 00:00:03 ago)
Process ID           268862
Log Read Checkpoint  Oracle Integrated Redo Logs
                     2019-02-12 11:06:51
                     SCN 88.3221882653 (381179004701)


GGSCI (myoraqe.domain.com) 20> alter PXTQE extseqno 1149 extrba 00
EXTRACT altered.


GGSCI (myoraqe.domain.com) 21> start PXTQE

Sending START request to MANAGER ...
EXTRACT PXTQE starting


GGSCI (myoraqe.domain.com) 22> info PXTQE

EXTRACT    PXTQE   Last Started 2019-02-13 12:12   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:02 ago)
Process ID           270788
Log Read Checkpoint  File /goldengate/home/dirdat/SRC/sxtqe/tgxqe/mt000001149
                     First Record  RBA 0


GGSCI (myoraqe.domain.com) 23> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
JAGENT      RUNNING
EXTRACT     RUNNING     ESXTQEQ1     00:00:05      00:00:07
EXTRACT     RUNNING     ESXTQEQ2     00:00:07      00:00:00
EXTRACT     RUNNING     EXTQE     00:00:05      00:00:02
EXTRACT     RUNNING     PSXTQEQ1     00:00:00      00:00:10
EXTRACT     STOPPED     PSXTQEQ2     00:00:00      339:08:25
EXTRACT     RUNNING     PXTQE     00:00:00      00:00:05

Goldengate Tracing



To enable trace for EXT/PUMP/REPLICAT we can achieve in 2 ways

1.        Using trace/trace2 command
2.        Using Activity Logging


GGSCI (myoradev.domain.com) 2> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     RTRG1DB    82:10:06      00:00:00
REPLICAT    RUNNING     RTRG2DB    00:00:00      00:00:08

Add below trace command in your param file and the restart and wait for some time and stop the process then you see trace file with the path you specified is generated and you can view the file

TRACE /goldengate/home/dirrpt/trace.trc
(or)
TRACE2 /goldengate/home/dirrpt/trace2.trc

where
TRACE    :   Provides step-by-step processing information.
TRACE2  :   Identifies the code segments on which Extract or Replicat is spending the most time.

Or if you want to enable trace ONLINE without stopping the GG Process then use the below send command which will enable trace and then turn off whenever you want

GGSCI (myoradev.domain.com) 3> send RTRG1DB trace RTRG1DB_trace.txt

Sending trace request to REPLICAT RTRG1DB ...
Trace file /goldengate/home/RTRG1DB_trace.txt opened.

To Stop/Disable Trace :

GGSCI (myoradev.domain.com) 4> send RTRG1DB trace off

Sending trace request to REPLICAT RTRG1DB ...
Closing all trace files..

Activity tracing :

1. Please save the below xml file with your process name like gglog-EXTNAME.xml , the process name should be CAPITAL letters .
2. Copy gglog-EXTNAME.xml to the Oracle GoldenGate Installation Directory.
3. Start the process and perform the DML/DDL operations
4. Move the gglog-EXTNAME.xml file to different location. Then it will stop the logging.
5. There will be a log generated in the same Oracle GoldenGate installation directory with name gglog-EXTNAME.log

<?xml version="1.0"?>
<configuration reset="true">
<appender name="myAppender" class="RollingFileAppender">
<param name="File" value="gglog-%I.log"/>
<param name="MaxBackupIndex" value="9"/>
<param name="BufferedIO" value="false"/>
<param name="MaxFileSize" value="10MB" />
<layout class="PatternLayout">
<param name="Pattern" value="%d{%Y-%m-%d %H:%M:%S} %-5p|%-30.30c|%5L %-24.24C{2} | %m%n"/>
</layout>
</appender>
<root>
<level value="all"/>
<appender-ref name="myAppender"/>
</root>
</configuration>

Oracle Reference Doc: 
OGG Activity Logging Tracing (Doc ID 1204284.1)

Auto Scroll Stop Scroll