GoldenGate的安裝、配置與測試
環境:Oracle Linux 5.8/Windows Server 2003 + Oracle Database 11.2.0.4 + Golengate 11.2
解壓安裝檔案裡的內容到/opt/goldengate,然後建立工作目錄:
在Windows環境下,需要將manager程式新增到Windows服務,否則登出後程式就會退出
--如果要刪除服務,進入根目錄後
C:\goldengate>install deleteevents deleteservice
Service 'GGMGR' removed.
Install program terminated normally.
二、資料庫設定
資料庫要設定為歸檔模式、並開啟資料庫級別的補充日誌,以及設定啟用GoldenGate複製的引數
建立使用者並賦予許可權:
在trandata新增需要同步的表和schema
源端進入GGSCI
目標端新增checkpoint表
三、 GG程式
編輯並啟動源端Manager程式
配置Extract程式組
建立名為eora的Extract程式組
源端配置Pump程式組
配置目的端MGR
配置目的端Replicate程式
程式狀態不正常時,檢視錯誤日誌,檔名是ggserr.log,在程式根目錄下。
解壓安裝檔案裡的內容到/opt/goldengate,然後建立工作目錄:
點選(此處)摺疊或開啟
-
[oracle@oltp ~]$ cd /opt/goldengate/
-
[oracle@oltp goldengate]$ ggsci
-
-
Oracle GoldenGate Command Interpreter for Oracle
-
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
-
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
-
-
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
-
-
-
-
GGSCI (oltp.demo.com) 1> create subdirs
-
-
Creating subdirectories under current directory /opt/goldengate
-
-
Parameter files /opt/goldengate/dirprm: already exists
-
Report files /opt/goldengate/dirrpt: created
-
Checkpoint files /opt/goldengate/dirchk: created
-
Process status files /opt/goldengate/dirpcs: created
-
SQL script files /opt/goldengate/dirsql: created
-
Database definitions files /opt/goldengate/dirdef: created
-
Extract data files /opt/goldengate/dirdat: created
-
Temporary files /opt/goldengate/dirtmp: created
- Stdout files /opt/goldengate/dirout: created
在Windows環境下,需要將manager程式新增到Windows服務,否則登出後程式就會退出
點選(此處)摺疊或開啟
-
GGSCI (hum-cf0bf98919e) 2> EDIT PARAMS ./GLOBALS
- --編輯以下文字
- MGRSERVNAME GGMGR
-
-
GGSCI (hum-cf0bf98919e) 4> exit
-
-
C:\goldengate>install addservice
-
-
Service 'GGMGR' created.
-
-
- Install program terminated normally.
--如果要刪除服務,進入根目錄後
C:\goldengate>install deleteevents deleteservice
Service 'GGMGR' removed.
Install program terminated normally.
二、資料庫設定
資料庫要設定為歸檔模式、並開啟資料庫級別的補充日誌,以及設定啟用GoldenGate複製的引數
點選(此處)摺疊或開啟
-
SQL> select supplemental_log_data_min from v$database;
-
-
SUPPLEMENTAL_LOG
-
----------------
-
NO
-
-
SQL> alter database add supplemental log data;
-
-
Database altered.
-
-
SQL> select supplemental_log_data_min from v$database;
-
-
SUPPLEMENTAL_LOG
-
----------------
- YES
--以下引數在11.2.1.0.26下必須改,否則extract程式無法啟動
-
SQL> alter system set enable_goldengate_replication=TRUE scope=both;
System altered.
點選(此處)摺疊或開啟
- --建立專屬表空間
- create tablespace ogg datafile size 100M autoextend on;
-
--源和目的都執行
-
create user ggs identified by ggs default tablespace ogg temporary tablespace temp;
-
grant connect, resource, unlimited tablespace to ggs;
-
grant execute on utl_file to ggs;
-
-
--源端執行
-
grant connect,resource to ggs;
-
grant select any dictionary,select any table to ggs;
-
grant alter any table to ggs;
-
grant flashback any table to ggs;
-
grant execute on DBMS_FLASHBACK to ggs;
-
-
--目的端執行
-
grant insert any table to ggs;
-
grant delete any table to ggs;
-
grant update any table to ggs;
-
-
--如果不講究,可以直接給DBA許可權
- grant dba to ggs;
源端進入GGSCI
點選(此處)摺疊或開啟
- dblogin userid ggs,password ggs
-
GGSCI (oltp.demo.com) 3> add trandata soe.*
2015-01-26 21:43:25 WARNING OGG-00869 No unique key is defined for table 'ADDRESSES'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.ADDRESSES.
2015-01-26 21:43:27 WARNING OGG-00869 No unique key is defined for table 'CARD_DETAILS'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.CARD_DETAILS.
2015-01-26 21:43:28 WARNING OGG-00869 No unique key is defined for table 'CUSTOMERS'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.CUSTOMERS.
2015-01-26 21:43:28 WARNING OGG-00869 No unique key is defined for table 'INVENTORIES'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.INVENTORIES.
2015-01-26 21:43:28 WARNING OGG-00869 No unique key is defined for table 'LOGON'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.LOGON.
2015-01-26 21:43:28 WARNING OGG-00869 No unique key is defined for table 'ORDERENTRY_METADATA'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.ORDERENTRY_METADATA.
2015-01-26 21:43:28 WARNING OGG-00869 No unique key is defined for table 'ORDERS'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.ORDERS.
2015-01-26 21:43:28 WARNING OGG-00869 No unique key is defined for table 'ORDER_ITEMS'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.ORDER_ITEMS.
Logging of supplemental redo data enabled for table SOE.PRODUCT_DESCRIPTIONS.
Logging of supplemental redo data enabled for table SOE.PRODUCT_INFORMATION.
2015-01-26 21:43:28 WARNING OGG-00869 No unique key is defined for table 'WAREHOUSES'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Logging of supplemental redo data enabled for table SOE.WAREHOUSES.
點選(此處)摺疊或開啟
-
GGSCI (hum-cf0bf98919e) 1> edit params ./GLOBALS
-
-
--新增一行
-
checkpointtable ggs.checkpoint
-
-
GGSCI (hum-cf0bf98919e) 2> dblogin userid ggs,password ggs
-
Successfully logged into database.
-
-
GGSCI (hum-cf0bf98919e) 3> add checkpointtable ggs.checkpoint
-
-
Successfully created checkpoint table ggs.checkpoint.
-
- GGSCI (hum-cf0bf98919e) 4>
三、 GG程式
編輯並啟動源端Manager程式
點選(此處)摺疊或開啟
-
GGSCI (oltp.demo.com) 5> edit params mgr
-
port 7500
-
dynamicportlist 7501-7505
-
autorestart extract *,waitminutes 2,retries 5
-
-
GGSCI (oltp.demo.com) 6> view params mgr
-
-
port 7500
-
dynamicportlist 7501-7505
-
autorestart extract *,waitminutes 2,retries 5
-
-
-
GGSCI (oltp.demo.com) 7> start mgr
-
- Manager started.
建立名為eora的Extract程式組
點選(此處)摺疊或開啟
-
GGSCI (oltp.demo.com) 8> edit params eora
-
extract eora
-
dynamicresolution
-
userid ggs,password ggs
-
exttrail /opt/goldengate/dirdat/et
-
table soe.*;
-
-
GGSCI (oltp.demo.com) 9> add extract eora,tranlog,begin now
- EXTRACT added.
-
-
GGSCI (oltp.demo.com) 11> add exttrail /opt/goldengate/dirdat/et,extract eora
- EXTTRAIL added.
-
GGSCI (oltp.demo.com) 12> start extract eora
Sending START request to MANAGER ...
EXTRACT EORA starting
點選(此處)摺疊或開啟
-
GGSCI (oltp.demo.com) 19> edit params pump_so
-
extract pump_so
-
dynamicresolution
-
passthru
-
rmthost 192.168.226.13,mgrport 7809,compress
-
rmttrail C:\goldengate\dirdat\pt
-
table soe.*;
-
-
GGSCI (oltp.demo.com) 20> add extract pump_so,exttrailsource /opt/goldengate/dirdat/et
-
EXTRACT added.
-
-
-
GGSCI (oltp.demo.com) 21> add rmttrail C:\goldengate\dirdat\pt,extract pump_so
- RMTTRAIL added.
-
GGSCI (oltp.demo.com) 24> start pump_so
Sending START request to MANAGER ...
EXTRACT PUMP_SO starting
GGSCI (oltp.demo.com) 25> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORA 00:00:00 00:00:08
EXTRACT RUNNING PUMP_SO 00:00:00 00:21:32
配置目的端MGR
點選(此處)摺疊或開啟
-
GGSCI (hum-cf0bf98919e) 5> view params mgr
-
port 7809
-
dynamicportlist 7800-8000
-
autostart er *
-
autorestart extract *,waitminutes 2,retries 5
-
lagreporthours 1
-
laginfominutes 3
-
lagcriticalminutes 5
-
purgeoldextracts c:\goldengate\dirdat\rt*,usecheckpoints,minkeepdays 3
-
-
-
GGSCI (hum-cf0bf98919e) 6> start mgr
-
-
Starting Manager as service ('GGMGR')...
-
Service started.
-
-
-
GGSCI (hum-cf0bf98919e) 7> info all
-
-
Program Status Group Lag at Chkpt Time Since Chkpt
-
- MANAGER RUNNING
點選(此處)摺疊或開啟
-
GGSCI (hum-cf0bf98919e) 8> edit params repl
-
-
-
GGSCI (hum-cf0bf98919e) 9> view params repl
-
replicat repl
-
userid ggs, password ggs
-
assumetargetdefs
-
reperror default,discard
-
discardfile ./dirrpt/repl.dsc,append,megabytes 50
-
dynamicresolution
-
map soe.*, target soe.*;
-
- GGSCI (hum-cf0bf98919e) 11> add replicat repl,exttrail c:\goldengate\dirdat\pt checkpointtable ggs.checkpoint
- REPLICAT added.
-
-
GGSCI (hum-cf0bf98919e) 12> start repl
Sending START request to MANAGER ('GGMGR') ...
REPLICAT REPL starting
程式狀態不正常時,檢視錯誤日誌,檔名是ggserr.log,在程式根目錄下。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22621861/viewspace-1416225/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 安裝與配置MySQL,phpmyAdmin;安裝與測試PHPLIB (轉)MySqlPHP
- 【GoldenGate】Oracle GoldenGate Veridata 安裝配置與應用GoOracle
- 【GoldenGate】Oracle GoldenGate(一) 安裝與DML單向同步配置GoOracle
- Oracle goldengate 安裝配置OracleGo
- 安裝並配置goldengateGo
- GoldenGate for win安裝配置Go
- vue測試安裝和配置Vue
- app的安裝與解除安裝測試點APP
- Pig 的安裝與測試
- 介面測試:postman的安裝與使用Postman
- 1. mysql的安裝與測試MySql
- GOLDENGATE安裝和配置手冊Go
- Jmeter下載安裝配置---測試小白JMeter
- 【STATSPACK】Statspack安裝、測試與使用
- Windows下的Memcache安裝與測試教程Windows
- 解除安裝goldengate相關配置資訊Go
- goldengate的sqlexec測試GoSQL
- 硬碟測試軟體IOMETER安裝配置指南硬碟
- 本地windows搭建spark環境,安裝與詳細配置(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)WindowsSparkJDKHadoop
- windows下openldap的安裝與java操作測試WindowsLDAJava
- GOLDENGATE安裝和配置手冊總結Go
- centos7 (阿里雲、linux) 單機spark的安裝與配置詳解(jdk安裝與配置,scala安裝與配置,hadoop安裝與配置,spark安裝與配置)CentOS阿里LinuxSparkJDKHadoop
- 安裝GoldenGateGo
- 【實驗】【STATSPACK】Statspack 安裝、測試與使用
- Hive的安裝與配置Hive
- PG的安裝與配置
- yum的安裝與配置
- Redis的安裝與配置Redis
- Vue的安裝與配置Vue
- kaldi 的安裝及測試
- 安裝測試kafkaKafka
- memcached安裝測試
- mq安裝測試MQ
- sqlserver 安裝測試SQLServer
- GoldenGate抽取Informix資料庫安裝及配置GoORM資料庫
- 安裝配置Oracle GoldenGate for DB2(單向)OracleGoDB2
- Goldengate Veridata 11.2 for linux安裝配置GoLinux
- hadoop單機安裝配置及測試通過Hadoop