Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure ogg

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how to configure ogg. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Ogg configuration

First of all, if the source-database side is in archive mode, turn on the minimum additional log mode of the database and complete the log of the required synchronization table.

The command is as follows

Sql > select supplemental_log_data_min from v$database

-- display as no indicates that it is not enabled

Sql > alter database add supplemental log data

-- enable the minimum additional log mode at the database level

Sql > select force_logging from v$database

-- check to see if mandatory logging mode is turned on to avoid data loss

Sql > Alter database force logging

-- enable log enforcement mode

Sql > alter table add supplemental log data (primary key) columns

Node one:

Alter database force logging

Alter database add supplemental log data

Alter table scott.t1 add supplemental log data (primary key) columns

Node 2:

Alter database force logging

Alter database add supplemental log data

Alter table scott.t2 add supplemental log data (primary key) columns

Alter table scott.t3 add supplemental log data (primary key) columns

Create directory dp_dir as'/ home/oracle/expdp/'

Create a goldengate user and grant permissions:

Create user goldengate identified by goldengate

Grant connect,resource to goldengate

Grant delete any table to goldengate

Grant update any table to goldengate

Grant insert any table to goldengate

Grant select any table to goldengate

Grant SELECT ANY DICTIONARY to goldengate

-- enable checkpoint-based replication

Ggsic > dblogin userid goldengate,password goldengate

Edit param. / GLOBALS

Checkpointtable goldengate.checkpoint

Then save and exit.

Add checkpointtable goldengate.checkpoint

Ogg:

Main process configuration

Edit param mgr

PORT 7801

DYNAMICPORTLIST 7802-7820

Purgeoldextracts / home/oracle/ogg/dirdat/*/* USECHECKPOINTS,MINKEEPHOURS 10

AUTORESTART EXTRACT *, WAITMINUTES 2 Retries 5

Node one:

New extraction process:

Edit param ext-t1

Extract ext-t1

Userid goldengate,password goldengate

Exttrail / home/oracle/ogg/dirdat/scott/es

Dynamicresolution

WARNLONGTRANS 1h,CHECKINTERVAL 3m

Table scott.t1

Add process

Add extract ext-t1,tranlog,begin now

Add a local queue

Add exttrail / home/oracle/ogg/dirdat/scott/es,extract ext-t1, megabytes 1000

New delivery process:

Edit param pp-t1

Extract pp-t1

Userid goldengate, password goldengate

RMTHOST 172.18.0.139, MGRPORT 7801,COMPRESS

Rmttrail / home/oracle/ogg/dirdat/scott/t1

Dynamicresolution

Table scott.t1

Add process

Add extract pp-t1,exttrailsource / home/oracle/ogg/dirdat/scott/es, begin now

-- add a remote queue

Add rmttrail / home/oracle/ogg/dirdat/scott/t1, extract pp-t1,megabytes 1000

Node 2:

New extraction process:

Edit param ext-t2

Extract ext-t2

Userid goldengate,password goldengate

Exttrail / home/oracle/ogg/dirdat/scott/es

Dynamicresolution

WARNLONGTRANS 1h,CHECKINTERVAL 3m

Table scott.t2

Table scott.t3

Add process

Add extract ext-t2,tranlog,begin now

Add a local queue

Add exttrail / home/oracle/ogg/dirdat/scott/es,extract ext-t2, megabytes 1000

New delivery process:

Edit param pp-t2

Extract pp-t2

Userid goldengate, password goldengate

RMTHOST 172.18.0.139, MGRPORT 7801,COMPRESS

Rmttrail / home/oracle/ogg/dirdat/scott/t2

Dynamicresolution

Table scott.t2

Table scott.t3

Add process

Add extract pp-t2,exttrailsource / home/oracle/ogg/dirdat/scott/es, begin now

-- add a remote queue

Add rmttrail / home/oracle/ogg/dirdat/scott/t2, extract pp-t2,megabytes 1000

Destination side:

Add replication process 1:

Edit param rp-t1

Replicat rp-t1

Userid goldengate,password goldengate

Assumetargetdefs

HANDLECOLLISIONS

Reperror default,discard

Discardfile / home/oracle/ogg/dirdat/scott/t1.dsc,append,megabytes 1000

Map scott.t1, target scott.t1

New replication process:

Add replicat rp-t1,exttrail / home/oracle/ogg/dirdat/scott/t1,begin now,checkpointtable goldengate.checkpoint

Add replication process 2:

Edit param rp-t2

Replicat rp-t2

Userid goldengate,password goldengate

Assumetargetdefs

HANDLECOLLISIONS

Reperror default,discard

Discardfile / home/oracle/ogg/dirdat/scott/t2.dsc,append,megabytes 1000

Map scott.t2, target scott.t2

Map scott.t3, target scott.t3

New replication process:

Add replicat rp-t2,exttrail / home/oracle/ogg/dirdat/tbs01/t2,begin now,checkpointtable goldengate.checkpoint

Create a test table:

Create table scott.t1 as select * from scott.emp

Alter table scott.t1 add constraint t1_pk primary key (empno)

Create table scott.t2 as select * from scott.emp

Alter table scott.t2 add constraint t2_pk primary key (empno)

Create table scott.t3 as select * from scott.emp

Alter table scott.t3 add constraint t3_pk primary key (empno)

The target library establishes the corresponding table structure:

Create table scott.t1 as select * from scott.emp where 1: 2

Alter table scott.t1 add constraint t1_pk primary key (empno)

Create table scott.t2 as select * from scott.emp where 1: 2

Alter table scott.t2 add constraint t2_pk primary key (empno)

Create table scott.t3 as select * from scott.emp where 1: 2

Alter table scott.t3 add constraint t3_pk primary key (empno)

Expdp/impdp exports and imports test table data.

Start the process:

1. Start start mgr on each source side and destination side respectively

2. Start the extraction and delivery process at each source end

3. After the data is imported into the destination side, start the replication process on the destination side

4. Use info all to view the status of each process, which is normally running.

5. If there is an error, use view report + process name to check the error report and solve it.

Test: dml operation is performed on the source table to observe the data changes of the corresponding table on the target side. If the two ends are the same, the ogg is built successfully.

The above is how to configure ogg, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report