DBA Hub

📋Steps in this guide1/4

Defgen utility in Oracle goldengate DBACLASS

Defgen utility in Oracle goldengate If source and target table structures are different, like source has then we need to use definition file in replicat file.

oracle replicationintermediate
by OracleDba
13 views
1

Overview

If source and target table structures are different, like source has then we need to use definition file in replicat file. Here we will generate definition file of a table DBACLASS.EMPLOYEE from source database and use it in target db. 1. Create defgen parameter file This will create the parameter file in $GG_HOME/dirprm ls -ltr /u01/ggate/dirprm/defgen.prm

Code/Command (click line numbers to comment):

1
2
3
4
ggsci>edit params defgen
defsfile /u01/ggate/dirsql/dbaclass_def.sql
userid ggatebss, password ggatebss#123
TABLE DBACLASS.EMPLOYEE;
2

Section 2

2. Now execute the param file( to generate the defgen file) ./defgen paramfile /u01/ggate/dirprm/defgen.prm Now copy the file dbaclass_def.sql to target server(where replicat is running. 4.  Stop the replicat and Update the extract file with sourcedef parameter as below

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
./defgen paramfile  /u01/ggate/dirprm/defgen.prm

***********************************************************************
        Oracle GoldenGate Table Definition Generator for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258
   Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 16:58:29

Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2016-12-20 14:52:05
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Tue Sep 16 01:56:35 EDT 2014, Release 2.6.32-504.el6.x86_64
Node: b23e2bay16
Machine: x86_64
                         soft limit   hard limit
Address Space Size   :    unlimited    unlimited
Heap Size            :    unlimited    unlimited
File Size            :    unlimited    unlimited
CPU Time             :    unlimited    unlimited

Process id: 29614

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
defsfile /u01/ggate/dirsql//dbaclass_def.sql
userid ggatebss, password ************
TABLE DBACLASS.EMPLOYEE;
Retrieving definition for DBACLASS.EMPLOYEE


Definitions generated for 1 tables in /u01/ggate/dirsql/dbaclass_def.sql
3

Section 3

SOURCEDEFS /ggatebss/app/ggate/product/11.2.1.0.3/ggate_1/myobjects3.sql Now you can start your replicat. NOTE – If you source and target database versions are different. i.e source db is of 12c and target db is of 11g, then use format command in the defgen file. i.e the file will look as below. format release < target db release version>

Code/Command (click line numbers to comment):

1
2
3
4
5
6
REPLICAT BLTLR
USERID ggatebss, PASSWORD ggatebss
DBOPTIONS SUPPRESSTRIGGERS,DEFERREFCONST
SOURCEDEFS /ggatebss/app/ggate/product/11.2.1.0.3/ggate_1/myobjects3.sql
DISCARDFILE /ggatebss/install/datacapture_bsst/discardbltlr,append,megabytes 1000
MAP  DBACLASS.EMPLOYEE,TARGET DBACLASS.EMPLOYEE
4

Section 4

Code/Command (click line numbers to comment):

1
2
3
4
ggsci>edit params defgen
defsfile /u01/ggate/dirsql/dbaclass_def.sql ,format release 11.2
userid ggatebss, password ggatebss#123
TABLE DBACLASS.EMPLOYEE;

Comments (0)

Please to add comments

No comments yet. Be the first to comment!