Friday, August 23, 2013

create SOURCEDEF file using Goldengate DEFGEN utility

Data definitions are needed when the source and target tables have different definitions or the databases are of different types.

Perform below steps on the SOURCE database from which you want to obtain metadata definitions.
From the Oracle GoldenGate directory, run GGSCI.

1.        In GGSCI, issue the following command to create a DEFGEN parameter file.
              
                      ggsci > Edit params defgen

                     defsfile ./dirsql/SOURCE_DEFGEN.def
                     userid gguser password ******
                     TABLE schema.*;

2.      Enter the parameters listed above in the order shown and invoke DEFGEN from GG_HOME location 

                   $ ./defgen paramfile ./dirprm/defgen.prm

              3.      Use FTP or SFTP to transfer this SOURCE_DEFGEN.def file to the TARGET server
            
              4.   Specify this copied SOURCE_DEFGEN.def file location in REPLICAT param file
                   ex: SOURCEDEFS ./dirsql/SOURCE_DEFGEN.def


For every DDL change happen to the source tables (only tables which are captured for replication)  generate a NEW sourcedef file and copied to the target server

NOTE:  Do not create a data-definitions file for Oracle sequences. It is not needed and DEFGEN does not support it.


7 comments:

Dada Peer Shaik said...

Hi
What should we do if on the target side the tables are in different schema

Thanks

Oracle DBA said...

Sourcedef file has nothing to do with the schema names, for replication into different schema on target you need to specify the schema name in MAP clause

ex: MAP source_schema.TAB, TARGET target_schema.TAB, .........................

KPN said...

Hi what should we do if we have multiple extract and pump in source side.

Oracle DBA said...

Hi KPN, Defgen collects the data definitions for the tables, it is nothing to do with the etracts.
If you need definitions for the tables specified in ext then include all table list in defs file (or) if you have multiple extracts and it is all up to you whether you want to capture ddl for entire all extracts or separate defs files, hope this helps ...

Hà Nguyên blogs said...

hi, how can use ddl and dml replication. Now, i only sync data DB not sync DDL on db.

Please tellme at email: tran.vhit@gmail.com.

Thank so much .

Oracle DBA said...

Anh, please se this oracle DOC and follow the steps:
How To Configure Oracle Goldengate DDL Replication In an Existing GoldenGate One-Way Replication. (Doc ID 1468548.1)

Unknown said...

How can we add two more columns on target side compared to source side.
For example source table will have EMPID and ROLE,Target table should have EMPID, ROLD, BATCH_ID,LOAD_DATE.How to populate the data using golden gate.

Post a Comment

Auto Scroll Stop Scroll