"OGG 01" Win7 Configuration Oracle GoldenGate Pit Guide

Source: Internet
Author: User
Tags reserved

Installing Oracle

Install Oracle11g 32-bit Oracle 32 bit, OGG must also be 32 bit, otherwise there will be 0xc000007b unable to start the error "Install directory D:\oracle\product\11.1.0\db1" This directory should be set to the environment variable Oracle_home "

Setting environment variables

JAVAHOME C:\Program files\java\jdk1.8.0121

ORACLEHOME D:\oracle\product\11.1.0\db1

Oracle_sid ORCL

How to find environment variables

Get ORACLESID: Open SQLPlus, log in to SYS account, execute Select instancename from V$instance;

Get OracleHOME: Find the Oracle installation directory, this directory has a feature: there is a subdirectory called RDBMS. That is to say:%oraclehome%\rdbms\ This path to be able to open normally is configured successfully.

Installing OGG

Http://www.oracle.com/technetwork/cn/middleware/goldengate/downloads/index.html drag to the bottom of the page

Search for the 32-bit oracle_11g of OGG

Target 1
  • Create two user admin and root for the installed oracle_11g.

  • Admin corresponds to the admin structure and creates a tb_ test table.

  • Root corresponds to the root structure and also creates a tb_ TEST (which is the same as the table structure).

  • When admin. when the table data in TB TEST changes, root. automatic synchronization of table data in TB TEST (Backup)

  • PS. Actual disaster recovery backup, must be two Oracle servers, transfer backup data over the network-you can imagine admin and Root on two different servers.

Target 2
  • When admin. When the Tb_ TEST table data changes, this change is passed to Java and C # programs.

  • When a Java, C # program gets a data change message, it logs the changes to the log (or other operations).

Configuration database Open SQL Plus

SYS Login

To enable the Log archive mode:

Enable Force logging mode:

Enable Suppleme:

To close the source-side database Recycle Bin:

switch logs, and it's a good idea to restart the database service--or reboot the system:

Create a user, authorize DBA authority (you can explore Ogg's minimum privileges yourself).

Create a data table

Start configuring OGG

Enter the following commands sequentially:

> create subdirs

> edit param mgr

To Notepad, write the following, save close:

PORT 7809

Dynamicportlist 7840-7850

> start mgr

> dblogin userid admin password admin

> add trandata admin.*

> add extract ext1, tranlog, begin now

> edit param ext1

Fill in the following configuration:

Extract Ext1

UserID Admin,password Oracle

Rmthost 127.0.0.1, Mgrport 7809

Rmttrail D:\ORACLE\PRODUCT\11.1.0\X86_OGG4ORACLE\DIRDAT\R1

Dynamicresolution

Gettruncates

Table admin.*;

> add rmttrail D:\oracle\product\11.1.0\x86_ogg4oracle\dirdat\r1 extract ext1

> start mgr

> start ext1

> info all

Copy the OGG folder, ready to start configuring the backup service root (user), "admin table TBtest" back to root table TBtest

Double-click the newly copied Ggsci.exe

> edit param mgr

> add replicat rep1 exttrail D:\oracle\product\11.1.0\x86_ogg4oracle_target\dirdat\r1, nodbcheckpoint

> edit param rep1

Fill in the following: (The configuration here is wrong, the correct configuration after the error is below)

Replicat REP1

UserID Root,password Oracle

Assumetargetdefs

Reperror Default,discard

Discardfile C:\oradata\repsz.dsc,append,megabytes 100

Map Admin. , Target root.;

Manually create the C:\oradata\ folder above. "Do not create errors manually"

> start mgr

> start rep1

So far

Target 1 Test start

Execute script:

insert into TB_TEST(fid, fname, fbirthday, fsex)values (10, ‘路人甲‘, "TO_DATE"(‘1992-02-10‘, ‘yyyy-MM-dd‘), ‘男‘);

Comparison of two tables:

There is a bug, the author wants to calm down for a while.

A careful examination seems to have found a BUG:

shouted: God Bless the Beast, code without bugs.

Enter the command in ADMIN Ogg first: > start mgr> start ext1

Open ROOT MGR 7909: > start mgr> start rep1

I can't live this day.

Conjecture: When we copied D:\oracle\product\11.1.0\x86ogg4oracle\ to x86Ogg4oracle_target, did we copy the configuration of the source side?

So the search in x86ogg4oracletarget ext1--does search for EXT1 configuration in addition to the source side. "The target side does not need this configuration, the search out the Ext1 all delete"

Execute the INSERT statement again-the problem remains unresolved: still unable to sync-the heart has been crushed and shattered.

At helpless, an unexpected line error was found in x86ogg4oracletarget\ ggserr.log:

Compare the x86ogg4oracle\dirdat\ and x86ogg4oracle_target\dirdat\ two folders:

Manually copy thefiles in the x86 ogg4oracle\dirdat\ to the x86ogg4oracle_target\dirdat\, restart the source, Target end Services "Start Mgr, start Ext1, start Rep1 , these basic startup commands, I don't say much under the article.

Again the insert--Miracle took place:

Finally found that want to achieve synchronization will have to let \x86ogg4oracletarget\dirdat\ in the data. So where does the data from this directory come from?

  • 1.the data in the \x86 ogg4oracle\dirdata\ is transmitted through some mechanism to \x86ogg4oracle_target\dirdata\

  • 2, configuration Ext1, where the parameter rmttrail should not be paired with the source-side path, to be paired with the target-side path

Start to verify the conjecture:

  • We started the source Ogg, started Ext1, executed the Insert script--and found out: \x86_ogg4oracle\dirdata\ does not generate files.

  • We then started the target Ogg, started REP1, executed the Insert script--and found that the \x86_ogg4oracle\dirdata\ file was created.

  • --that is, the data directory when the EXT1 is configured, Rmttrail is the target side directory.

The theory was clear and began reconfiguring Ext1 and REP1:

  • Search in \x86_ogg4oracle\ ext1--all deleted, reserved EXT1.PRM

  • Search rep1--in \x86ogg4oracletarget\ all deleted, reserved REP1.PRM

Rebuilding Ext1:

Extract Ext1

UserID Admin,password Oracle

Rmthost 127.0.0.1, Mgrport 7909

Rmttrail D:\oracle\product\11.1.0\x86ogg4oracletarget\dirdat\r1

Dynamicresolution

Gettruncates

Table admin.*;

Rebuilding REP1:

Replicat REP1

UserID Root,password Oracle

Assumetargetdefs

Reperror Default,discard

Discardfile D:\oracle\product\11.1.0\x86ogg4oracletarget\dirdat\repsz.dsc,append,megabytes 100

Map Admin. , Target root.;

Execute Insert Script--after 2 seconds, the synchronization succeeds:

Legacy issues

\x86_ogg4oracle\ where does the data changes captured by the insert--capture be stored when the EXT1 is started?

Target 2, how to write the corresponding Java plugin--to be continued.

Ogg is a change-based synchronization-a part that has not been synchronized before, and is not synchronized after the Ogg is enabled.

Then: Source-side TBTEST. FID = 10, target-side TBTEST. FID =30 (out of sync from the start)

  • --Source Side Execution UPDATE tb_test SET fid=fid*2

  • -How much will the FID of the target end become? Fid=20 consistent with the source end? Or a fid=60?

"OGG 01" Win7 Configuration Oracle GoldenGate Pit Guide

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.