GoldenGate配置(二)之双向复制配置
GoldenGate配置(二)之双向复制配置 环境: Item Source System Target System Platform Red Hat Enterprise Linux Server release 5.4 Red Hat Enterprise Linux Server release 5.4 Hostname gc1 gc2 Database Oracle 10.2.0.1 Oracle 11.2.0.1 Character
GoldenGate配置(二)之双向复制配置
环境:
Item |
Source System |
Target System |
Platform |
Red Hat Enterprise Linux Server release 5.4 |
Red Hat Enterprise Linux Server release 5.4 |
Hostname |
gc1 |
gc2 |
Database |
Oracle 10.2.0.1 |
Oracle 11.2.0.1 |
Character Set |
ZHS16GBK |
ZHS16GBK |
ORACLE_SID |
PROD |
EMREP |
Listener Name/Port |
LISTENER/1521 |
LISTENER/1521 |
Goldengate User |
ogg |
ogg |
双向复制配置
说明:此篇续接第一篇“GoldenGate配置(一)之单向复制配置”之后继续进行配置关于上一篇,GoldenGate配置(一)之单向复制配置:点击打开链接双向复制配置操作:
gc2:授权
SQL>grant CONNECT, RESOURCE to ogg;
SQL>grant CREATE SESSION, ALTER SESSION to ogg;
SQL>grant SELECT ANY DICTIONARY, SELECT ANY TABLE to ogg;
SQL>grant ALTER ANY TABLE to ogg;
SQL>grant FLASHBACK ANY TABLE to ogg;
SQL>grant EXECUTE on DBMS_FLASHBACK to ogg;
gc1:授权
SQL>grant CONNECT, RESOURCE to ogg;
SQL>grant CREATE SESSION, ALTER SESSION to ogg;
SQL>grant SELECT ANY DICTIONARY, SELECT ANY TABLE to ogg;
SQL>grant CREATE TABLE to ogg;
SQL>grant INSERT, UPDATE, DELETE on scott.tcustmer to ogg;--把需要同步表的DML操作授权给ogg
SQL>grant INSERT, UPDATE, DELETE on scott.tcustord to ogg;--把需要同步表的DML操作授权给ogg
gc2:开启补充日志
SQL>alter database add supplemental log data;
SQL>alter system switch logfile;
SQL>alter database force logging;
gc2:测试表添加到补充日志
GGSCI(gc2) 1> DBLOGIN USERID ogg, PASSWORD Ogg
Successfully logged into database.
GGSCI(gc2) 2> ADD TRANDATA scott.TCUSTMER
Logging of supplemental redo data enabled fortable SCOTT.TCUSTMER.
GGSCI(gc2) 3> ADD TRANDATA scott.TCUSTORD
Logging of supplemental redo data enabled fortable SCOTT.TCUSTORD.
gc2:配置Extract进程
GGSCI(gc2) 4> EDIT PARAMS EORA_1
-- Change Capture parameter file to capture
-- TCUSTMER and TCUSTORD changes
EXTRACT EORA_1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg, PASSWORD Ogg
TRANLOGOPTIONS EXCLUDEUSER ogg
EXTTRAIL ./dirdat/aa
TABLE scott.TCUSTMER;
TABLE scott.TCUSTORD;
~
~
"dirprm/eora_1.prm" [New] 9L, 257Cwritten
GGSCI(gc2) 5> ADD EXTRACT EORA_1, TRANLOG, BEGIN NOW
EXTRACT added.
GGSCI(gc2) 6> ADD EXTTRAIL ./dirdat/aa, EXTRACT EORA_1, MEGABYTES 5
EXTTRAIL added.
GGSCI(gc2) 7> START EXTRACT EORA_1
Sending START request to MANAGER ...
EXTRACT EORA_1 starting
GGSCI(gc2) 8> INFO EXTRACT EORA_1
EXTRACT EORA_1 Last Started 2014-06-1811:28 Status RUNNING
Checkpoint Lag 00:00:19 (updated 00:00:08 ago)
Log Read Checkpoint Oracle Redo Logs
2014-06-18 11:27:42 Seqno 6, RBA 35344
gc2:配置Pump进程
GGSCI(gc2) 9> EDIT PARAMS PORA_1
添加以下内容:
-- Data Pump parameter file to read thelocal
-- trail of TCUSTMER and TCUSTORDchanges
--
EXTRACT PORA_1
SETENV(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
PASSTHRU
RMTHOST gc1, MGRPORT 7809
RMTTRAIL ./dirdat/pa
TABLE scott.TCUSTMER;
TABLE scott.TCUSTORD;
~
~
~
"dirprm/pora_1.prm" [New] 10L, 250Cwritten
GGSCI(gc2) 10> ADD EXTRACT PORA_1, EXTTRAILSOURCE ./dirdat/aa
EXTRACT added.
GGSCI(gc2) 11> ADD RMTTRAIL ./dirdat/pa, EXTRACT PORA_1, MEGABYTES 5
RMTTRAIL added.
GGSCI(gc2) 12> START EXTRACT PORA_1
Sending START request to MANAGER ...
EXTRACT PORA_1 starting
gc1:配置Replicat进程
GGSCI(gc1) 1> EDIT PARAMS ./GLOBALS
CHECKPOINTTABLE ogg.ggschkpt
~
~
"./GLOBALS" [New] 1L, 29C written
GGSCI(gc1) 2> quit
[oracle@gc1ogg]$ ll GLOBALS --验证
-rw-rw-rw- 1 oracle oinstall 29 Jun 18 11:33GLOBALS
GGSCI(gc1) 1> DBLOGIN USERID ogg, PASSWORD Ogg
Successfully logged into database.
GGSCI(gc1) 2> ADD CHECKPOINTTABLE
No checkpoint table specified, using GLOBALSspecification (ogg.ggschkpt)...
Successfully created checkpoint tableOGG.GGSCHKPT.
gc1:配置Replicate进程
GGSCI(gc1) 3> EDIT PARAM RORA_1
--
-- Change Delivery parameter file to apply
-- TCUSTMER and TCUSTORD Changes
--
REPLICAT RORA_1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg, PASSWORD Ogg
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORA_aa.DSC, PURGE
MAP scott.tcustmer, TARGET scott.tcustmer;
MAP scott.tcustord, TARGET scott.tcustord;
~
~
"dirprm/rora_1.prm" [New] 12L, 327Cwritten
GGSCI(gc1) 4> ADD REPLICAT RORA_1, EXTTRAIL ./dirdat/pa
REPLICAT added.
GGSCI(gc1) 5> START REPLICAT RORA_1
Sending START request to MANAGER ...
REPLICAT RORA_1 starting
gc1:查看进程状态
GGSCI(gc1) 6> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORA_1 00:00:00 00:00:08
EXTRACT RUNNING PORA_1 00:00:00 00:00:01
REPLICAT RUNNING RORA_1 00:00:00 00:00:06
gc2:查看进程状态
GGSCI(gc2) 13> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORA_1 00:00:00 00:00:09
EXTRACT RUNNING PORA_1 00:00:00 00:00:06
REPLICAT RUNNING RORA_1 00:00:00 00:00:01
验证insert操作双向同步
gc1: gc1→gc2,DML操作:insert操作
SQL>insert into tcustmer VALUES('HYL','HUANG DBA.','HARBIN','CN');
1 row created.
SQL>commit;
Commit complete.
gc2:验证insert操作同步
SQL>select * from tcustmer;
CUST NAME CITY ST
---- -------------------------------------------------- --
HYL HUANGDBA. HARBIN CN
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
gc2:gc2→gc1,DML操作:insert操作
SQL>insert into tcustmer VALUES('WT','WANGDBA.','QINGDAO','CN');
1 row created.
SQL>commit;
Commit complete.
gc1:gc1→gc2,DML操作:update操作
SQL>select * from tcustmer;
CUST NAME CITY ST
---- -------------------------------------------------- --
HYL HUANGDBA. HARBIN CN
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
WT WANGDBA. QINGDAO CN
gc1:update操作
SQL>update tcustmer set city = 'BEIJING', state = 'CN' wherecust_code='HYL';
1 row updated.
SQL>commit;
Commit complete.
gc2:验证update操作同步
SQL>select * from tcustmer;
CUST NAME CITY ST
---- ------------------------------ ----------------------
HYL HUANGDBA. BEIJING CN
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
WT WANGDBA. QINGDAO CN
gc2:gc2→gc1,DML操作:update操作
SQL>update tcustmer set city = 'BEIJING', state = 'CN' wherecust_code='WT';
1 row updated.
SQL>commit;
Commit complete.
gc1:验证update操作同步
SQL>select * from tcustmer;
CUST NAME CITY ST
---- -------------------------------------------------- --
HYL HUANGDBA. BEIJING CN
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
WT WANGDBA. BEIJING CN
gc1:gc1→gc2,DML操作:delete操作
SQL>delete from tcustmer where CUST_CODE='WT';
1 row deleted.
SQL>commit;
Commit complete.
gc2:验证delete操作同步
SQL>select * from tcustmer;
CUST NAME CITY ST
---- -------------------------------------------------- --
HYL HUANGDBA. BEIJING CN
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
gc2:gc2→gc1,DML操作:delete操作
SQL>delete from tcustmer where CUST_CODE='HYL';
1 row deleted.
SQL>commit;
Commit complete.
gc1:验证delete操作同步
SQL>select * from TCUSTMER;
CUST NAME CITY ST
---- -------------------------------------------------- --
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
--至此,GoldenGate双向同步复制完成
声明:
原创作品,出自 “深蓝的blog” 博客,允许转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。
关于涉及版权事宜,作者有权追究法律责任。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

PyCharm is a powerful integrated development environment (IDE), and PyTorch is a popular open source framework in the field of deep learning. In the field of machine learning and deep learning, using PyCharm and PyTorch for development can greatly improve development efficiency and code quality. This article will introduce in detail how to install and configure PyTorch in PyCharm, and attach specific code examples to help readers better utilize the powerful functions of these two. Step 1: Install PyCharm and Python

We users should be able to understand the diversity of some functions when using this platform. We know that the lyrics of some songs are very well written. Sometimes we even listen to it several times and feel that the meaning is very profound. So if we want to understand the meaning of it, we want to copy it directly and use it as copywriting. However, if we want to use it, we still need to You just need to learn how to copy lyrics. I believe that everyone is familiar with these operations, but it is indeed a bit difficult to operate on a mobile phone. So in order to give you a better understanding, today the editor is here to help you. A good explanation of some of the above operating experiences. If you also like it, come and take a look with the editor. Don’t miss it.

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

How to configure a workgroup in Win11 A workgroup is a way to connect multiple computers in a local area network, which allows files, printers, and other resources to be shared between computers. In Win11 system, configuring a workgroup is very simple, just follow the steps below. Step 1: Open the "Settings" application. First, click the "Start" button of the Win11 system, and then select the "Settings" application in the pop-up menu. You can also use the shortcut "Win+I" to open "Settings". Step 2: Select "System" In the Settings app, you will see multiple options. Please click the "System" option to enter the system settings page. Step 3: Select "About" In the "System" settings page, you will see multiple sub-options. Please click

Title: How to configure and install FTPS in Linux system, specific code examples are required. In Linux system, FTPS is a secure file transfer protocol. Compared with FTP, FTPS encrypts the transmitted data through TLS/SSL protocol, which improves Security of data transmission. In this article, we will introduce how to configure and install FTPS in a Linux system and provide specific code examples. Step 1: Install vsftpd Open the terminal and enter the following command to install vsftpd: sudo

In the PS copy layer shortcut keys, we can know that if you want to copy a layer when using PS, you can use the shortcut key [Ctrl+J] for quick copying. This introduction to the shortcut keys for copying layers can tell you the specific operation method. The following is the detailed content, so take a look. PS copy layer shortcut key answer: [Ctrl+J] Specific method: 1. Open the image in PS and select the layer that needs to be copied. 2. Press [Ctrl+J] on the keyboard at the same time to complete the copy of the layer. Other copying methods: 1. After opening the image, press and hold the layer and move the [New Layer] icon downwards. 2. After moving to the icon, let go. 3. The layer copy is completed.

DRBD (DistributedReplicatedBlockDevice) is an open source solution for achieving data redundancy and high availability. Here is the tutorial to install and configure DRBD on CentOS7 system: Install DRBD: Open a terminal and log in to the CentOS7 system as administrator. Run the following command to install the DRBD package: sudoyuminstalldrbd Configure DRBD: Edit the DRBD configuration file (usually located in the /etc/drbd.d directory) to configure the settings for DRBD resources. For example, you can define the IP addresses, ports, and devices of the primary node and backup node. Make sure there is a network connection between the primary node and the backup node.
