Create User, Tablespace Replication in Oracle GoldenGate

goldengateoraclereplication

How to replicate – Create User, Procedure and Tablespace using Oracle GoldenGate.

I am able to replicate DDL under schema, however above is not getting replicated i.e. when I create an user, procedure or tablespace.

GoldenGate Version – 12.2.0.1
Database Version – 11.2.0.4

Extract Conf:

GGSCI (sourceGG) 36> view params ext4

extract ext4
userid ogguser, password ogguser
exttrail /u01/app/oracle/product/11.2.0.4/oggsrc/dirdat/mt
DDL INCLUDE ALL
table ogguser.*;

GGSCI (sourceGG) 37>

Dump Conf:

GGSCI (sourceGG) 37> view params dpump2

extract dpump2
userid ogguser, password ogguser
rmthost targetGG, mgrport 7809
rmttrail /u01/app/oracle/product/11.2.0.4/oggtrg/dirdat/pt
passthru
DDL INCLUDE ALL
table ogguser.*;

GGSCI (sourceGG) 38> 

Replicat Conf:

GGSCI (targetGG) 37> view params rep4
replicat rep4
assumetargetdefs
handlecollisions
userid ogguser, password ogguser
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP
map ogguser.*, target ogguser.*;

GGSCI (targetGG) 38> 

Thanks!

Best Answer

DDL replication in Oracle Goldengate is disabled for the extract process by default and enabled for the replicat process.

To enable the DDL support, you need to specify the DDL parameter for the extract process.

DDL

Use the DDL parameter to:

  • enable DDL support
  • filter DDL operations
  • configure a processing action based on a DDL record

    Syntax

    DDL [
    {INCLUDE | EXCLUDE}
      [, MAPPED | UNMAPPED | OTHER | ALL]
      [, OPTYPE type]
      [, OBJTYPE 'type']
      [, SOURCECATALOG catalog | ALLCATALOGS]
      [, ALLOWEMPTYOBJECT]
      [, ALLOWEMPTYOWNER]
      [, OBJNAME name]
      [, INSTR 'string']
      [, INSTRWORDS 'word_list']
      [, INSTRCOMMENTS 'comment_string']
      [, INSTRCOMMENTSWORDS 'word_list']
      [, STAYMETADATA]
      [, EVENTACTIONS (action)
    ]
    [...]
    
  • In order to replicate CREATE USER, ALTER TABLESPACE or CREATE ROLE kind of statement the DDL scope should be OTHER or ALL to include all kind of DDLs.

    Some other examples of OTHER scope:

    CREATE USER joe IDENTIFIED by joe;
    CREATE ROLE ggs_gguser_role IDENTIFIED GLOBALLY;
    ALTER TABLESPACE gg_user TABLESPACE GROUP gg_grp_user;
    

    References:

  • Oracle GoldenGate - DDL Replication
  • DDL: Oracle Goldengate 12c
  • Understanding DDL Scopes