0% found this document useful (0 votes)
95 views

Find Transaction SQL From RBA Source & Target

1. To find the SQL statement and values that caused a replication failure, edit the replicat parameters to disable bind variables and show the actual SQL syntax. 2. This will display the SQL statement with the literal values substituted in the error log, rather than just showing the statement with bind variables. 3. By viewing the SQL with values, you can identify which row the statement was trying to apply on the target that caused the error.

Uploaded by

Ian Hughes
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views

Find Transaction SQL From RBA Source & Target

1. To find the SQL statement and values that caused a replication failure, edit the replicat parameters to disable bind variables and show the actual SQL syntax. 2. This will display the SQL statement with the literal values substituted in the error log, rather than just showing the statement with bind variables. 3. By viewing the SQL with values, you can identify which row the statement was trying to apply on the target that caused the error.

Uploaded by

Ian Hughes
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Find Transaction SQL from RBA Source & Target

logdump> open <trailfile location="">


logdump> GHDR ON
logdump> DETAIL DATA
logdump> HEADERTOKEN
logdump> GGSTOKEN detail
logdump> pos <rba of="" record="">
TokenID x47 'G' Record Header Info x01 Length 1180
TokenID x48 'H' GHDR Info x00 Length 55
4504 0041 0417 0fff 02f2 052c 5ca7 4670 0000 0000 | E..A.......,\.Fp....
05c2 b45c 0001 83f6 0352 0000 0001 4e53 5044 4241 | ...\.....R....dummy
2e4e 5350 5f49 4e56 454e 544f 5259 00 | .DUMMY_INVENTORY.
TokenID x44 'D' Data Info x00 Length 1047
TokenID x54 'T' GGS Tokens Info x00 Length 58
TokenID x5a 'Z' Record Trailer Info x01 Length 1180
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x04)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 1047 (x0417) IO Time : 2013/06/12 14:08:51.000.944
IOType : 15 (x0f) OrigNode : 255 (xff)
TransInd : . (x03) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
---------------------------------------------------------------
---------------------------------------------------------------
--AuditRBA is Redo sequence Number , AuditPos is SCN
AuditRBA : 99318 AuditPos : 96646236
---------------------------------------------------------------
---------------------------------------------------------------
Continued : N (x00) RecCount : 1 (x01)

2013/06/12 14:08:51.000.944 FieldComp Len 1047 RBA 433498317


Name: DUMMYDBA.DUMMY_INVENTORY
After Image: Partition 4 G s
0000 000e 0000 000a 4d37 3266 3833 6464 3034 0001 | ........M72f83dd04..
0003 0000 4e00 0200 0c00 0000 0847 5244 4e43 4130 | ....N........GRDNCA0
3100 0300 0900 0000 0531 3256 5450 0004 0009 0000 | 1........12VTP......
0005 3131 5437 5600 0500 0a00 0000 0633 3130 3231 | ..11T7V........31021
3700 0600 0a00 0000 0634 3130 3630 3600 0700 0300 | 7........410606.....
004e 0008 0003 0000 4e00 0900 0300 004e 000a 0008 | .N......N......N....
0000 0004 4654 544e 000b 0015 ffff 3139 3030 2d30 | ....FTTN......1900-0
Column 0 (x0000), Len 14 (x000e)
0000 000a 4d37 3266 3833 6464 3034 | ....M72f83dd04
Column 1 (x0001), Len 3 (x0003)
0000 4e | ..N
Column 2 (x0002), Len 12 (x000c)
0000 0008 4752 444e 4341 3031 | ....GRDNCA01
Column 3 (x0003), Len 9 (x0009)
0000 0005 3132 5654 50 | ....12VTP
Column 4 (x0004), Len 9 (x0009)
0000 0005 3131 5437 56 | ....11T7V
Column 5 (x0005), Len 10 (x000a)
0000 0006 3331 3032 3137 | ....310217
Column 6 (x0006), Len 10 (x000a)
0000 0006 3431 3036 3036 | ....410606
Column 57 (x0039), Len 4 (x0004)
ffff 3139 3030 2d30 312d 3031 3a30 303a 3030 3a30 | ..1900-01-01:00:00:0
30 | 0
Column 78 (x004e), Len 21 (x0015)
ffff 3139 3030 2d30 312d 3031 3a30 303a 3030 3a30 | ..1900-01-01:00:00:0
30 | 0
Column 79 (x004f), Len 4 (x0004)
ffff 0000 | ....
Column 80 (x0050), Len 5 (x0005)
0000 0001 59 | ....Y
GGS tokens:
TokenID x52 'R' ORAROWID Info x00 Length 20
4141 4338 6c39 4143 6d41 4141 7a68 3141 4148 0001 | AAC8l9ACmAAAzh1AAH..
TokenID x4c 'L' LOGCSN Info x00 Length 14
3133 3332 3539 3536 3332 3432 3337 | 13325956324237
------XID Transactions.
TokenID x36 '6' TRANID Info x00 Length 12
3332 2e32 382e 3831 3139 3133 | 32.28.811913
</rba></trailfile>

==================================================================================

1. Transaction XID will be at end of Logdump record format.


2. This way we can find XID, redo log sequence and SCN of Record.
3. Now how to find Original transaction.
4. Go to source database.
5. Find Location of Archivelog sequence which is in AuditRBA in our case it is 99318.

spool output.txt
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
set numformat 9999999999999999999999
set long 999999
set lines 190
set pages 555

exec dbms_logmnr.add_logfile(' complete path of arc seq 99318 ');

exec dbms_logmnr.start_logmnr(options=>dbms_logmnr.dict_from_online_catalog);

select username, os_username, DATA_OBJ#, rbasqn, RBABLK, rbabyte, RS_ID, row_id,


rollback, seg_name,seg_owner,operation, timestamp, sql_redo, scn, cscn from
v$logmnr_contents where xidusn || '.' || xidslt || '.' || xidsqn='32.28.811913';
EXECUTE DBMS_LOGMNR.END_LOGMNR;

spool off;

=======================================================================================

AnonymousDecember 5, 2014 at 2:15 AM

can we check from target

Reply AnonymousDecember 5, 2014 at 2:16 AM

i mean my repicate is abended for particular rba . i need to check it from target . please tell me how

Reply Jignesh KankrechaFebruary 23, 2015 at 12:37 PM

Yes, You can. Infact you can see actual SQL statement

Reply AnonymousMarch 5, 2015 at 10:21 PM

Jignesh please tell me how


Reply Jignesh KankrechaMarch 6, 2015 at 1:25 PM

Please visit.

http://oracleabout.blogspot.com/2015/03/find-dml-sql-statement-values-caused.html?
_sm_au_=iVVW3570R0T1RfkP

Reply AnonymousMarch 13, 2015 at 3:43 AM

thnq. one more doubt. Can i get the rba nos which id doin the same transaction in one trail filr

Find DML SQL statement literal values caused Replicate to Abended.


Generally in Goldengate replicat apply SQL using bind variable so when error occurs report file or error log will have SQL
statement with bind
variable. This is hard to catch which literal values caused a problem at Target side. Below is example to see Which literal
values caused a
problem.

--Error log / Reporfile (Normal Mode)


2013-05-15 11:08:31 WARNING OGG-01004 Oracle GoldenGate Delivery for Oracle, rbmdr.prm:
Aborted grouped transaction on 'DUMMY_ADMIN_6.DUMMYEVENT', Database error 1403 (OCI Error ORA-01403: no
data found, SQL <delete *+="" restrict_all_ref_cons="" *="" from="" "dummy_admin_6"."dummyevent"=""
where="" "account_num"=":b0" and="" "event_seq"=":b1" "dummy_source"=":b2" "dummy_id"=":b3"
"event_ref"=":b4">).
2013-05-15 11:08:31 WARNING OGG-01154 Oracle GoldenGate Delivery for Oracle, rbmdr.prm:
SQL error 1403 mapping DUMMY_ADMIN.DUMMYEVENT to DUMMY_ADMIN_6.DUMMYEVENT OCI Error ORA-01403: no data
found, SQL <delete *+="" restrict_all_ref_cons="" *="" from="" "dummy_admin_6"."dummyevent"="" where=""
"account_num"=":b0" and="" "event_seq"=":b1" "dummy_source"=":b2" "dummy_id"=":b3" "event_ref"=":b4">.
2013-05-15 11:08:31 ERROR OGG-01296 Oracle GoldenGate Delivery for Oracle, rbmdr.prm:
Error mapping from DUMMY_ADMIN.DUMMYEVENT to DUMMY_ADMIN_6.DUMMYEVENT.
</delete></delete>

--Edit below parameters in replicat and start again.


NOBINARYCHARS
NODYNSQL
SHOWSYNTAX

--Error log / Reporfile (Actual value)


2013-05-15 11:17:35 WARNING OGG-01004 Oracle GoldenGate Delivery for Oracle, rbmdr.prm:
Aborted grouped transaction on 'DUMMY_ADMIN_6.DUMMYEVENT', Database error 1403 (OCI Error ORA-01403: no
data found, SQL <delete *+="" restrict_all_ref_cons="" *="" from="" "dummy_admin_6"."dummyevent"=""
where="" "account_num"="1001" and="" "event_seq"="1" "dummy_source"="XYZ1234" "dummy_id"="1"
"event_ref"="1010101">).
2013-05-15 11:17:35 WARNING OGG-01154 Oracle GoldenGate Delivery for Oracle, rbmdr.prm:
SQL error 1403 mapping DUMMY_ADMIN.DUMMYEVENT to DUMMY_ADMIN_6.DUMMYEVENT OCI Error ORA-01403: no data
found, SQL <delete *+="" restrict_all_ref_cons="" *="" from="" "dummy_admin_6"."dummyevent"="" where=""
"account_num"="1001" and="" "event_seq"="1" "dummy_source"="XYZ1234" "dummy_id"="1"
"event_ref"="1010101">.
2013-05-15 11:17:35 ERROR OGG-01296 Oracle GoldenGate Delivery for Oracle, rbmdr.prm:
Error mapping from DUMMY_ADMIN.DUMMYEVENT to DUMMY_ADMIN_6.DUMMYEVENT.
</delete></delete>

You might also like