Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
oracle_12_goldengate_conf_singletable [2019/11/08 18:03] – created andonovj | oracle_12_goldengate_conf_singletable [2019/11/09 11:45] (current) – removed andonovj | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Overview====== | ||
- | Using Datapump is the cleanest way to start or reset golden gate. So let's see how it is: | ||
- | |||
- | ======Golden Gate Set-Up====== | ||
- | In that case we want to migrate a single schema and set up one way replication | ||
- | |||
- | - Server: Source (schema: HR) | ||
- | - Server: Destination | ||
- | |||
- | =====Cleanup===== | ||
- | Firstly, we will clean up the schema, by deleting everything | ||
- | |||
- | <sxh bash> | ||
- | declare | ||
- | lv_statement varchar2(2000); | ||
- | begin | ||
- | for r in ( select object_name, | ||
- | loop | ||
- | case r.object_type | ||
- | when ' | ||
- | when ' | ||
- | when ' | ||
- | when ' | ||
- | else lv_statement := null; | ||
- | end case; | ||
- | begin | ||
- | dbms_output.put_line(lv_statement); | ||
- | execute immediate lv_statement; | ||
- | exception when others then null; | ||
- | end; | ||
- | end loop; | ||
- | end; | ||
- | / | ||
- | select count(*) from dba_objects where owner=' | ||
- | </ | ||
- | |||
- | |||
- | =====Golden Gate Source Config===== | ||
- | On the source we have to configure couple stuff: | ||
- | |||
- | ====Setup Trend Data==== | ||
- | <sxh bash> | ||
- | GGSCI (oelgg1.it.dbi-services.com) 1> dblogin useridalias DB1 domain admin | ||
- | Successfully logged into database. | ||
- | |||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 2> add trandata HR.* | ||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 2> edit params extrcdc1 | ||
- | </ | ||
- | |||
- | ====Parameters of the Extract==== | ||
- | <sxh bash> | ||
- | EXTRACT extrcdc1 | ||
- | USERIDALIAS DB1 domain admin | ||
- | EXTTRAIL ./dirdat/gg | ||
- | LOGALLSUPCOLS | ||
- | UPDATERECORDFORMAT compact | ||
- | TABLE hr.*; | ||
- | TABLEEXCLUDE HR.EMP_DETAILS_VIEW; | ||
- | </ | ||
- | |||
- | ====Config Extract==== | ||
- | <sxh bash> | ||
- | GGSCI (oelgg1.it.dbi-services.com) 4> dblogin useridalias DB1 domain admin | ||
- | | ||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 5> register extract extrcdc1 database | ||
- | Extract EXTRCDC1 successfully registered with database at SCN 1863433. | ||
- | | ||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 6> add extract extrcdc1, integrated tranlog, begin now | ||
- | EXTRACT added. | ||
- | | ||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 7> add exttrail ./ | ||
- | EXTTRAIL added. | ||
- | |||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 10> edit params dppump1 | ||
- | </ | ||
- | |||
- | ====Parameters Dump==== | ||
- | <sxh bash> | ||
- | EXTRACT dppump1 | ||
- | PASSTHRU | ||
- | RMTHOST oelgg2, MGRPORT 7809 | ||
- | RMTTRAIL ./dirdat/jj | ||
- | TABLE hr.*; | ||
- | TABLEEXCLUDE HR.EMP_DETAILS_VIEW; | ||
- | </ | ||
- | |||
- | |||
- | |||
- | ====Config Dump==== | ||
- | <sxh bash> | ||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 12> add extract dppump1, exttrailsource ./dirdat/gg | ||
- | EXTRACT added. | ||
- | | ||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 13> add rmttrail ./ | ||
- | RMTTRAIL added. | ||
- | | ||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 23> start extract * | ||
- | | ||
- | Sending START request to MANAGER ... | ||
- | EXTRACT DPPUMP1 starting | ||
- | | ||
- | Sending START request to MANAGER ... | ||
- | EXTRACT EXTRCDC1 starting | ||
- | | ||
- | GGSCI (oelgg1.it.dbi-services.com as ggadmin@DB1) 24> info all | ||
- | | ||
- | Program | ||
- | | ||
- | MANAGER | ||
- | EXTRACT | ||
- | EXTRACT | ||
- | </ | ||
- | |||
- | |||
- | =====Golden Gate Target Config===== | ||
- | Once this is working, let's go for the target system: | ||
- | |||
- | |||
- | |||
- | ====Replicat Parameters==== | ||
- | <sxh bash> | ||
- | GGSCI (oelgg2.it.dbi-services.com as ggadmin@DB2) 26> edit params rplcdd | ||
- | |||
- | REPLICAT replcdd | ||
- | ASSUMETARGETDEFS | ||
- | DISCARDFILE ./ | ||
- | USERIDALIAS DB2 domain admin | ||
- | MAP hr.*, TARGET hr.*; | ||
- | </ | ||
- | |||
- | |||
- | ====Config Replicat==== | ||
- | <sxh bash> | ||
- | GGSCI (oelgg2.it.dbi-services.com) 1> dblogin useridalias DB2 domain admin | ||
- | Successfully logged into database. | ||
- | | ||
- | GGSCI (oelgg2.it.dbi-services.com as ggadmin@DB2) 2> add replicat replcdd, integrated, exttrail ./dirdat/jj | ||
- | </ | ||
- | |||
- | ===On SourceServer=== | ||
- | A quick return to the source database, we have to export the schema: | ||
- | |||
- | ====Create a base==== | ||
- | We have to create a consistent backup, therefore we have to take current SCN and execute expdp using that scn :) | ||
- | |||
- | <sxh bash> | ||
- | SQL> select current_scn from v$database; | ||
- | |||
- | CURRENT_SCN | ||
- | ----------- | ||
- | 2040227 | ||
- | | ||
- | </ | ||
- | |||
- | |||
- | <sxh bash> | ||
- | SQL> create or replace directory gg as '/ | ||
- | |||
- | Directory created. | ||
- | |||
- | SQL> !expdp userid="' | ||
- | </ | ||
- | |||
- | After you tansfer the file: " | ||
- | |||
- | ===On Target Server=== | ||
- | <sxh bash> | ||
- | SQL> create or replace directory gg as '/ | ||
- | |||
- | Directory created. | ||
- | |||
- | SQL> !impdp userid="' | ||
- | |||
- | </ | ||
- | |||
- | ====Start Replicat==== | ||
- | So let's start the Replicat using the scn from the source server and the consistent SCN. | ||
- | |||
- | <sxh bash> | ||
- | GGSCI (oelgg2.it.dbi-services.com) 6> start replicat REPLCDD, aftercsn 2040227 | ||
- | |||
- | Sending START request to MANAGER ... | ||
- | REPLICAT REPLCDD starting | ||
- | </ |