This is purely for understanding the RBA. please do not try this in production environment without proper understanding and knowledge of your goldengate replicat configuration.
reverting back the Replicat RBA will impact all the tables in replicat group. so be cautious.
Demo:-
below are the RBA noted for testing.
before insert
2018-12-22 00:34:34.316052 RBA 1486 --> got RBA from output > info rep1, detail
after 1st insert
2018-12-22 01:10:50.000000 RBA 2127
after 2nd insert
2018-12-22 01:14:09.000000 RBA 2264
reverting back the Replicat RBA will impact all the tables in replicat group. so be cautious.
Demo:-
below are the RBA noted for testing.
before insert
2018-12-22 00:34:34.316052 RBA 1486 --> got RBA from output > info rep1, detail
after 1st insert
2018-12-22 01:10:50.000000 RBA 2127
after 2nd insert
2018-12-22 01:14:09.000000 RBA 2264
SQL> conn us01/us01
Connected.
SQL> select * FROM TB1;
ID NAME DEPT
---------- -------------------- --------------------
3 RAMESH IT
4 VIDHYA MEDICAL
1 DEEKSHI IT
2 PRITHVI IT
SQL> insert into tb1 values (5, 'PRIYA', 'MEDICAL');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> insert into tb1 values(6, 'SUBHA','IT');
1 row created.
SQL> COMMIT;
Commit complete.
SQL>
[oracle@rac1]$ sqlplus demo/demo
SQL> truncate table tb1;
Table truncated.
SQL> select * from tb1;
no rows selected
GGSCI (rac1.localdomain) 7> info rep1
REPLICAT REP1 Last Started 2018-12-22 00:34 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:01 ago)
Process ID 13828
Log Read Checkpoint File /home/oracle/gghome/dirdat/ex000000002
2018-12-22 00:34:34.316052 RBA 1486
GGSCI (rac1.localdomain) 8> info rep1, detail
REPLICAT REP1 Last Started 2018-12-22 00:34 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:06 ago)
Process ID 13828
Log Read Checkpoint File /home/oracle/gghome/dirdat/ex000000002
2018-12-22 00:34:34.316052 RBA 1486
Current Log BSN value: (requires database login)
Last Committed Transaction CSN value: (requires database login)
Extract Source Begin End
/home/oracle/gghome/dirdat/ex000000002 2018-12-21 01:14 2018-12-22 00:34
/home/oracle/gghome/dirdat/ex000000001 2018-12-21 01:01 2018-12-21 01:14
/home/oracle/gghome/dirdat/ex000000000 * Initialized * 2018-12-21 01:01
/home/oracle/gghome/dirdat/ex000000000 * Initialized * First Record
Current directory /home/oracle/gghome
Report file /home/oracle/gghome/dirrpt/REP1.rpt
Parameter file /home/oracle/gghome/dirprm/rep1.prm
Checkpoint file /home/oracle/gghome/dirchk/REP1.cpr
Checkpoint table ogguser.checkpointtable
Process file /home/oracle/gghome/dirpcs/REP1.pcr
Error log /home/oracle/gghome/ggserr.log
GGSCI (rac1.localdomain) 59> stop rep1
Sending STOP request to REPLICAT REP1 ...
Request processed.
Logdump 73 >open /home/oracle/gghome/dirdat/ex000000002
Current LogTrail is /home/oracle/gghome/dirdat/ex000000002
Logdump 87 >pos 2264
Reading in reverse from RBA 2264
Logdump 88 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x0c)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 32 (x0020) IO Time : 2018/12/22 01:14:09.000.000
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x03) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 56 AuditPos : 2091024
Continued : N (x00) RecCount : 1 (x01)
2018/12/22 01:14:09.000.000 Insert Len 32 RBA 2127
Name: US01.TB1 (TDR Index: 1)
After Image: Partition 12 G s
0000 0500 0000 0100 3601 0009 0000 0005 0053 5542 | ........6........SUB
4841 0200 0600 0000 0200 4954 | HA........IT
Logdump 89 >detail on
Logdump 90 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x0c)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 37 (x0025) IO Time : 2018/12/22 01:10:50.000.000
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x03) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 56 AuditPos : 1452560
Continued : N (x00) RecCount : 1 (x01)
2018/12/22 01:10:50.000.000 Insert Len 37 RBA 1980
Name: US01.TB1 (TDR Index: 1)
After Image: Partition 12 G s
0000 0500 0000 0100 3501 0009 0000 0005 0050 5249 | ........5........PRI
5941 0200 0b00 0000 0700 4d45 4449 4341 4c | YA........MEDICAL
Column 0 (x0000), Len 5 (x0005)
Column 1 (x0001), Len 9 (x0009)
Column 2 (x0002), Len 11 (x000b)
Logdump 91 >pos 2264
Reading in reverse from RBA 2264
Logdump 92 >usertoken detail
Logdump 93 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x0c)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 32 (x0020) IO Time : 2018/12/22 01:14:09.000.000
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x03) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 56 AuditPos : 2091024
Continued : N (x00) RecCount : 1 (x01)
2018/12/22 01:14:09.000.000 Insert Len 32 RBA 2127
Name: US01.TB1 (TDR Index: 1)
After Image: Partition 12 G s
0000 0500 0000 0100 3601 0009 0000 0005 0053 5542 | ........6........SUB
4841 0200 0600 0000 0200 4954 | HA........IT
Column 0 (x0000), Len 5 (x0005)
Column 1 (x0001), Len 9 (x0009)
Column 2 (x0002), Len 6 (x0006)
Logdump 94 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x0c)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 37 (x0025) IO Time : 2018/12/22 01:10:50.000.000
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x03) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 56 AuditPos : 1452560
Continued : N (x00) RecCount : 1 (x01)
2018/12/22 01:10:50.000.000 Insert Len 37 RBA 1980
Name: US01.TB1 (TDR Index: 1)
After Image: Partition 12 G s
0000 0500 0000 0100 3501 0009 0000 0005 0050 5249 | ........5........PRI
5941 0200 0b00 0000 0700 4d45 4449 4341 4c | YA........MEDICAL
Column 0 (x0000), Len 5 (x0005)
Column 1 (x0001), Len 9 (x0009)
Column 2 (x0002), Len 11 (x000b)
Logdump 95 >reclen 128
Reclen set to 128
Logdump 96 >pos 2264
Reading in reverse from RBA 2264
Logdump 97 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x0c)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 32 (x0020) IO Time : 2018/12/22 01:14:09.000.000
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x03) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 56 AuditPos : 2091024
Continued : N (x00) RecCount : 1 (x01)
2018/12/22 01:14:09.000.000 Insert Len 32 RBA 2127
Name: US01.TB1 (TDR Index: 1)
After Image: Partition 12 G s
0000 0500 0000 0100 3601 0009 0000 0005 0053 5542 | ........6........SUB
4841 0200 0600 0000 0200 4954 | HA........IT
Column 0 (x0000), Len 5 (x0005)
Column 1 (x0001), Len 9 (x0009)
Column 2 (x0002), Len 6 (x0006)
Logdump 98 >n
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x0c)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 37 (x0025) IO Time : 2018/12/22 01:10:50.000.000
IOType : 5 (x05) OrigNode : 255 (xff)
TransInd : . (x03) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 56 AuditPos : 1452560
Continued : N (x00) RecCount : 1 (x01)
2018/12/22 01:10:50.000.000 Insert Len 37 RBA 1980
Name: US01.TB1 (TDR Index: 1)
After Image: Partition 12 G s
0000 0500 0000 0100 3501 0009 0000 0005 0050 5249 | ........5........PRI
5941 0200 0b00 0000 0700 4d45 4449 4341 4c | YA........MEDICAL
Column 0 (x0000), Len 5 (x0005)
Column 1 (x0001), Len 9 (x0009)
Column 2 (x0002), Len 11 (x000b)
Logdump 99 >
GGSCI (rac1.localdomain) 60> alter replicat rep1, extrba 2127
2018-12-22 01:57:38 INFO OGG-06594 Replicat REP1 has been altered. Even the start up position might be updated, duplicate suppression remains active in next startup. To override duplicate suppression, start REP1 with NOFILTERDUPTRANSACTIONS option.
REPLICAT altered.
GGSCI (rac1.localdomain) 61> start replicat rep1 NOFILTERDUPTRANSACTIONS
Sending START request to MANAGER ...
REPLICAT REP1 starting
GGSCI (rac1.localdomain) 62> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EX1 00:00:00 00:00:08
REPLICAT RUNNING REP1 00:00:00 00:00:05
login to demo schema check the table data in table TB1
SQL> /
ID NAME DEPT
---------- -------------------- --------------------
6 SUBHA IT
SQL> truncate table tb1;
Table truncated.
Stop replicat again and alter replicat to begin with previous RBA and check the table data again.
GGSCI (rac1.localdomain) 53> stop replicat rep1
REPLICAT REP1 is already stopped.
GGSCI (rac1.localdomain) 54> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EX1 00:00:00 00:00:06
REPLICAT ABENDED REP1 00:00:00 00:00:27
GGSCI (rac1.localdomain) 55> alter replicat rep1, extrba 1980
2018-12-22 01:56:20 INFO OGG-06594 Replicat REP1 has been altered. Even the start up position might be updated, duplicate suppression remains active in next startup. To override duplicate suppression, start REP1 with NOFILTERDUPTRANSACTIONS option.
REPLICAT altered.
GGSCI (rac1.localdomain) 56> start replicat rep1 NOFILTERDUPTRANSACTIONS
Sending START request to MANAGER ...
REPLICAT REP1 starting
GGSCI (rac1.localdomain) 57> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EX1 00:00:00 00:00:09
REPLICAT RUNNING REP1 00:00:00 00:00:03
check again the demo schema table TB1
ID NAME DEPT
---------- -------------------- --------------------
5 PRIYA MEDICAL
6 SUBHA IT
Hope, this helps.
No comments:
Post a Comment