One-way synchronization of data between two Oracle libraries using OGG

Source: Internet
Author: User

Configuration: Source database 100.100.100.21 instance name Dbsid2

Target Database 100.100.100.41 instance name db1

Experimental target: The Scott user emp table in the source database is synchronized to the test table in the target database Scott

Install package as file ogg112101_fbo_ggs_linux_x64_ora10g_64bit.zip

Unzip, then Tar unzip tar-xvf fbo_ggs_linux_x64_ora10g_64bit.tar-c/oracle/ogg/

1. Source Database (dbsid2) configuration:

(1) User rights:Grant DBA to Scott

(2) Open Archive Mode

(3) Additional logs:
ALTER DATABASE add supplemental log data;

ALTER DATABASE force logging;

(4) Adding the target database db1 information to the Tnsnames.ora

2. Target Database (db1) configuration:

(1) Scott user creates empty table testwith the same table structure as EMP

(2) Open Archive Mode

(3) Additional logs:

ALTER DATABASE add supplemental log data;

ALTER DATABASE force logging;

(4) adding information from the source database (Dbsid2) to Tnsnames.ora

3. Source database server goldengate installation

(1) unzip to the /oracle/ogg target .

(2) run ./ggsci

(3) new subdirectory: ggsci (host2) 1> create Subdirs

Creating subdirectories under current Directory/oracle/ogg

Parameter Files/oracle/ogg/dirprm:already exists

Report files/oracle/ogg/dirrpt:created

Checkpoint files/oracle/ogg/dirchk:created

Process Status files/oracle/ogg/dirpcs:created

SQL Script files/oracle/ogg/dirsql:created

Database Definitions files/oracle/ogg/dirdef:created

Extract Data files/oracle/ogg/dirdat:created

(4) Configuring the Port parameter for character Management

Ggsci (host2) 6> edit params Mgr

Input : PORT 7809 and then save

Check the input status:

Ggsci (host2) 7> view params Mgr

PORT 7809

(5) starting start Mgr:

Ggsci (host2) 8> start Mgr

MGR is already running.

Ggsci (host2) 9> info Mgr

Manager is running (IP port host2.7809).

4. Target database server goldengate installation (same as source target server)

(1) unzip to the /oracle/ogg target .

(2) run ./ggsci

(3) new subdirectory: ggsci (host2) 1> create Subdirs

Creating subdirectories under current Directory/oracle/ogg

Parameter Files/oracle/ogg/dirprm:already exists

Report files/oracle/ogg/dirrpt:created

Checkpoint files/oracle/ogg/dirchk:created

Process Status files/oracle/ogg/dirpcs:created

SQL Script files/oracle/ogg/dirsql:created

Database Definitions files/oracle/ogg/dirdef:created

Extract Data files/oracle/ogg/dirdat:created

(4) Configuring the Port parameter for character management

Ggsci (host2) 6> edit params Mgr

Input : PORT 7809 and then save

Check the input status:

Ggsci (host2) 7> view params Mgr

PORT 7809

(4) starting start Mgr:

Ggsci (host2) 8> start Mgr

MGR is already running.

Ggsci (host2) 9> info Mgr

Manager is running (IP port host2.7809).

5. Configure the source database server (DBSID2) transport process extract

(1) Add a process named Source1

Ggsci (HOST2) 19> Add extract source1,sourceistable

EXTRACT added.

(3) Modifying the source1 parameter

Ggsci (host2) 20> edit params Source1

Add the following, and save

Extract Source1

Setenv (Nls_lang=american_america. AL32UTF8)

UserID Scott,password Tiger

Rmthost 100.100.100.41,mgrport 7809

Rmttask Replicat,group Target1

Table scott.emp;

Note:1. Users who need to copy the table are named Scott, password Tiger

2, the target database (db1) IP is 100.100.100.41, the port is 7809

3. the receiving process for the target database (db1) is named Target1

4. the table to be copied is: scott.emp .

To view modified parameters

Ggsci (host2) 21> view params source1

6. Configuring the target database DB1 replicat receive process

(1) Add the replicat process with the name source1

Ggsci (host2) 9> add Replicat target1,specialrun

Replicat added.

(2) Add modification Parameters:ggsci (host2) 13> edit params target1

Replicat Target1

Setenv (Nls_lang=american_america. AL32UTF8)

Assumetargetdefs

UserID Scott,password Tiger

Discardfile./dirrpt/target1.dsc,purge

Map Scott.emp,target Scott.test;

Note:1. The target database account is Scott,Tiger .

2. Synchronize table scott.emp from the source database to the scott.test table

after viewing the changes

Ggsci (host2) 1> view params Target1

7. Source Database (Dbsid2) begins synchronization

(1) start Syncing

Ggsci (HOST2) 11> start extract Source1

Sending START request to MANAGER ...

EXTRACT SOURCE1 Starting

(2) monitoring the synchronization process

Ggsci (host2) 12> info All

Program Status Group lags at chkpt time Since chkpt

MANAGER RUNNING

(3) source Database View synchronization log

Ggsci (HOST2) 13> View report Source1

8. Target Database (db1) View synchronization status

Sql> select * from test;

One-way synchronization of data between two Oracle libraries using OGG

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.