In sweet memories of my ever loving brother "kutty thambi " ARUN KUMAR

Sunday, December 23, 2018

DDL Replication and DDL mapping Restriction DEMO in oracle goldengate


The components that support the replication of DDL and the replication of transactional data changes (DML) are independent of each other. Therefore, you can synchronize:
  • just DDL changes
  • just DML changes
  • both DDL and DML
By default the DDL replication is disabled on the source database (extract side) but is enabled on the target Database (replicat side).
If you need to capture DDL from replicated process, then you need to configure the extract with GETREPLICATES.
Only supports Oracle Database to Oracle Database replications.
The source and target object definitions must be identical.
In Oracle database 12c, DDL replication does not require any setup of triggers as it is natively supported at the database level, you no longer need to run the SQL scripts such as marker_setup.sql and ddl_setup.sql to set up the DDL replication.


Configure Extract Process with DDL Replication

For learning purpose, I have configured both EXTRACT and REPLICAT in same server same database ggtest1
Adding “DDL INCLUDE MAPPED” enables extracting the DDL 
Don’t forget to add DDL INCLUDE MAPPED in the Pump and Replicat processes.


Sample :- Extract parameter file and REPLICAT parameter file

GGSCI (rac1.localdomain) 10> view params ex1

EXTRACT ex1
userid ogguser@ggtest1, password oracle
TRANLOGOPTIONS DBLOGREADER, DBLOGREADERBUFSIZE 4194304
DISCARDFILE /home/oracle/gghome/dirrpt/ex1.dsc, APPEND, MEGABYTES 50
EXTTRAIL /home/oracle/gghome/dirdat/ex
DDL INCLUDE MAPPED
TABLE us01.*;

GGSCI (rac1.localdomain) 11> view params rep2

REPLICAT rep2
USERID ogguser@ggtest1, PASSWORD oracle
DISCARDFILE /home/oracle/gghome/dirrpt/rep2.dsc, APPEND, MEGABYTES 90
HANDLECOLLISIONS
ASSUMETARGETDEFS
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE
MAP us01.*, TARGET demo.*;

GGSCI (rac1.localdomain) 21> start ex1

Sending START request to MANAGER ...
EXTRACT EX1 starting


GGSCI (rac1.localdomain) 22> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     EX1         00:00:00      00:00:01    
REPLICAT    STOPPED     REP2        00:00:00      00:04:04    


GGSCI (rac1.localdomain) 23> start rep2

Sending START request to MANAGER ...
REPLICAT REP2 starting


GGSCI (rac1.localdomain) 25> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     EX1         00:00:00      00:00:00    
REPLICAT    RUNNING     REP2        00:00:00      00:00:00    

Testing by adding table and  add, modify, drop column in source schema database.

ON SOURCE SCHEMA US01

SQL> select * from tab;

TNAME TABTYPE CLUSTERID
--------------- --------------- ----------
TB2 TABLE
TB1 TABLE

SQL> show user
USER is "US01"
SQL> create table tb3 as select * from tb1;

Table created.

SQL> select * from tab;

TNAME TABTYPE CLUSTERID
--------------- --------------- ----------
TB1 TABLE
TB2 TABLE
TB3 TABLE


on Target Schema DEMO, We can see the data replication 

SQL> col tname for a15
SQL> col tabtype for a15
SQL> select * from tab;

TNAME TABTYPE   CLUSTERID
--------------- --------------- ----------
TB1 TABLE
TB2 TABLE

SQL> show user
USER is "DEMO"
SQL> select * from tab;

TNAME TABTYPE   CLUSTERID
--------------- --------------- ----------
TB1 TABLE
TB2 TABLE
TB3 TABLE  --> Table created in DEMO schema

ON SOURCE SCHEMA US01

SQL> select count(*) from tb3;

  COUNT(*)
----------
6

SQL> set time on
20:42:57 SQL>               
20:43:08 SQL> truncate table tb3;

Table truncated.

20:43:14 SQL> select count(*) from tb3;

  COUNT(*)
----------
0

on Target Schema DEMO, We can see the data replication 

SQL> set time on
20:42:54 SQL> 
20:43:25 SQL> select count(*) from tb3;

  COUNT(*)
----------
 0  (After truncate statement executed on US01 schema replicated in demo)

ON SOURCE SCHEMA US01

20:43:22 SQL> insert into tb3 select * from tb1;

6 rows created.

20:43:48 SQL> commit;

Commit complete.

20:43:54 SQL> select count(*) from tb3;

  COUNT(*)
----------
6

on Target Schema DEMO, We can see the replication 

20:44:08 SQL> select count(*) from tb3;

  COUNT(*)
----------
 6 --> Data replicated in demo schema after insert statement in US01

ON SOURCE SCHEMA US01

20:44:20 SQL> desc tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)

20:48:04 SQL> alter table tb3 add (Address varchar2(20));

Table altered.

20:48:54 SQL> desc tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)
 ADDRESS     VARCHAR2(20)

on Target Schema DEMO, We can see the replication 

20:44:23 SQL> desc tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)

20:49:07 SQL> desc tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)
 ADDRESS     VARCHAR2(20) -->ADDRESS COLUMN added in replicat side

ON SOURCE SCHEMA US01

20:49:12 SQL> alter table tb3 drop column address;

Table altered.

20:49:41 SQL> desc tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)

on Target Schema DEMO, We can see the replication 

20:49:19 SQL> desc tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)
 COLUMN address dropped in demo schema TB3 Table

ON SOURCE SCHEMA US01

20:49:46 SQL> alter table tb3 modify (dept varchar2(40));

Table altered.

20:50:18 SQL> desc tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(40)

on Target Schema DEMO, We can see the replication 

20:49:53 SQL> desc tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(40)

Column DEPT modified from varchar2(20) to Varchar(40) 

ON SOURCE SCHEMA US01

20:50:23 SQL> drop table tb3 purge;

Table dropped.

20:50:49 SQL> select * from tab;

TNAME TABTYPE CLUSTERID
--------------- --------------- ----------
TB1 TABLE
TB2 TABLE

on Target Schema DEMO, We can see the replication 

20:50:28 SQL> select * from tab;

TNAME TABTYPE   CLUSTERID
--------------- --------------- ----------
TB2 TABLE
TB1 TABLE

Table TB3 dropped in DEMO Schema. 

Below is the DEMO of DDL replication restricting example if you do not want to drop statement replication we can restrict and allow set of DDL replication as shown below. 

Below is demo to DDL replication of only CREATE TABLE statement

GGSCI (rac1.localdomain) 11> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     EX1         00:00:00      00:00:09    
REPLICAT    RUNNING     REP2        00:00:00      00:00:01    


GGSCI (rac1.localdomain) 12> stop rep2

Sending STOP request to REPLICAT REP2 ...
Request processed.


GGSCI (rac1.localdomain) 13> stop ex1

Sending STOP request to EXTRACT EX1 ...
Request processed.


GGSCI (rac1.localdomain) 14> info all 

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     STOPPED     EX1         00:00:00      00:00:05    
REPLICAT    STOPPED     REP2        00:00:00      00:00:10    


GGSCI (rac1.localdomain) 16> edit params ex1



GGSCI (rac1.localdomain) 17> edit params rep2



GGSCI (rac1.localdomain) 18> edit params ex1



GGSCI (rac1.localdomain) 19> view params ex1

EXTRACT ex1
userid ogguser@ggtest1, password oracle
TRANLOGOPTIONS DBLOGREADER, DBLOGREADERBUFSIZE 4194304
DISCARDFILE /home/oracle/gghome/dirrpt/ex1.dsc, APPEND, MEGABYTES 50
EXTTRAIL /home/oracle/gghome/dirdat/ex
DDL INCLUDE MAPPED OPTYPE create OBJTYPE 'table'
TABLE us01.*;


GGSCI (rac1.localdomain) 20> view params rep2

REPLICAT rep2
USERID ogguser@ggtest1, PASSWORD oracle
DISCARDFILE /home/oracle/gghome/dirrpt/rep2.dsc, APPEND, MEGABYTES 90
HANDLECOLLISIONS
ASSUMETARGETDEFS
--DDL INCLUDE ALL
DDL INCLUDE MAPPED OPTYPE create OBJTYPE 'table'
DDLERROR DEFAULT IGNORE
MAP us01.*, TARGET demo.*;


GGSCI (rac1.localdomain) 21> start ex1

Sending START request to MANAGER ...
EXTRACT EX1 starting

GGSCI (rac1.localdomain) 23> start rep2

Sending START request to MANAGER ...
REPLICAT REP2 starting


GGSCI (rac1.localdomain) 25> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     EX1         00:00:00      00:00:00    
REPLICAT    RUNNING     REP2        00:00:00      00:00:00    

ON SOURCE SCHEMA US01

20:53:35 SQL> create table tb3 as select * from tb1;

Table created.

on Target Schema DEMO
21:19:28 SQL> /

TNAME TABTYPE CLUSTERID
--------------- --------------- ----------
TB3 TABLE
TB2 TABLE
TB1 TABLE

ON SOURCE SCHEMA US01

21:19:22 SQL> desc us01.TB3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)

21:19:42 SQL> alter table tb3 add (address varchar2(20));

Table altered.

21:20:12 SQL> desc US01.tb3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)
 ADDRESS     VARCHAR2(20)
on Target Schema DEMO
21:20:20 SQL> DESC DEMO.TB3
 Name    Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID     NUMBER
 NAME     VARCHAR2(20)
 DEPT     VARCHAR2(20)


added ADDRESS COLUMN not replicated due to mapping restriction
ALTER statement not replicated 


ON SOURCE SCHEMA US01

21:21:27 SQL> select * from tab;

TNAME TABTYPE CLUSTERID
--------------- --------------- ----------
TB1 TABLE
TB2 TABLE
TB3 TABLE

21:21:40 SQL> drop table tb3 purge;

Table dropped.

21:21:54 SQL> select * from tab;

TNAME TABTYPE CLUSTERID
--------------- --------------- ----------
TB1 TABLE
TB2 TABLE
on Target Schema DEMO
21:22:05 SQL> select * from tab;

TNAME TABTYPE CLUSTERID
--------------- --------------- ----------
TB1 TABLE
TB2 TABLE
TB3 TABLE --> Table still exists, DROP Statement not replicated due to mapping restriction. 

Sample mapping Extract and Replicat Parameter files to allow alter table, create index, alter index, create view, and alter view.


GGSCI (rac1.localdomain) 45> view params ex1

EXTRACT ex1
userid ogguser@ggtest1, password oracle
TRANLOGOPTIONS DBLOGREADER, DBLOGREADERBUFSIZE 4194304
DISCARDFILE /home/oracle/gghome/dirrpt/ex1.dsc, APPEND, MEGABYTES 50
EXTTRAIL /home/oracle/gghome/dirdat/ex
DDL INCLUDE MAPPED OPTYPE create OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'table' 
TABLE us01.*;


GGSCI (rac1.localdomain) 46> view params rep2

REPLICAT rep2
USERID ogguser@ggtest1, PASSWORD oracle
DISCARDFILE /home/oracle/gghome/dirrpt/rep2.dsc, APPEND, MEGABYTES 90
HANDLECOLLISIONS
ASSUMETARGETDEFS
--DDL INCLUDE ALL
DDL INCLUDE MAPPED OPTYPE create OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'table'
DDLERROR DEFAULT IGNORE
MAP us01.*, TARGET demo.*;


GGSCI (rac1.localdomain) 52> view params ex1

EXTRACT ex1
userid ogguser@ggtest1, password oracle
TRANLOGOPTIONS DBLOGREADER, DBLOGREADERBUFSIZE 4194304
DISCARDFILE /home/oracle/gghome/dirrpt/ex1.dsc, APPEND, MEGABYTES 50
EXTTRAIL /home/oracle/gghome/dirdat/ex
DDL INCLUDE MAPPED OPTYPE create OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'table' 
INCLUDE MAPPED OPTYPE create OBJTYPE 'index' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'index'
TABLE us01.*;


GGSCI (rac1.localdomain) 53> view params rep2

REPLICAT rep2
USERID ogguser@ggtest1, PASSWORD oracle
DISCARDFILE /home/oracle/gghome/dirrpt/rep2.dsc, APPEND, MEGABYTES 90
HANDLECOLLISIONS
ASSUMETARGETDEFS
--DDL INCLUDE ALL
DDL INCLUDE MAPPED OPTYPE create OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE create OBJTYPE 'index' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'index'
DDLERROR DEFAULT IGNORE
MAP us01.*, TARGET demo.*;

GGSCI (rac1.localdomain) 61> view params ex1

EXTRACT ex1
userid ogguser@ggtest1, password oracle
TRANLOGOPTIONS DBLOGREADER, DBLOGREADERBUFSIZE 4194304
DISCARDFILE /home/oracle/gghome/dirrpt/ex1.dsc, APPEND, MEGABYTES 50
EXTTRAIL /home/oracle/gghome/dirdat/ex
DDL INCLUDE MAPPED OPTYPE create OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE create OBJTYPE 'index' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'index' &
INCLUDE MAPPED OPTYPE create OBJTYPE 'view' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'view'
TABLE us01.*;


GGSCI (rac1.localdomain) 63> view params rep2

REPLICAT rep2
USERID ogguser@ggtest1, PASSWORD oracle
DISCARDFILE /home/oracle/gghome/dirrpt/rep2.dsc, APPEND, MEGABYTES 90
HANDLECOLLISIONS
ASSUMETARGETDEFS
--DDL INCLUDE ALL
DDL INCLUDE MAPPED OPTYPE create OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'table' &
INCLUDE MAPPED OPTYPE create OBJTYPE 'index' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'index' &
INCLUDE MAPPED OPTYPE create OBJTYPE 'view' &
INCLUDE MAPPED OPTYPE alter OBJTYPE 'view'
DDLERROR DEFAULT IGNORE
MAP us01.*, TARGET demo.*;



hope, this helps.

References:-
https://docs.oracle.com/goldengate/1212/gg-winux/GIORA/ddl.htm#GIORA307
http://www.juliandyke.com/Research/GoldenGate/GoldenGateDDLReplication.php
https://www.perftuning.com/blog/ddl-mapping-oracle-goldengate-12-2/
http://www.vitalsofttech.com/configure-goldengate-ddl-replication/
https://jinyuwang.weebly.com/for-oracle-db/goldengate-121-new-feature-how-to-configure-ddl-replications-in-oracle-goldengate




Saturday, December 22, 2018

Understanding RBA using demo by table data recover in goldengate environment

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


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.
free counters
 
Share/Bookmark