Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Replacing Oracle CDC with Oracle GoldenGate

Replacing Oracle CDC with Oracle GoldenGate

Herunterladen, um offline zu lesen

The Oracle documentation states that Oracle Change Data Capture (CDC) will be de-supported in the future and replaced with Oracle GoldenGate (OGG). So are we justified in assuming that OGG provides all the necessary features to actually replace CDC?
In this presentation, we will examine CDC and it's application in real-time BI solutions and data warehouses. We will also have a look at the feature set of OGG and decide whether it is a suitable replacement for CDC for all of these applications. When gaps in the product are identified -- such as lack of support for subscription groups -- we will see techniques that can be used to bridge those gaps without sacrificing the performance and scalability of OGG.

The Oracle documentation states that Oracle Change Data Capture (CDC) will be de-supported in the future and replaced with Oracle GoldenGate (OGG). So are we justified in assuming that OGG provides all the necessary features to actually replace CDC?
In this presentation, we will examine CDC and it's application in real-time BI solutions and data warehouses. We will also have a look at the feature set of OGG and decide whether it is a suitable replacement for CDC for all of these applications. When gaps in the product are identified -- such as lack of support for subscription groups -- we will see techniques that can be used to bridge those gaps without sacrificing the performance and scalability of OGG.

Weitere Verwandte Inhalte

Ähnliche Bücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

Alle anzeigen

Ähnliche Hörbücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

Alle anzeigen

Replacing Oracle CDC with Oracle GoldenGate

  1. 1. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Is Oracle GoldenGate a Replacement for Oracle Change Data Capture? 1 Stewart Bryson medium.com/@stewartbryson @stewartbryson linkedin.com/in/stewartbryson
  2. 2. © 2014 RED PILL Analytics Who is Red Pill Analytics?
  3. 3. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Red Pill Analytics: Leadership 3 Stewart Bryson Oracle ACE Director Previously From: Rittman Mead Informix Software Data Warehousing & Business Intelligence since 1996 Kevin McGinley Oracle ACE Director Previously From: Accenture BI Consulting Group Data Warehousing & Business Intelligence since 1997
  4. 4. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics About Red Pill Analytics Other Services • Expert Retainer • Support • Training 4 • DevOps for BI and DI • Hosted or On- premise • Used in Capacity Analytics Capacity Analytics • Development-as-a- service • Agile methodology • Faster/cheaper than traditional consulting • Subscription billing
  5. 5. © 2014 RED PILL Analytics “Change” Has Different Meanings
  6. 6. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics ODI Journalization Framework A B Oracle GoldenGate (Traditionally) A B Oracle CDC (Deprecated) A B
  7. 7. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics A B ODI Journalization Framework A B
  8. 8. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics A B ODI Journalization Framework A B
  9. 9. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC (Deprecated) A B A
  10. 10. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics A ODI Journalization Framework A B
  11. 11. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Is the A-Team Right About This? 13
  12. 12. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics
  13. 13. © 2014 RED PILL Analytics Online Retailing Example
  14. 14. © 2014 RED PILL Analytics Publishing
  15. 15. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC: Publish and Subscribe 17 EDW R Sandbox Partner Feed
  16. 16. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC: Publishing 18 -- prepare source table alter table sugarcrm.accounts ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS; BEGIN DBMS_CAPTURE_ADM.PREPARE_TABLE_INSTANTIATION(TABLE_NAME => 'sugarcrm.accounts'); END; / -- create change set BEGIN DBMS_CDC_PUBLISH.CREATE_CHANGE_SET ( change_set_name => 'CRM_ACCOUNTS', description => 'Change set for the CRM Accounts Data', change_source_name => 'HOTLOG_SOURCE', stop_on_ddl => 'y', begin_date => sysdate ); END;
  17. 17. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC: Publishing 19 -- prepare source table alter table sugarcrm.accounts ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS; BEGIN DBMS_CAPTURE_ADM.PREPARE_TABLE_INSTANTIATION(TABLE_NAME => 'sugarcrm.accounts'); END; / -- create change set BEGIN DBMS_CDC_PUBLISH.CREATE_CHANGE_SET ( change_set_name => 'CRM_ACCOUNTS', description => 'Change set for the CRM Accounts Data', change_source_name => 'HOTLOG_SOURCE', stop_on_ddl => 'y', begin_date => sysdate ); END; -- create change table BEGIN DBMS_CDC_PUBLISH.CREATE_CHANGE_TABLE ( owner => 'cdcpub', change_table_name => 'accounts_ct', change_set_name => 'CRM_ACCOUNTS', source_schema => 'SUGARCRM', source_table => 'ACCOUNTS', column_type_list => 'ID CHAR(36), NAME VARCHAR2(150), DATE_ENTERED DATE,DATE_MODIFIED DATE, ACCOUNT_TYPE VARCHAR2(50), INDUSTRY VARCHAR2(50), PARENT_ID CHAR(36), ANNUAL_REVENUE VARCHAR2(100), BILLING_ADDRESS_STREET VARCHAR2(150), BILLING_ADDRESS_CITY VARCHAR2(100), BILLING_ADDRESS_STATE VARCHAR2(100), BILLING_ADDRESS_POSTALCODE VARCHAR2(20), OWNERSHIP VARCHAR2(100), BILLING_ADDRESS_COUNTRY VARCHAR2(255), RATING VARCHAR2(100), WEBSITE VARCHAR2(255),TICKER_SYMBOL VARCHAR2(10), SIC_CODE VARCHAR2(10), CAMPAIGN_ID CHAR(36)', capture_values => 'new', rs_id => 'y', row_id => 'n', user_id => 'n', timestamp => 'n', object_id => 'n', source_colmap => 'n', target_colmap => 'y', options_string => 'TABLESPACE UTILS'); END;
  18. 18. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics -- create change table BEGIN DBMS_CDC_PUBLISH.CREATE_CHANGE_TABLE ( owner => 'cdcpub', change_table_name => 'accounts_ct', change_set_name => 'CRM_ACCOUNTS', source_schema => 'SUGARCRM', source_table => 'ACCOUNTS', column_type_list => 'ID CHAR(36), NAME VARCHAR2(150), DATE_ENTERED DATE,DATE_MODIFIED DATE, ACCOUNT_TYPE VARCHAR2(50), INDUSTRY VARCHAR2(50), PARENT_ID CHAR(36), ANNUAL_REVENUE VARCHAR2(100), BILLING_ADDRESS_STREET VARCHAR2(150), BILLING_ADDRESS_CITY VARCHAR2(100), BILLING_ADDRESS_STATE VARCHAR2(100), BILLING_ADDRESS_POSTALCODE VARCHAR2(20), OWNERSHIP VARCHAR2(100), BILLING_ADDRESS_COUNTRY VARCHAR2(255), RATING VARCHAR2(100), WEBSITE VARCHAR2(255),TICKER_SYMBOL VARCHAR2(10), SIC_CODE VARCHAR2(10), CAMPAIGN_ID CHAR(36)', capture_values => 'new', rs_id => 'y', row_id => 'n', user_id => 'n', timestamp => 'n', object_id => 'n', source_colmap => 'n', target_colmap => 'y', options_string => 'TABLESPACE UTILS'); END; Oracle CDC: Publishing 20 -- prepare source table alter table sugarcrm.accounts ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS; BEGIN DBMS_CAPTURE_ADM.PREPARE_TABLE_INSTANTIATION(TABLE_NAME => 'sugarcrm.accounts'); END; / -- create change set BEGIN DBMS_CDC_PUBLISH.CREATE_CHANGE_SET ( change_set_name => 'CRM_ACCOUNTS', description => 'Change set for the CRM Accounts Data', change_source_name => 'HOTLOG_SOURCE', stop_on_ddl => 'y', begin_date => sysdate ); END; -- enable change set BEGIN DBMS_CDC_PUBLISH.ALTER_CHANGE_SET( change_set_name => 'CRM_ACCOUNTS', enable_capture => 'y'); END;
  19. 19. Oracle CDC Subscription Views
  20. 20. www.redpillanalytics.com info@redpillanalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC Subscription View 22 NAME TICKER_SYMBOL OWNERSHIP CSCN$ COMMIT_TIMESTAMP $ OPERATION$ Red Pill Analytics 2992758 06/01/2014 12:00 AM INSERT NAME TICKER_SYMBOL OWNERSHIP Red Pill Analytics, LLC Private
  21. 21. www.redpillanalytics.com info@redpillanalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC Subscription View 23 NAME TICKER_SYMBOL OWNERSHIP CSCN$ COMMIT_TIMESTAMP $ OPERATION$ Red Pill Analytics 2992758 06/01/2014 12:00 AM INSERT Red Pill Analytics, LLC Private 2992760 07/14/2014 12:00 AM UPDATE NAME TICKER_SYMBOL OWNERSHIP Red Pill Analytics, LLC Private
  22. 22. www.redpillanalytics.com info@redpillanalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC Subscription View 24 NAME TICKER_SYMBOL OWNERSHIP CSCN$ COMMIT_TIMESTAMP $ OPERATION$ Red Pill Analytics 2992758 06/01/2014 12:00 AM INSERT Red Pill Analytics, LLC Private 2992760 07/14/2014 12:00 AM UPDATE Red Pill Analytics, Inc. RPAI Public 2992762 01/20/2015 12:00 AM UPDATE NAME TICKER_SYMBOL OWNERSHIP Red Pill Analytics, Inc. RPAI Public
  23. 23. www.redpillanalytics.com info@redpillanalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC Subscription View 25 NVL ( LEAD ( fnd_commit_date ) over ( PARTITION BY id ORDER BY fnd_commit_date ), to_date( '12/31/9999','mm/dd/yyyy' ) ) NAME CSCN$ COMMIT_TIMESTAMP$ EXPIRE_TIMESTAMP$ OPERATION$ CURRENT_IND Red Pill Analytics 2992758 06/01/2014 12:00 AM 07/14/2014 12:00 AM INSERT N Red Pill Analytics, LLC 2992760 07/14/2014 12:00 AM 01/20/2015 12:00 AM UPDATE N Red Pill Analytics, Inc. 2992762 01/20/2015 12:00 AM 12/31/9999 12:00 AM UPDATE Y
  24. 24. www.redpillanalytics.com info@redpillanalytics.com @RedPillA © 2014 RED PILL Analytics Oracle CDC Subscription View 26 NAME CSCN$ COMMIT_TIMESTAMP$ EXPIRE_TIMESTAMP$ OPERATION$ CURRENT_IND Red Pill Analytics 2992758 06/01/2014 12:00 AM 07/14/2014 12:00 AM INSERT N Red Pill Analytics, LLC 2992760 07/14/2014 12:00 AM 01/20/2015 12:00 AM UPDATE N Red Pill Analytics, Inc. 2992762 01/20/2015 12:00 AM 12/31/9999 12:00 AM UPDATE Y CASE WHEN ( RANK() over (PARTITION BY id ORDER BY fnd_commit_date desc )) = 1 THEN 'Y' ELSE 'N' END
  25. 25. DEMO: Viewing Change Data with GoldenGate
  26. 26. © 2014 RED PILL Analytics Am I in Love With a Deprecated Product?
  27. 27. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics What’s the Problem with Oracle CDC? 29 11g
  28. 28. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics 11g What’s the Problem with Oracle CDC? 30
  29. 29. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics What’s the Problem with Oracle CDC? 31 11g 12c 11g
  30. 30. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics What’s the Problem with Oracle CDC? 32 11g 12c 11g
  31. 31. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics What’s the Problem with Oracle CDC? 33 11g 12c 11g
  32. 32. © 2014 RED PILL Analytics Pragmatism
  33. 33. © 2014 RED PILL Analytics Text Here
  34. 34. © 2014 RED PILL Analytics Werner Heisenberg
  35. 35. © 2014 RED PILL Analytics Text Here
  36. 36. © 2014 RED PILL Analytics Text Here
  37. 37. © 2014 RED PILL Analytics Don’t Use Particles to Measure Particles
  38. 38. © 2014 RED PILL Analytics Don’t Use Streams to Capture Change
  39. 39. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics CDC Uses Streams (Capture and Queue) 41 Oracle CDC (Deprecated) A B
  40. 40. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics CDC Uses Streams (Capture and Queue) 42 Oracle CDC (Deprecated) A B Oracle Streams (Deprecated) A B
  41. 41. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Oracle GoldenGate Architecture 43
  42. 42. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Installing GoldenGate 44
  43. 43. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Installing GoldenGate 45
  44. 44. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Installing GoldenGate 46
  45. 45. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Configuring GoldenGate EXTRACT 47 EXTRACT EXT USERID oggcore_1, PASSWORD ogg SETENV (ORACLE_HOME="/app/oracle/product/11.2.0/dbhome_1") SETENV (ORACLE_SID="orcl") WARNLONGTRANS 1h, CHECKINTERVAL 30m EXTTRAIL ./dirdat/lt WILDCARDRESOLVE IMMEDIATE TABLE SUGARCRM.ACCOUNTS, TOKENS ( FND_SCN = @GETENV('TRANSACTION','CSN'), FND_ROW_RANK = @GETENV('RECORD','RSN'), FND_COMMIT_DATE=@GETENV('GGHEADER','COMMITTIMESTAMP'), FND_DML_TYPE=@GETENV('GGHEADER','OPTYPE') ); System change number (SCN) for the transaction USEDEFAULTS defines column for column mapping Transaction Commit Date (with Time) Operation Type: Delete, Update, Insert, PK Update, and others
  46. 46. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Configuring GoldenGate EXTRACT 48 EXTRACT EXT USERID oggcore_1, PASSWORD ogg SETENV (ORACLE_HOME="/app/oracle/product/11.2.0/dbhome_1") SETENV (ORACLE_SID="orcl") WARNLONGTRANS 1h, CHECKINTERVAL 30m EXTTRAIL ./dirdat/lt WILDCARDRESOLVE IMMEDIATE TABLE SUGARCRM.ACCOUNTS, TOKENS ( FND_SCN = @GETENV('TRANSACTION','CSN'), FND_ROW_RANK = @GETENV('RECORD','RSN'), FND_COMMIT_DATE=@GETENV('GGHEADER','COMMITTIMESTAMP'), FND_DML_TYPE=@GETENV('GGHEADER','OPTYPE') ); GGSCI (oracle.localdomain) 1> add extract ext, integrated tranlog, begin now EXTRACT added. GGSCI (oracle.localdomain) 2> add exttrail ./dirdat/lt, extract EXT, megabytes 200 EXTTRAIL added. GGSCI (oracle.localdomain) 3> dblogin userid oggcore_1, password ogg Successfully logged into database. GGSCI (oracle.localdomain as oggcore_1@orcl) 4> register extract ext database Extract EXT successfully registered with database at SCN 2239208. GGSCI (oracle.localdomain as oggcore_1@orcl) 5> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING EXT 00:00:10 00:00:04
  47. 47. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Configuring GoldenGate DATA PUMP 49 EXTRACT PMP PASSTHRU RMTHOST oracle.localdomain MGRPORT 7810, COMPRESS RMTTRAIL ./dirdat/rt TABLE SUGARCRM.*;
  48. 48. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Configuring GoldenGate DATA PUMP 50 EXTRACT PMP PASSTHRU RMTHOST linux-db MGRPORT 15000, COMPRESS RMTTRAIL ./dirdat/rt TABLE SUGARCRM.*; GGSCI (oracle.localdomain) 1> add extract PMP, exttrailsource ./dirdat/lt EXTRACT added. GGSCI (oracle.localdomain) 2> add rmttrail ./dirdat/rt, extract PMP, megabytes 200 RMTTRAIL added. GGSCI (oracle.localdomain) 3> start extract PMP Sending START request to MANAGER ... EXTRACT PMP starting GGSCI (oracle.localdomain) 4> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING EXT 00:00:02 00:00:07 EXTRACT RUNNING PMP 00:00:00 00:04:15
  49. 49. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Configuring GoldenGate REPLICAT 51 REPLICAT REP SETENV (ORACLE_HOME="/app/oracle/product/11.2.0/dbhome_1") SETENV (ORACLE_SID="orcl") USERID oggcore_2, PASSWORD ogg DISCARDFILE ./dirrpt/rep.dsc, append, megabytes 500 SOURCEDEFS ./dirdef/sugarcrm.def MAP SUGARCRM.ACCOUNTS, TARGET SUGARSTG.ACCOUNTS, KEYCOLS(ID, FND_SCN, FND_ROW_RANK), INSERTALLRECORDS, COLMAP ( USEDEFAULTS, FND_SCN=@token('FND_SCN'), FND_ROW_RANK=@token('FND_ROW_RANK'), FND_COMMIT_DATE=@token('FND_COMMIT_DATE'), FND_DML_TYPE=@token('FND_DML_TYPE') ); Map SOURCE and TARGET KEYCOLS defines matching criteria USEDEFAULTS defines column for column mapping Our “Tokens” mapped to columns
  50. 50. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Configuring GoldenGate REPLICAT 52 REPLICAT REP SETENV (ORACLE_HOME="/app/oracle/product/11.2.0/dbhome_1") SETENV (ORACLE_SID="orcl") USERID oggcore_2, PASSWORD ogg DISCARDFILE ./dirrpt/rep.dsc, append, megabytes 500 SOURCEDEFS ./dirdef/sugarcrm.def MAP SUGARCRM.ACCOUNTS, TARGET SUGARSTG.ACCOUNTS, KEYCOLS(ID, FND_SCN, FND_ROW_RANK), INSERTALLRECORDS, COLMAP ( USEDEFAULTS, FND_SCN=@token('FND_SCN'), FND_ROW_RANK=@token('FND_ROW_RANK'), FND_COMMIT_DATE=@token('FND_COMMIT_DATE'), FND_DML_TYPE=@token('FND_DML_TYPE') ); Map SOURCE and TARGET KEYCOLS defines matching criteria USEDEFAULTS defines column for column mapping Our “Tokens” mapped to columns INSERTALLRECORDS is the secret sauce for CDC
  51. 51. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Configuring GoldenGate REPLICAT 53 REPLICAT REP SETENV (ORACLE_HOME="/app/oracle/product/11.2.0/dbhome_1") SETENV (ORACLE_SID="orcl") USERID oggcore_2, PASSWORD ogg DISCARDFILE ./dirrpt/rep.dsc, append, megabytes 500 MAP SUGARCRM.ACCOUNTS, TARGET SUGARFND.ACCOUNTS, KEYCOLS(ID, FND_SCN), INSERTALLRECORDS, COLMAP( USEDEFAULTS, FND_SCN=@GETENV("TRANSACTION" , "CSN"), FND_ROW_RANK=@TOKEN("TK_ROW_RANK"), FND_COMMIT_DATE=@GETENV("GGHEADER" , "COMMITTIMESTAMP"), FND_DML_TYPE=@GETENV("GGHEADER" , "OPTYPE") ); GGSCI (oracle.localdomain) 1> dblogin userid oggcore_2, password ogg Successfully logged into database. GGSCI (oracle.localdomain as oggcore_2@orcl) 2> add checkpointtable oggcore_2.checkpoint Successfully created checkpoint table oggcore_2.checkpoint. GGSCI (oracle.localdomain as oggcore_2@orcl) 3> add replicat REP integrated, exttrail ./dirdat/rt REPLICAT (Integrated) added. GGSCI (oracle.localdomain as oggcore_2@orcl) 4> start replicat REP Sending START request to MANAGER ... REPLICAT REP starting GGSCI (oracle.localdomain as oggcore_2@orcl) 5> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING REP 00:00:00 00:20:54
  52. 52. DEMO: Change Data in GoldenGate
  53. 53. What Are We Missing?
  54. 54. What Are We Missing? Subscriptions
  55. 55. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Publish and Subscribe 57 EDW R Sandbox Partner Feed
  56. 56. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics create table ogg_subscription ( sub_name varchar2(30) not null enable, sub_type varchar2(6), server_name varchar2(30), effective_scn number, expiration_scn number ); Create the Subscription Purge the Window Extend the Window SCN Window Subscription Name
  57. 57. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics create table ogg_subscription ( sub_name varchar2(30) not null enable, sub_type varchar2(6), server_name varchar2(30), effective_scn number, expiration_scn number ); Create the Subscription create or replace view ogg_accounts_view as select id, name, ticker_symbol, ownership, fnd_scn, fnd_dml_type, fnd_commit_date, NVL ( LEAD ( fnd_commit_date ) over ( PARTITION BY id ORDER BY fnd_commit_date ), to_date( '12/31/9999','mm/dd/yyyy' )) fnd_expire_dt, CASE WHEN ( RANK() over (PARTITION BY id ORDER BY fnd_commit_date desc )) = 1 THEN 'Y' ELSE 'N' END current_ind from sugarstg.accounts join ogg_subscription on sub_name='FND_ACCOUNTS' and fnd_scn >=effective_scn and fnd_scn < expiration_scn order by fnd_commit_date; SCN Window Subscription Name Purge the Window Extend the Window
  58. 58. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Create the Subscription MERGE INTO ogg_subscription t USING ( SELECT to_number( applied_low_position ) complete_scn, server_name FROM all_gg_inbound_progress ) s ON ( s.server_name = t.server_name ) WHEN MATCHED THEN UPDATE SET t.expiration_scn = s.complete_scn, t.effective_scn = t.expiration_scn WHEN NOT MATCHED THEN INSERT ( t.effective_scn, t.expiration_scn, t.sub_name, t.server_name ) values ( '0', s.complete_scn, 'FND_ACCOUNTS', s.server_name ); Slide our window over if the subscription exists Last SCN applied by GoldenGate Purge the Window Extend the Window Create our subscription if it doesn’t already exist
  59. 59. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Create the Subscription delete sugarstg.accounts where fnd_scn < ( select min(expiration_scn) from ogg_subscription ); Delete all the records that have been read by all subscriptions Purge the Window Extend the Window
  60. 60. www.RedPillAnalytics.com info@RedPillAnalytics.com @RedPillA © 2014 RED PILL Analytics Is Oracle GoldenGate a Replacement for Oracle Change Data Capture? 62 Stewart Bryson medium.com/@stewartbryson @stewartbryson linkedin.com/in/stewartbryson

×