Presentation is loading. Please wait.

Presentation is loading. Please wait.

Experiences and Lessons Learned 6-Node Active-Active Oracle GoldenGate Luke Davies.

Similar presentations


Presentation on theme: "Experiences and Lessons Learned 6-Node Active-Active Oracle GoldenGate Luke Davies."— Presentation transcript:

1 Experiences and Lessons Learned 6-Node Active-Active Oracle GoldenGate Luke Davies

2 © 2012 – Pythian Why Pythian Recognized Leader: Global industry leader in data infrastructure managed services and consulting with expertise in Oracle, Oracle Applications, Microsoft SQL Server, MySQL, big data and systems administration Work with over 200 multinational companies such as Forbes.com, Fox Sports, Nordion and Western Union to help manage their complex IT deployments Expertise: One of the world’s largest concentrations of dedicated, full-time DBA expertise. Employ 8 Oracle ACEs/ACE Directors Hold 7 Specializations under Oracle Platinum Partner program, including Oracle Exadata, Oracle GoldenGate & Oracle RAC Global Reach & Scalability: 24/7/365 global remote support for DBA and consulting, systems administration, special projects or emergency response

3 © 2012 – Pythian About Luke Davies Team Technical Lead Oracle DBA since V6 (1990) BSc Microbiology With Pythian since 2008 Main Focus Oracle Core Oracle Performance Tuning

4 Set Up 6-Node Active-Active Oracle GoldenGate

5 © 2012 – Pythian Set Up Business requirements High availability Easily Scalable Application releases with zero downtime Database patches/upgrades with zero downtime Real-time reporting database with no impact to Online users Other application entry points with no impact to Online users Original Solution based on Oracle Standard Edition 10gR2 GoldenGate V10.4

6 © 2012 – Pythian Set Up

7 © 2012 – Pythian Set Up

8 Experiences and Lessons Learned 6-Node Active-Active Oracle GoldenGate

9 © 2012 – Pythian Topics Active/Active considerations Supplemental Logging DDL Replication Conflict Avoidance Conflict Detection Release Management Data comparison General considerations Trail file deletion Archive log deletion

10 © 2012 – Pythian Supplemental Logging Required at the database level (Minimum Level) ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; Minimal Supplemental Logging “logs the minimal amount of information needed for LogMiner to identify, group, and merge the redo operations associated with DML changes” Identification key logging (PK, UK, FK) Table Level Database Level Method SQL e.g. ALTER TABLE <> ADD SUPPLEMENTAL LOG DATA … GoldenGate e.g. ADD TRANDATA Cost of Omission Changes may fail

11 © 2012 – Pythian Supplemental Logging Source Tgt create table repuser2.tbl4 (id number, fname varchar2(100), lname varchar2(100), issued date); :20:57 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: DDL operation included [INCLUDE ALL OBJNAME REPUSER2.*], optype [CREATE], objtype [TABLE], objowner [REPUSER2], objname [TBL4] :20:57 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Writing DDL operation to extract trail file :21:03 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL4], operation [ALTER TABLE "REPUSER2"."TBL4" ADD SUPPLEMENTAL LOG GROUP "GGT_61642" ("ID","FNAME","LNAME","ISSUED") ALWAYS /* GOLDENGATE_DDL_REPLICATION */ (size 141)] :21:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL4], operation [ ALTER TABLE "REPUSER2"."TBL4" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */ (size 103)] :21:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully deleted TRAN DATA for [CREATE] DDL operation, table [REPUSER2.TBL4], operation [ ALTER TABLE "REPUSER2"."TBL4" DROP SUPPLEMENTAL LOG GROUP "GGT_61642" /* GOLDENGATE_DDL_REPLICATION */ (size 103)]. select * from dba_log_groups where table_name='TBL4'; OWNER LOG_GROUP_NAME TABLE_NAME LOG_GROUP_TYPE ALWAYS GENERATED REPUSER2 GGS_61642 TBL4 USER LOG GROUP ALWAYS USER NAME Drop SL for all named columns

12 © 2012 – Pythian Supplemental Logging Src Target :21:05 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL found, operation [create table repuser2.tbl4 (id number, fname varchar2(100), lname varchar2(100), issued date) (size 95)] :21:05 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL is of mapped scope, after mapping new operation [ create table REPUSER2.TBL4 (id number, fname varchar2(100), lname varchar2(100), issued date) (size 95)] :21:05 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Setting current schema for DDL operation to [SYS] :21:05 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Executing DDL operation :21:06 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL operation successful :21:06 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Restoring current schema for DDL operation to [ggsdb]. desc repuser2.tbl4 NameNull?Type IDNUMBER FNAMEVARCHAR2(100) LNAMEVARCHAR2(100) ISSUEDDATE No SL In Target TBL4 in Target

13 © 2012 – Pythian Supplemental Logging Source Tgt alter table repuser2.tbl4 add primary key(id); :51:07 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: DDL found, operation [ alter table repuser2.tbl4 add primary key(id) (size 47)], start SCN [ ], commit SCN [ ] instance [orcl1123 (1)], DDL seqno [1008], marker seqno [1008] :51:07 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL4], operation [ ALTER TABLE "REPUSER2"."TBL4" ADD SUPPLEMENTAL LOG GROUP "GGT_61642" ("ID") ALWAYS /* GOLDENGATE_DDL_REPLICATION */ (size 116)] :51:07 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully deleted TRAN DATA for [ALTER] DDL operation, table [REPUSER2.TBL4], operation [ ALTER TABLE "REPUSER2"."TBL4" DROP SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */ (size 104)] :51:07 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL4], operation [ ALTER TABLE "REPUSER2"."TBL4" ADD SUPPLEMENTAL LOG GROUP "GGS_61642" ("ID") ALWAYS /* GOLDENGATE_DDL_REPLICATION */ (size 116)] :51:07 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully deleted TRAN DATA for [ALTER] DDL operation, table [REPUSER2.TBL4], operation [ ALTER TABLE "REPUSER2"."TBL4" DROP SUPPLEMENTAL LOG GROUP "GGT_61642" /* GOLDENGATE_DDL_REPLICATION */ (size 103)]. select * from dba_log_group_columns where table_name='TBL4'; OWNER LOG_GROUP_NAME TABLE_NAME COLUMN_NAME POSITION LOGGING_PROPERTY REPUSER2GGS_61642 TBL4 ID 1 LOG SL for all columns is dropped SL for ID is added (PK)

14 © 2012 – Pythian Supplemental Logging Source Target :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL found, operation [ alter table repuser2.tbl4 add primary key(id) (size 47)] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL is of mapped scope, after mapping new operation [ alter table REPUSER2.TBL4 add primary key(id) (size 47)] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Setting current schema for DDL operation to [SYS] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Executing DDL operation :51:14 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL operation successful :51:14 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Restoring current schema for DDL operation to [ggsdb]. select * from dba_log_groups where table_name='TBL4'; no rows NO SL In Target YET !!

15 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestL3 14/11/12 t2 What if we keep running replication this way

16 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestL3 14/11/12 ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestL3 14/11/12 t2 What if we keep running replication this way

17 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestL3 14/11/12 ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestL3 14/11/12 t2 update repuser2.tbl4 set lname='TestL4' where fname='Test' and rowid='AAAar/AAEAAAE5HAAC‘; ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestL4 14/11/12 What if we keep running replication this way

18 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestL3 14/11/12 ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestL3 14/11/12 t2 UPDATE "REPUSER2"."TBL4" SET "LNAME"=:a1 WHERE "ID"=:b0 OCI Error ORA-01403: no data found, SQL Operation failed at seqno 5 rba 4598 Discarding record on action DISCARD on error 1403 Problem replicating REPUSER2.TBL4 to REPUSER2.TBL4 Record not found Mapping problem with compressed update record (target format)... * ID = LNAME = TestL4 update repuser2.tbl4 set lname='TestL4' where fname='Test' and rowid='AAAar/AAEAAAE5HAAC‘; ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestL4 14/11/12 What if we keep running replication this way Missing Value!

19 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestL3 14/11/12 t2 What if supplemental logging is enabled on target

20 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestL3 14/11/12 add trandata repuser2.tbl4 ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestL3 14/11/12 t2 What if supplemental logging is enabled on target

21 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestL3 14/11/12 add trandata repuser2.tbl4 ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestL3 14/11/12 t2 update repuser2.tbl4 set lname='TestLB' where fname='Test' and rowid='AAAar/AAEAAAE5HAAC‘; ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestLB 14/11/12 What if supplemental logging is enabled on target

22 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestL3 14/11/12 add trandata repuser2.tbl4 ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestL3 14/11/12 t2 UPDATE "REPUSER2"."TBL4" SET "LNAME"=:a1 WHERE "ID"=:b0 a1 : TestLB b0 : 3 ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC3 Test TestLB 14/11/12 update repuser2.tbl4 set lname='TestLB' where fname='Test' and rowid='AAAar/AAEAAAE5HAAC‘; ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC3 Test TestLB 14/11/12 What if supplemental logging is enabled on target

23 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA 1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB 2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC 3 Test TestL3 14/11/12 t2 What if supplemental logging is enabled on DB level

24 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA 1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB 2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC 3 Test TestL3 14/11/12 delete trandata repuser2.tbl4 alter database add supplemental log data (primary key) columns; alter system switch logfile; ROWID IDFNAME LNAME ISSUED AAAar/AAEAAAE5HAAA 1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB 2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC 3 Test TestL3 14/11/12 t2 What if supplemental logging is enabled on DB level

25 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA 1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB 2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC 3 Test TestL3 14/11/12 delete trandata repuser2.tbl4 alter database add supplemental log data (primary key) columns; alter system switch logfile; ROWID IDFNAME LNAME ISSUED AAAar/AAEAAAE5HAAA 1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB 2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC 3 Test TestL3 14/11/12 t2 update repuser2.tbl4 set lname='TestLC’ where fname='Test' and rowid=‘AAAar/AAEAAAE5HAAC’; ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA 1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB 2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC 3 Test TestLC 14/11/12 What if supplemental logging is enabled on DB level

26 © 2012 – Pythian Supplemental Logging TSourceTarget t1 insert into repuser2.tbl4 values (1,'Test','TestL',sysdate); insert into repuser2.tbl4 values (2,'Test','TestL2',sysdate); insert into repuser2.tbl4 values (3,'Test','TestL3',sysdate); ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA 1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB 2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC 3 Test TestL3 14/11/12 delete trandata repuser2.tbl4 alter database add supplemental log data (primary key) columns; alter system switch logfile; ROWID IDFNAME LNAME ISSUED AAAar/AAEAAAE5HAAA 1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB 2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC 3 Test TestL3 14/11/12 t2 UPDATE "REPUSER2"."TBL4" SET "LNAME"=:a1 WHERE "ID"=:b0 a1 : TestLC b0 : 3 ROWID ID FNAME LNAME ISSUED AAAPDKAAEAAAAIOAAA 1 Test TestL 14/11/12 AAAPDKAAEAAAAIOAAB 2 Test TestL2 14/11/12 AAAPDKAAEAAAAIOAAC 3 Test TestLC 14/11/12 update repuser2.tbl4 set lname='TestLC’ where fname='Test' and rowid=‘AAAar/AAEAAAE5HAAC’; ROWID ID FNAME LNAME ISSUED AAAar/AAEAAAE5HAAA 1 Test TestL 14/11/12 AAAar/AAEAAAE5HAAB 2 Test TestL2 14/11/12 AAAar/AAEAAAE5HAAC 3 Test TestLC 14/11/12 What if supplemental logging is enabled on DB level

27 © 2012 – Pythian Supplemental Logging Supplemental logging New object Existing object Supplemental logging is critical to healthy replication specially for tables with update/delete changes PK UK KEYCOLs ALL

28 © 2012 – Pythian Supplemental Logging Supplemental logging New object Existing object PK UK KEYCOLs DDLOPTIONS & ADDTRANDATA & GETREPLICATES & REPORT To add SL to source DB To replicat add SL to target ALL

29 © 2012 – Pythian Supplemental Logging TimeSource t1 create table repuser2.tbl11 (id number, name varchar2(10)); :58:58 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: DDL found, operation [ create table repuser2.tbl11 (id number, name varchar2(10)) :58:59 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */ (size 104)]. t2

30 © 2012 – Pythian Supplemental Logging TimeSource t1 create table repuser2.tbl11 (id number, name varchar2(10)); :58:58 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: DDL found, operation [ create table repuser2.tbl11 (id number, name varchar2(10)) :58:59 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */ (size 104)]. t2 alter table repuser2.tbl11 add primary key (id); :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: DDL found, operation [ alter table repuser2.tbl11 add primary key (id) ( :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG GROUP "GGT_61549" ("ID") ALWAYS /* GOLDENGATE_DDL_REPLICATION */ (size 117)] :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully deleted TRAN DATA for [ALTER] DDL operation, table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" DROP SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */ (size 105)] :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG GROUP "GGS_61549" ("ID") ALWAYS /* GOLDENGATE_DDL_REPLICATION */ (size 117)] :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully deleted TRAN DATA for [ALTER] DDL operation, table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" DROP SUPPLEMENTAL LOG GROUP "GGT_61549" /* GOLDENGATE_DDL_REPLICATION */ (size 104)].

31 © 2012 – Pythian Supplemental Logging Source Target :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL found, operation [ alter table repuser2.tbl11 add primary key(id) (size 47)] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL is of mapped scope, after mapping new operation [ alter table REPUSER2.TBL11 add primary key(id) (size 47)] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Setting current schema for DDL operation to [SYS] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Executing DDL operation :51:14 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL operation successful :51:14 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Restoring current schema for DDL operation to [ggadmin]. No SL operations

32 © 2012 – Pythian Supplemental Logging Source Target :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL found, operation [ alter table repuser2.tbl11 add primary key(id) (size 47)] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL is of mapped scope, after mapping new operation [ alter table REPUSER2.TBL11 add primary key(id) (size 47)] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Setting current schema for DDL operation to [SYS] :51:11 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Executing DDL operation :51:14 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL operation successful :51:14 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Restoring current schema for DDL operation to [ggadmin]. select * from dba_log_groups where table_name='TBL11'; no rows No SL operations

33 © 2012 – Pythian Supplemental Logging Extract USER ID and Replicat USER ID should be different Problem documented in MOS “ If your TRANSLOGOPTIONS EXCLUDEUSER specified in the Extract is the same as the EXTRACT USERID, the DDL to add supplemental logging is not captured and sent to the target. ” Our extract settings were USERID ggadmin TRANLOGOPTIONS EXCLUDEUSER ggadmin

34 © 2012 – Pythian Supplemental Logging TimeSource t1 create table repuser2.tbl11 (id number, name varchar2(10)); :58:58 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: DDL found, operation [ create table repuser2.tbl11 (id number, name varchar2(10)) :58:59 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */ (size 104)]. t2 alter table repuser2.tbl11 add primary key (id); :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: DDL found, operation [ alter table repuser2.tbl11 add primary key (id) ( :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG GROUP "GGT_61549" ("ID") ALWAYS /* GOLDENGATE_DDL_REPLICATION */ (size 117)] :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully deleted TRAN DATA for [ALTER] DDL operation, table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" DROP SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */ (size 105)] :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully added TRAN DATA for table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG GROUP "GGS_61549" ("ID") ALWAYS /* GOLDENGATE_DDL_REPLICATION */ (size 117)] :00:04 INFO OGG Oracle GoldenGate Capture for Oracle, ext_nb.prm: Successfully deleted TRAN DATA for [ALTER] DDL operation, table [REPUSER2.TBL11], operation [ ALTER TABLE "REPUSER2"."TBL11" DROP SUPPLEMENTAL LOG GROUP "GGT_61549" /* GOLDENGATE_DDL_REPLICATION */ (size 104)].

35 © 2012 – Pythian Supplemental Logging TimeTarget t1,t :59:01 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL is of mapped scope, after mapping new operation [ create table REPUSER2."TBL11" (id number, name varchar2(10)) (size 62)] :00:06 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL found, operation [ alter table repuser2.tbl11 add primary key (id) (size 49)] :02:53 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL found, operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS (size 72)] :02:53 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL operation successful :03:27 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL found, operation [ ALTER TABLE "REPUSER2"."TBL11" ADD SUPPLEMENTAL LOG GROUP "GGT_61549" ("ID") ALWAYS (size 85)] :03:27 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL operation successful :04:59 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL found, operation [ ALTER TABLE "REPUSER2"."TBL11" DROP SUPPLEMENTAL LOG GROUP "GGT_61549" (size 72)] :04:59 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: DDL operation successful :04:59 INFO OGG Oracle GoldenGate Delivery for Oracle, rena_nb.prm: Restoring current schema for DDL operation to [ggsdb]. GETREPLICATES does not work as it is expected

36 © 2012 – Pythian Supplemental Logging Tim e Source t1Create table t2ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS t3Create PK index t4add supplemental log data (id) (temp) t5drop SUPPLEMENTAL LOG DATA (ALL) T6add supplemental log data (id) T7drop supplemental log data (id) (temp) Tim e Target t1Create table t2Create PK index t3ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS t4add supplemental log data (id) (temp) t5drop supplemental log data (id) (temp) 1.ADDTRANDATA on source for new object. 2.Monitor replicated object on target and add SL manually before any DML change

37 © 2012 – Pythian Supplemental Logging SCHEMATRANDATA In GoldenGate 11.1 OGG Cannot verify existence of table function that is required to enable schema level supplemental logging, failed to find function DB Patches needed to support SCHEMATRANDATA in OGG (Oracle GoldenGate), OGG Cannot verify existence of table function that is required to enable schema [MOS ] To use SCHEMATRANDATA, please apply the fix in bug Only on some platforms

38 © 2012 – Pythian Supplemental Logging Supplemental logging is critical for proper function Different users needed for extract and replicat Add trandata manually for replicated nodes Need to monitor schema for tables without trandata Use SCHEMATRANDATA if you can Lessons Learned

39 © 2012 – Pythian Topics Active/Active considerations Supplemental Logging DDL Replication Conflict Avoidance Conflict Detection Release Management Data comparison General considerations Trail file deletion Archive log deletion

40 © 2012 – Pythian DDL Replication TimeSourceTarget T1 create table luke ( a number,b date,c varchar2(30) ); alter table luke add primary key ( a ); T2

41 © 2012 – Pythian DDL Replication TimeSourceTarget T1 create table luke ( a number,b date,c varchar2(30) ); alter table luke add primary key ( a ); desc luke Name Null? Type A NUMBER B DATE C VARCHAR2(30) add trandata luke T2

42 © 2012 – Pythian DDL Replication TimeSourceTarget T1 create table luke ( a number,b date,c varchar2(30) ); alter table luke add primary key ( a ); desc luke Name Null? Type A NUMBER B DATE C VARCHAR2(30) add trandata luke T2 insert into luke values ( 1, sysdate, 'Luke Test 1' );

43 © 2012 – Pythian DDL Replication TimeSourceTarget T1 create table luke ( a number,b date,c varchar2(30) ); alter table luke add primary key ( a ); desc luke Name Null? Type A NUMBER B DATE C VARCHAR2(30) add trandata luke T2 insert into luke values ( 1, sysdate, 'Luke Test 1' ); select * from luke; A B C NOV-12 Luke Test 1 insert into luke values ( 2, sysdate, 'Luke Test 2' );

44 © 2012 – Pythian DDL Replication TimeSourceTarget T3 select * from luke; A B C NOV-12 Luke Test NOV-12 Luke Test 1 update luke set c = 'Luke Test 1 updated' where a = 1; T4

45 © 2012 – Pythian DDL Replication TimeSourceTarget T3 select * from luke; A B C NOV-12 Luke Test NOV-12 Luke Test 1 update luke set c = 'Luke Test 1 updated' where a = 1; select * from luke; A B C NOV-12 Luke Test NOV-12 Luke Test 1 updated update luke set c = 'Luke Test 2 updated' where a = 2; T4

46 © 2012 – Pythian DDL Replication TimeSourceTarget T3 select * from luke; A B C NOV-12 Luke Test NOV-12 Luke Test 1 update luke set c = 'Luke Test 1 updated' where a = 1; select * from luke; A B C NOV-12 Luke Test NOV-12 Luke Test 1 updated update luke set c = 'Luke Test 2 updated' where a = 2; T4 select * from luke; A B C NOV-12 Luke Test 2 updated 1 19-NOV-12 Luke Test 1 updated alter table luke add ( d timestamp );

47 © 2012 – Pythian DDL Replication TimeSourceTarget T3 select * from luke; A B C NOV-12 Luke Test NOV-12 Luke Test 1 update luke set c = 'Luke Test 1 updated' where a = 1; select * from luke; A B C NOV-12 Luke Test NOV-12 Luke Test 1 updated update luke set c = 'Luke Test 2 updated' where a = 2; T4 select * from luke; A B C NOV-12 Luke Test 2 updated 1 19-NOV-12 Luke Test 1 updated alter table luke add ( d timestamp ); desc luke Name Null? Type A NUMBER B DATE C VARCHAR2(30) D TIMESTAMP(6)

48 © 2012 – Pythian DDL Replication TimeSourceTarget T5 insert into luke values ( 3, sysdate, 'Luke Test 3', systimestamp ); T6

49 © 2012 – Pythian DDL Replication TimeSourceTarget T5 insert into luke values ( 3, sysdate, 'Luke Test 3', systimestamp ); select a,d from luke; A D NOV AM 1 insert into luke values ( 4, sysdate, 'Luke Test 4', systimestamp ); T6

50 © 2012 – Pythian DDL Replication TimeSourceTarget T5 insert into luke values ( 3, sysdate, 'Luke Test 3', systimestamp ); select a,d from luke; A D NOV AM 1 insert into luke values ( 4, sysdate, 'Luke Test 4', systimestamp ); T6 select a,d from luke; A D NOV AM Missing Value!

51 © 2012 – Pythian DDL Replication TimeSourceTarget T5 insert into luke values ( 3, sysdate, 'Luke Test 3', systimestamp ); select a,d from luke; A D NOV AM 1 insert into luke values ( 4, sysdate, 'Luke Test 4', systimestamp ); T6 select a,d from luke; A D NOV AM 2 4 >> 1 Stop extract Start extract insert into luke values ( 5, sysdate, 'Luke Test 5', systimestamp );

52 © 2012 – Pythian Supplemental Logging Source Discard -> Process Abending : :53:07 Source Context : SourceModule : [ggstd.conv.endian] SourceID : [/scratch/pradshar/view_storage/pradshar_bugdbrh40_ /oggcore/OpenSys/src/gglib/ggstd/lecnv.c] SourceFunction : [convCompSQL] SourceLine : [530] ThreadBacktrace : [9] elements : [/ggs/replicat(CMessageContext::AddThreadContext()+0x26) [0x5f1e56]] : [/ggs/replicat(CMessageFactory::CreateMessage(CSourceContext*, unsigned int,...)+0x7b2) [0x5e88f2]] : [/ggs/replicat(_MSG_ERR_MAP_COL_INDEX_INVALID(CSourceContext*, DBString const&, int, int, CMessageFactory::MessageDisposition)+0xa6) [0x5bee16]] : [/ggs/replicat [0x900e6c]] : [/ggs/replicat(ggConvRecLE(char*, file_def*, int, char, char)+0x6c) [0x900fac]] : [/ggs/replicat [0x8f4d6e]] : [/ggs/replicat(main+0x84b) [0x507a0b]] : [/lib64/libc.so.6(__libc_start_main+0xf4) [0x34cd81d994]] : [/ggs/replicat(__gxx_personality_v0+0x1e2) [0x4e3ffa]] :53:07 ERROR OGG Bad column index (3) specified for table FEXLINK.LUKE, max columns = 3.

53 © 2012 – Pythian DDL Replication TimeSourceTarget T7 Restart replicat select a,d from luke; A D NOV AM NOV AM 1 GoldenGate parameters ( Replicat only ) DDLOPTIONS UPDATEMETADATA Automatically updates GoldenGate metadata cache

54 © 2012 – Pythian DDL Replication UPDATEMETADATA doesn’t work both ways 1.After DDL ALTER must bounce REPLICAT on the local node and PRIMARY EXTRACT on other nodes

55 © 2012 – Pythian Topics Active/Active considerations Supplemental Logging DDL Replication Conflict Avoidance Conflict Detection Release Management Data comparison General considerations Trail file deletion Archive log deletion

56 © 2012 – Pythian Conflict Avoidance 2 Columns LAST_UPDATED_AT (DATE) LAST_UPDATING_BY (VARCHAR2(30)) Trigger CREATE OR REPLACE TRIGGER. _BIU BEFORE INSERT OR UPDATE ON. FOR EACH ROW WHEN ( user != 'GGADMIN' ) DECLARE l_username VARCHAR2(50); BEGIN SELECT NVL(SYS_CONTEXT('USERENV','CLIENT_IDENTIFIER'),USER) INTO l_username FROM DUAL; :NEW.last_updated_at := SYSDATE; :NEW.last_updating_user := l_username; END; /

57 © 2012 – Pythian Conflict Avoidance Sequences 16 digit sequence number Each silo has a unique 2 digit starting number e.g. 21, 31 etc Ability to find originating silo for management reports Guarantee uniqueness Extra maintenance for new sequences Need GG parameter DDL EXCLUDE OBJTYPE SEQUENCE

58 © 2012 – Pythian Topics Active/Active considerations Supplemental Logging DDL Replication Conflict Avoidance Conflict Detection Release Management Data comparison General considerations Trail file deletion Archive log deletion

59 © 2012 – Pythian Conflict Detection Discards Check discard files Use a cron script or other scheduler for every 5 mins Discard reader built in PL/SQL PIPELINE function Parses the discard file for common errors Condenses the output to one line with the main error information Check blog for source code

60 © 2012 – Pythian Conflict Detection Discards Usage of READ_DISCARD The discard had 567 lines READ_DISCARD reduced output to 6 lines select LINE_NUMBER, ORACLE_ERROR, SOURCE_OBJECT_NAME, ERROR_OPERATION, ERROR_COLUMN, ERROR_VALUE, PK_TABLE_NAME from table(read_discard(‘repname’)); LINE_NUMBER ORA_ERROR SOURCE_OBJECT_NAME ERROR_OPERATION ERROR_COLUMN ERROR_VALUE PK_TABLE_NAME ORA CHILD_TABLE1 INSERT PARENT_ID PARENT 44 ORA CHILD_TABLE2 INSERT CHILD1_ID CHILD_TABLE1 63 ORA CHILD_TABLE3 INSERT PARENT_ID PARENT 263 ORA TABLE1 UPDATE TABLE1_ID ORA PARENT UPDATE PARENT_ID ORA CHILD_TABLE3 UPDATE CHILD3_ID rows selected.

61 © 2012 – Pythian Topics Active/Active considerations Supplemental Logging DDL Replication Conflict Avoidance Conflict Detection Release Management Data comparison General considerations Trail file deletion Archive log deletion

62 © 2012 – Pythian Release Management Major Release script App code DB change Pre- DDL DDL DML Post- DDL DDL Post- DDL Pre- DDL Statements which can not be replicated OR We do not want to be replicated Run these statements outside replication cycle CREATE SEQUENCE CREATE/ALTER MATERIALIZED VIEW CREATE SYNONYM on other user Due to GG limitations DML Statements which are replicated via GoldenGate

63 © 2012 – Pythian Release Management ERROR OGG Oracle GoldenGate Delivery for Oracle, resb01sa.prm: Bad column index (nn) specified for table mytab, max columns = 59. ERROR OGG Oracle GoldenGate Delivery for Oracle, resb01sa.prm: PROCESS ABENDING. Challenge – Replication from superset structure to minor set Version N Version N+1

64 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 t3 t4 Drop Column

65 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab drop column name; t3 t4 Drop Column

66 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab drop column name; Generate defgen and copy to source./defgen paramfile./dirprm/defgen.prm insert into mytab values(1,’Test01’); t3 t4 Drop Column

67 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab drop column name; Generate defgen and copy to source./defgen paramfile./dirprm/defgen.prm insert into mytab values(1,’Test01’); t3 -- ASSUMETARGETDEFS SOURCEDEFS./dirsql/targetdefgen.sql MAP mytab, TARGET mytab, COLMAP ( ID=ID ); start replicat t4 Drop Column

68 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab drop column name; Generate defgen and copy to source./defgen paramfile./dirprm/defgen.prm insert into mytab values(1,’Test01’); t3 -- ASSUMETARGETDEFS SOURCEDEFS./dirsql/targetdefgen.sql MAP mytab, TARGET mytab, COLMAP ( ID=ID ); start replicat start pump extract t4 Drop Column

69 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab drop column name; Generate defgen and copy to source./defgen paramfile./dirprm/defgen.prm insert into mytab values(1,’Test01’); t3 -- ASSUMETARGETDEFS SOURCEDEFS./dirsql/targetdefgen.sql MAP mytab, TARGET mytab, COLMAP ( ID=ID ); start replicat start pump extract t4 select * from mytab ID Select * from mytab ID NAME Test01 Drop Column

70 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 t3 t4 Modify Column

71 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab modify column name (varchar2(6)); t3 t4 Modify Column

72 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab modify column name (varchar2(6)); Generate defgen and copy to source./defgen paramfile./dirprm/defgen.prm insert into mytab values(1,’Test011’); t3 t4 Modify Column

73 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab modify column name (varchar2(6)); Generate defgen and copy to source./defgen paramfile./dirprm/defgen.prm insert into mytab values(1,’Test011’); t3 -- ASSUMETARGETDEFS SOURCEDEFS./dirsql/targetdefgen.sql MAP mytab, TARGET mytab, COLMAP ( USEDEFAULTS, ); start replicat t4 Modify Column

74 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab modify column name (varchar2(6)); Generate defgen and copy to source./defgen paramfile./dirprm/defgen.prm insert into mytab values(1,’Test011’); t3 -- ASSUMETARGETDEFS SOURCEDEFS./dirsql/targetdefgen.sql MAP mytab, TARGET mytab, COLMAP ( USEDEFAULTS, ); start replicat start pump extract t4 Modify Column

75 © 2012 – Pythian Release Management TSourceTarget t1 desc mytab ID not null number Name varchar2(10) desc mytab ID not null number Name varchar2(10) t2 alter table mytab modify column name (varchar2(6)); Generate defgen and copy to source./defgen paramfile./dirprm/defgen.prm insert into mytab values(1,’Test011’); t3 -- ASSUMETARGETDEFS SOURCEDEFS./dirsql/targetdefgen.sql MAP mytab, TARGET mytab, COLMAP ( USEDEFAULTS, ); start replicat start pump extract t4 Select * from mytab ID NAME Test01 Select * from mytab ID NAME Test011 Modify Column

76 © 2012 – Pythian Release Management ASSUMETARGETDEFS Old Version: Create metadata for New Version DB ( defgen ) New Version: Use SOURCEDEFS & MAP for pulling data from superset structure SOURCEDEFS & MAP

77 © 2012 – Pythian Topics Active/Active considerations Supplemental Logging DDL Replication Conflict Avoidance Conflict Detection Release Management Data comparison General considerations Trail file deletion Archive log deletion

78 © 2012 – Pythian Data Comparison User developed scripts Master shell scripts calls PL/SQL package Compares VARCHAR2, NUMBER, DATE and TIMESTAMP Large VARCHAR2, BLOB, CLOB fields are hashed for comparison Requires a database link Uses LAST_UPDATED_AT timestamps to compare a subset of each table e.g. SYSDATE – 7 Saves the ID of the offending row in a custom table Inconsistencies are handled manually Can be time consuming

79 © 2012 – Pythian Data Comparison Veridata Need to set up a server with a database component Each database in the replication cluster needs an agent There can be significant initial configuration for tables to excluded columns, if necessary. Hashes the entire row for less network traffic All comparison is done on the veridata server Reports are good and clear Need to write an XML parser to create the insert / update / delete statements May need some clean up operations for report files on the server

80 © 2012 – Pythian Topics Active/Active considerations Supplemental Logging DDL Replication Conflict Avoidance Conflict Detection Release Management Data comparison General considerations Trail file deletion Archive log deletion

81 © 2012 – Pythian Trail file deletion PURGEOLDEXTRACTS in mgr.prm PURGEOLDEXTRACTS./dirdat/*, USECHECKPOINTS, MINKEEPDAYS 6 Problems can occur if trail files have the same name ( MOS ) Best practice use unique trail file names ( MOS ) Use a script to check primary extracts, datapumps and replicats Script links Primary Extract -> DataPump(s) -> Replicat Only delete once have been used by the next level Used by Replicat if you want to be really safe Parsing output from -> info, showch Use unique trail file names

82 © 2012 – Pythian Trail file deletion Info extract, showch output Read Checkpoint #1 GGS Log Trail Startup Checkpoint (starting position in the data source): Sequence #: 8 RBA: 1139 Timestamp: :57: Extract Trail:./dirdat/wb Current Checkpoint (position of last record read in the data source): Sequence #: 11 RBA: 1139 Timestamp: :51: Extract Trail:./dirdat/wb Write Checkpoint #1 GGS Log Trail Current Checkpoint (current write position): Sequence #: 9 RBA: 5099 Timestamp: :17: Extract Trail:./dirdat/wb

83 © 2012 – Pythian Topics Active/Active considerations Supplemental Logging DDL Replication Conflict Avoidance Conflict Detection Release Management Data comparison General considerations Trail file deletion Archive log deletion

84 © 2012 – Pythian Archive Log Deletion GoldenGate only sends transaction on commit Need to keep archive logs until transaction completes Either user a script for archive log deletion Or since can register the extract ( EE only ) REGISTER EXTRACT LOGRETENTION DBA_CAPTURE -> OGG2$_EXT01UPL88C29FC8 Get RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process Beware of bugs! ( MOS )

85 © 2012 – Pythian Lessons Learned Supplemental Logging is critical - get it right! Structural changes need to be managed carefully Parts of the database structure needs special attention Sequences, Materialized Views, Extra columns Need to set up monitoring Discards Row comparison GG processes and function Trail files need to be cleaned up Archive log cleanup must be integrated with GG

86 © 2012 – Pythian Thank you and Q&A PYTHIAN To contact us… To follow


Download ppt "Experiences and Lessons Learned 6-Node Active-Active Oracle GoldenGate Luke Davies."

Similar presentations


Ads by Google