{"id":1416,"date":"2018-05-15T10:18:17","date_gmt":"2018-05-15T02:18:17","guid":{"rendered":"http:\/\/www.royalwzy.com\/?p=1416"},"modified":"2018-05-15T10:18:17","modified_gmt":"2018-05-15T02:18:17","slug":"goldengate%e5%ad%a6%e4%b9%a05-oracle-to-mysql","status":"publish","type":"post","link":"http:\/\/www.royalwzy.com\/?p=1416","title":{"rendered":"GoldenGate\u5b66\u4e605&#8211;Oracle to MySQL"},"content":{"rendered":"<p>GoldenGate for Oracle to MySQL<br \/>\n1. Environments;<br \/>\n    1. Source Database:<br \/>\n        1. Oracle:11g R2;<br \/>\n        2. Ip Address:192.168.10.11;<br \/>\n        3. Hostname:primary.snda.com;<br \/>\n        4. Oracle SID:primary;<br \/>\n    2. Target Database:<br \/>\n        1. Mysql:5.5.21;<br \/>\n        2. Ip Address:192.168.10.55;<br \/>\n        3. Hostname:master.snda.com;<br \/>\n2. Oracle to Mysql configuration;<br \/>\n3. Prepare the Environment;<br \/>\n    1. Description:<br \/>\n        1. The GoldenGate software must be installed on both the source and target systems;<br \/>\n        2. The installation includes a sample database and scripts to generate initial data as well as subsequent update operations;<br \/>\n        3. The source and target tables are created and loaded with initial data;<br \/>\n        4. the GoldenGate Manager processes are also started so that other processes may be configured and started;<br \/>\n    2. Prepare the Oracle source environment:<br \/>\n        1. \u5728\u6e90\u6570\u636e\u5e93\u521b\u5efagg\u7528\u6237,\u5e76\u8d4b\u4e88\u4e00\u5b9a\u7684\u6743\u9650:create user gg identified by gg default tablespace example;grant connect, resource to gg;(\u4e00\u5b9a\u8981\u4fdd\u8bc1\u8868\/\u8868\u7a7a\u95f4\u662flogging\u7684,select table_name, tablespace_name, logging, owner from dba_tables where owner=&#8217;GG&#8217;;)<br \/>\n        2. \u5728\u6e90\u6570\u636e\u5e93\u7684gg\u7528\u6237\u4e0b\u521b\u5efa\u6d4b\u8bd5\u4f7f\u7528\u7684\u8868(\u811a\u672c\u662fGoldenGate\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684demo_ora_create.sql\u6587\u4ef6);<br \/>\n        3. \u5728\u6e90\u6570\u636e\u5e93\u7684\u6d4b\u8bd5\u8868\u4e2d\u6dfb\u52a0\u6d4b\u8bd5\u6570\u636e(\u811a\u672c\u662fGoldenGate\u76ee\u5f55\u4e0b\u7684demo_ora_insert.sql\u6587\u4ef6);<br \/>\n        4. Add supplemental logging;<br \/>\n        5. Configure the Manager process on the source;<br \/>\n    3. Prepare the Mysql target environment:<br \/>\n        1. \u51c6\u5907\u6570\u636e;<br \/>\n        2. Configure the Manager process;<br \/>\n        3. create a user;<br \/>\n4. Configure Initial Data Load using Direct Load;<br \/>\n    1. Initial Load Methods:<br \/>\n        1. Oracle GoldenGate Methods;<br \/>\n        2. Database-specific Methods:<br \/>\n            1. Backup\/Restore;<br \/>\n            2. Export\/Import;<br \/>\n            3. SQL scripts;<br \/>\n            4. Break mirror;<br \/>\n            5. Transportable tablespaces;<br \/>\n            6. Note:<br \/>\n                1. Run a test initial load early on for timing and sizing;<br \/>\n                2. Run the actual initial load after starting change capture on the source;<br \/>\n        3. Current use;<br \/>\n    2. Initial data capture on source:<br \/>\n        1. add the initial load capture batch task group:GGSCI> add extract eint<unique id>, sourceistable;(sourceistable \u53c2\u6570\u4ee3\u8868\u8fd9\u662finitial data);<br \/>\n        2. configure the initial load capture parameter file:GGSCI> edit params eint<\/unique><unique id>;<br \/>\n    3. Initial data delivery on target:<br \/>\n        1. add the initial load delivery batch task:GGSCI>add replicat rini<\/unique><unique id>, specialrun;(specialrun:Create a Replicat special run as a task)<br \/>\n        2. configure the initial load delivery parameter file;(assumetargetdefs:\u5047\u5b9a\u76ee\u6807\u6570\u636e\u5e93\u548c\u6e90\u6570\u636e\u5e93\u8868\u7ed3\u6784\u4e00\u81f4;discardfile:\u5931\u8d25\u7684\u8bb0\u5f55\u8bb0\u5f55\u7684\u6587\u4ef6;)<br \/>\n    4. Define the source.def:<br \/>\n        1. \u5b9a\u4e49defgen\u53c2\u6570\u6587\u4ef6;<br \/>\n        2. \u6267\u884c\u5b9a\u4e49\u53c2\u6570\u6587\u4ef6:dengen paramfile .\/dirprm\/defgen.prm,\u4f1a\u751f\u6210\u8868\u7ed3\u6784\u5b9a\u4e49\u6587\u4ef6.\/dirdef\/source.def;<br \/>\n        3. \u62f7\u8d1d\u5230\u76ee\u6807\u6570\u636e\u5e93\u76f8\u5e94\u7684\u76ee\u5f55\u4e0b;<br \/>\n    5. Execute the initial load process:<br \/>\n        1. start extract process:start extract eini<\/unique><unique id>;<br \/>\n        2. view the results on the target system:view report rini<\/unique><unique id>;<br \/>\n        3. \u5728\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67e5\u770b\u6570\u636e;<br \/>\n5. Configure Change Capture(online mode);<br \/>\n    1. Extract can be configured to:<br \/>\n        1. Capture changed data from database logs;<br \/>\n        2. Capture data directly from source tables for initial data load;<br \/>\n        3. Write the data to a local or remote trail or file;<br \/>\n    2. add the extract group:add extract emsq<\/unique><unique id>, tranlog, begin now, threads <instances>;<br \/>\n    3. create the extract parameter file;<br \/>\n    4. define the GoldenGate trail:add rmttrail .\/dirdat\/<trail id>, extract emsq<unique id>, megabytes 5;(default 10M size)<br \/>\n    5. start the capture process:start extract eora<\/unique><unique id>;<br \/>\n    6. \u53ef\u4ee5\u901a\u8fc7view report eorasd\u67e5\u770b\u65e5\u5fd7;<br \/>\n6. Configure Change Delivery;<br \/>\n    1. set up the checkpoint table;<br \/>\n        1. create a GLOBALS file on the target system;(exit and save)<br \/>\n        2. activate the GLOBALS parameters;<br \/>\n    2. Configure Change Delivery;<br \/>\n        1. add the replicat group;<br \/>\n        2. create replicat parameter file;<br \/>\n        3. start the replicat process;<br \/>\n7. Generate Activity and Verify the Results;<br \/>\n    1. exceute miscellaneous update, insert and delete operations on source system;<br \/>\n    2. verify results on the source system;<br \/>\n    3. verify results on the target system;<br \/>\n    4. turn off error handling;<br \/>\n8. Parameter Files Knowlege:<br \/>\n    1. Editing Parameter Files:<br \/>\n        1. Edit parameter files to configure GoldenGate processes;<br \/>\n        2. The GLOBALS parameter file is identified by its file path:GGSCI>edit params .\/GLOBALS;<br \/>\n        3. Manager and utility parameter files are identified by keywords:GGSCI>edit params mgr\/defgen;<br \/>\n        4. Extract and Replicat parameter files are identified by the process groiup name:GGSCI>edit params <group name>;<br \/>\n    2. GLOBALS Versus Process Parameters:<br \/>\n        1. GLOBALS parameter apply to all processes:<br \/>\n            1. set when Manager starts;<br \/>\n            2. reside in <goldengate install directory>\/GOLBALS;<br \/>\n        2. Process parameters apply to a specific process(Manager, Extract, Server Collector, Replicat, Utilities):<br \/>\n            1. set when the process starts;<br \/>\n            2. override GOLBALS settings;<br \/>\n            3. reside by defaults in the dirprm directory in files named <process name>.prm;<br \/>\n            4. most apply to all tables processed but some can be specified at the table level;<br \/>\n    3.<br \/>\nGLOBALS Parameters:<br \/>\n        1. Control things common to all processes in a GoldenGate instance;<br \/>\n        2. Can be overridden by parameters at the process level;<br \/>\n        3. Must be created before any processes are started;<br \/>\n        4. Must exit GGSCI to save;<br \/>\n        5. Once set, rarely changed;<br \/>\n        6. MGRSERVNAME:defines a unique Manager service name;<br \/>\n        7. CHECKPOINTTABLE:Defines the table name used for Replicat&#8217;s checkpoint table;<\/process><\/goldengate><\/group><\/unique><\/trail><\/instances><\/unique><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GoldenGate for Oracle to MySQL 1. Environments; 1. Sour [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1416","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/1416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1416"}],"version-history":[{"count":1,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/1416\/revisions"}],"predecessor-version":[{"id":1417,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/1416\/revisions\/1417"}],"wp:attachment":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1416"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}