GoldenGate 配置

准备:两个已经有数据库的虚拟机,现在关闭状态

--源端数据库的操作
[[email protected] ~]# su - oracle
[[email protected] ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 19 13:54:26 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  417546240 bytes
Fixed Size                  2253824 bytes
Variable Size             331353088 bytes
Database Buffers           79691776 bytes
Redo Buffers                4247552 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

Database altered.

SQL> ALTER SYSTEM SWITCH LOGFILE;

System altered.

---安装GoldenGate(两台上做相同操作)
[[email protected] ~]# ls
anaconda-ks.cfg  Desktop  install.log.syslog  ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip
[[email protected] ~]# chown oracle.oinstall ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip
[[email protected] ~]# mv ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip /home/oracle/
[[email protected] ~]# su - oracle
[[email protected] ~]$ pwd  
/home/oracle
[[email protected] ~]$ mkdir ogg
[[email protected] ~]$ unzip ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip -d ogg/
Archive:  ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip
  inflating: ogg/fbo_ggs_Linux_x64_ora11g_64bit.tar 
  inflating: ogg/OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf 
  inflating: ogg/Oracle GoldenGate 11.2.1.0.1 README.txt 
  inflating: ogg/Oracle GoldenGate 11.2.1.0.1 README.doc 
[[email protected] ~]$ cd ogg
[[email protected] ogg]$ tar -xvf fbo_ggs_Linux_x64_ora11g_64bit.tar
UserExitExamples/
UserExitExamples/ExitDemo_more_recs/
UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.HPUX
UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.SOLARIS
UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.LINUX
UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.AIX
UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.vcproj
UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.c
UserExitExamples/ExitDemo_more_recs/readme.txt
UserExitExamples/ExitDemo_passthru/
UserExitExamples/ExitDemo_passthru/exitdemo_passthru.c
UserExitExamples/ExitDemo_passthru/exitdemopassthru.vcproj
UserExitExamples/ExitDemo_passthru/Makefile_passthru.HPUX
UserExitExamples/ExitDemo_passthru/Makefile_passthru.AIX
UserExitExamples/ExitDemo_passthru/Makefile_passthru.HP_OSS
UserExitExamples/ExitDemo_passthru/Makefile_passthru.LINUX
UserExitExamples/ExitDemo_passthru/readme.txt
UserExitExamples/ExitDemo_passthru/Makefile_passthru.SOLARIS
UserExitExamples/ExitDemo_lobs/
UserExitExamples/ExitDemo_lobs/exitdemo_lob.c
UserExitExamples/ExitDemo_lobs/Makefile_lob.HPUX
UserExitExamples/ExitDemo_lobs/Makefile_lob.SOLARIS
UserExitExamples/ExitDemo_lobs/Makefile_lob.AIX
UserExitExamples/ExitDemo_lobs/exitdemo_lob.vcproj
UserExitExamples/ExitDemo_lobs/Makefile_lob.LINUX
UserExitExamples/ExitDemo_lobs/readme.txt
UserExitExamples/ExitDemo_pk_befores/
UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.AIX
UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.LINUX
UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.c
UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.HPUX
UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.vcproj
UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.SOLARIS
UserExitExamples/ExitDemo_pk_befores/readme.txt
UserExitExamples/ExitDemo/
UserExitExamples/ExitDemo/exitdemo.vcproj
UserExitExamples/ExitDemo/Makefile_exit_demo.SOLARIS
UserExitExamples/ExitDemo/Makefile_exit_demo.HP_OSS
UserExitExamples/ExitDemo/exitdemo.c
UserExitExamples/ExitDemo/Makefile_exit_demo.LINUX
UserExitExamples/ExitDemo/exitdemo_utf16.c
UserExitExamples/ExitDemo/Makefile_exit_demo.HPUX
UserExitExamples/ExitDemo/Makefile_exit_demo.AIX
UserExitExamples/ExitDemo/readme.txt
bcpfmt.tpl
bcrypt.txt
cfg/
cfg/password.properties
cfg/MPMetadataSchema.xsd
cfg/jps-config-jse.xml
cfg/ProfileConfig.xml
cfg/mpmetadata.xml
cfg/Config.properties
chkpt_ora_create.sql
cobgen
convchk
db2cntl.tpl
ddl_cleartrace.sql
ddl_ddl2file.sql
ddl_disable.sql
ddl_enable.sql
ddl_filter.sql
ddl_nopurgeRecyclebin.sql
ddl_ora10.sql
ddl_ora10upCommon.sql
ddl_ora11.sql
ddl_ora9.sql
ddl_pin.sql
ddl_purgeRecyclebin.sql
ddl_remove.sql
ddl_session.sql
ddl_session1.sql
ddl_setup.sql
ddl_status.sql
ddl_staymetadata_off.sql
ddl_staymetadata_on.sql
ddl_trace_off.sql
ddl_trace_on.sql
ddl_tracelevel.sql
ddlcob
defgen
demo_more_ora_create.sql
demo_more_ora_insert.sql
demo_ora_create.sql
demo_ora_insert.sql
demo_ora_lob_create.sql
demo_ora_misc.sql
demo_ora_pk_befores_create.sql
demo_ora_pk_befores_insert.sql
demo_ora_pk_befores_updates.sql
dirjar/
dirjar/xmlparserv2.jar
dirjar/fmw_audit.jar
dirjar/jps-internal.jar
dirjar/org.springframework.jdbc-3.0.0.RELEASE.jar
dirjar/org.springframework.context-3.0.0.RELEASE.jar
dirjar/jps-upgrade.jar
dirjar/oraclepki.jar
dirjar/org.springframework.transaction-3.0.0.RELEASE.jar
dirjar/xstream-1.3.jar
dirjar/jsr250-api-1.0.jar
dirjar/org.springframework.beans-3.0.0.RELEASE.jar
dirjar/ldapjclnt11.jar
dirjar/spring-security-cas-client-3.0.1.RELEASE.jar
dirjar/jps-manifest.jar
dirjar/org.springframework.aspects-3.0.0.RELEASE.jar
dirjar/identityutils.jar
dirjar/org.springframework.aop-3.0.0.RELEASE.jar
dirjar/jacc-spi.jar
dirjar/jmxremote_optional-1.0-b02.jar
dirjar/slf4j-log4j12-1.4.3.jar
dirjar/jps-api.jar
dirjar/slf4j-api-1.4.3.jar
dirjar/identitystore.jar
dirjar/jps-unsupported-api.jar
dirjar/osdt_xmlsec.jar
dirjar/org.springframework.orm-3.0.0.RELEASE.jar
dirjar/jagent.jar
dirjar/commons-codec-1.3.jar
dirjar/jps-ee.jar
dirjar/spring-security-taglibs-3.0.1.RELEASE.jar
dirjar/log4j-1.2.15.jar
dirjar/osdt_core.jar
dirjar/spring-security-acl-3.0.1.RELEASE.jar
dirjar/xpp3_min-1.1.4c.jar
dirjar/spring-security-web-3.0.1.RELEASE.jar
dirjar/spring-security-core-3.0.1.RELEASE.jar
dirjar/spring-security-config-3.0.1.RELEASE.jar
dirjar/jps-mbeans.jar
dirjar/org.springframework.test-3.0.0.RELEASE.jar
dirjar/jdmkrt-1.0-b02.jar
dirjar/jps-common.jar
dirjar/org.springframework.web-3.0.0.RELEASE.jar
dirjar/jps-patching.jar
dirjar/jps-wls.jar
dirjar/commons-logging-1.0.4.jar
dirjar/org.springframework.expression-3.0.0.RELEASE.jar
dirjar/org.springframework.instrument-3.0.0.RELEASE.jar
dirjar/monitor-common.jar
dirjar/osdt_cert.jar
dirjar/org.springframework.asm-3.0.0.RELEASE.jar
dirjar/org.springframework.context.support-3.0.0.RELEASE.jar
dirjar/org.springframework.core-3.0.0.RELEASE.jar
dirprm/
dirprm/jagent.prm
emsclnt
extract
freeBSD.txt
ggMessage.dat
ggcmd
ggsci
help.txt
jagent.sh
keygen
libantlr3c.so
libdb-5.2.so
libgglog.so
libggrepo.so
libicudata.so.38
libicui18n.so.38
libicuuc.so.38
libxerces-c.so.28
libxml2.txt
logdump
marker_remove.sql
marker_setup.sql
marker_status.sql
mgr
notices.txt
oggerr
params.sql
prvtclkm.plb
pw_agent_util.sh
remove_seq.sql
replicat
retrace
reverse
role_setup.sql
sequence.sql
server
sqlldr.tpl
tcperrs
ucharset.h
ulg.sql
usrdecs.h
zlib.txt
[[email protected] ogg]$ cd
[[email protected] ~]$ vi .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
# Oracle configure profile parameters success
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.0.2/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=lsora
export ORACLE_TERM=vt100
export THREADS_FLAG=native
export LD_LIBRARY_PATH=/home/oracle/ogg/:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH:/home/oracle/ogg
#
# change this NLS settings to suit your country:
# example:
# german_germany.we8iso8859p15, american_america.we8iso8859p2 etc.
#
export LANG=en_US
~

~
".bashrc" 24L, 672C written                                                                                                                                                      
[[email protected] ~]$ cd ogg
[[email protected] ogg]$ ggsci
-bash: ggsci: command not found
[[email protected] ogg]$ cd
[[email protected] ~]$ source .bashrc
[[email protected] ~]$ cd ogg
[[email protected] ogg]$ 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 (localhost.localdomain) 1> create subdirs

Creating subdirectories under current directory /home/oracle/ogg

Parameter files                /home/oracle/ogg/dirprm: already exists
Report files                   /home/oracle/ogg/dirrpt: created
Checkpoint files               /home/oracle/ogg/dirchk: created
Process status files           /home/oracle/ogg/dirpcs: created
SQL script files               /home/oracle/ogg/dirsql: created
Database definitions files     /home/oracle/ogg/dirdef: created
Extract data files             /home/oracle/ogg/dirdat: created
Temporary files                /home/oracle/ogg/dirtmp: created
Stdout files                   /home/oracle/ogg/dirout: created

GGSCI (localhost.localdomain) 2> EDIT PARAMS MGR
-- This is the  minimal configuration of Manager
PORT 7809
~
~

~
"dirprm/mgr.prm" [New] 2L, 60C written

GGSCI (localhost.localdomain) 3> start mgr

Manager started.

--准备用户及数据
[[email protected] ~]$ cd ogg
[[email protected] ogg]$ pwd               
/home/oracle/ogg
[[email protected] ogg]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 19 14:40:41 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter user scott account unlock;

User altered.

SQL> grant resource,connect to scott;

Grant succeeded.

SQL> grant select any dictionary to scott;

Grant succeeded.

SQL> conn scott/tiger
ERROR:
ORA-28001: the password has expired

Changing password for scott
New password:
Retype new password:
Password changed
Connected.
SQL> @demo_ora_create.sql
DROP TABLE tcustmer
           *
ERROR at line 1:
ORA-00942: table or view does not exist

Table created.

DROP TABLE tcustord
           *
ERROR at line 1:
ORA-00942: table or view does not exist

Table created.

SQL> @demo_ora_insert.sql

1 row created.

1 row created.

1 row created.

1 row created.

Commit complete.

SQL> conn /as sysdba
Connected.
SQL> alter user system identified by oracle;

User altered.

--在源库为需要同步的表,添加附加日志
GGSCI (localhost.localdomain) 4> dblogin userid scott, password tiger
Successfully logged into database.

GGSCI (localhost.localdomain) 5> add trandata scott.tcustmer

Logging of supplemental redo data enabled for table SCOTT.TCUSTMER.

GGSCI (localhost.localdomain) 6> add trandata scott.tcustord

Logging of supplemental redo data enabled for table SCOTT.TCUSTORD.

---初始化加载数据
 --源端:
GGSCI (localhost.localdomain) 8> ADD EXTRACT EINILOAD, SOURCEISTABLE
EXTRACT added.

GGSCI (localhost.localdomain) 9> edit params EINILOAD
--
-- GoldenGate Initial Data Capture
-- for TCUSTMER and TCUSTORD
--
EXTRACT EINILOAD
USERID system, PASSWORD "oracle"
RMTHOST 192.168.190.201, MGRPORT 7809
RMTTASK REPLICAT, GROUP RINILOAD
TABLE SCOTT.TCUSTMER;
TABLE SCOTT.TCUSTORD;
--目标端:

GGSCI (localhost.localdomain) 1> ADD REPLICAT RINILOAD, SPECIALRUN
REPLICAT added.

GGSCI (localhost.localdomain) 2> edit params riniload
--
-- GoldenGate Initial Load Delivery
--
REPLICAT RINILOAD
ASSUMETARGETDEFS
USERID system, PASSWORD "oracle"
DISCARDFILE ./dirrpt/RINILOAD.dsc, PURGE
MAP scott.*, TARGET scott.*;
--启动:
start extract einiload
--成功

----配置数据实时同步
--源端:
GGSCI (localhost.localdomain) 12> ADD EXTRACT EORAKK, TRANLOG, BEGIN NOW, THREADS 1
EXTRACT added.

GGSCI (localhost.localdomain) 13> EDIT PARAMS EORAKK
--
-- Change Capture parameter file to capture
-- TCUSTMER and TCUSTORD Changes
--
EXTRACT EORAKK
USERID system, PASSWORD oracle
RMTHOST 192.168.190.201, MGRPORT 7809
RMTTRAIL ./dirdat/KK
TABLE SCOTT.TCUSTMER;
TABLE SCOTT.TCUSTORD;
~
~
~
"dirprm/eorakk.prm" [New] 10L, 232C written

GGSCI (localhost.localdomain) 14> ADD RMTTRAIL ./dirdat/KK, EXTRACT EORAKK, MEGABYTES 5
RMTTRAIL added.

GGSCI (localhost.localdomain) 15> start extract eorakk

Sending START request to MANAGER ...
EXTRACT EORAKK starting
--目标端:
GGSCI (localhost.localdomain) 3> EDIT PARAMS ./GLOBALS
CHECKPOINTTABLE system.ggschkpt
~

~
"./GLOBALS" [New] 1L, 33C written

GGSCI (localhost.localdomain) 4> DBLOGIN USERID system, PASSWORD oracle
Successfully logged into database.

GGSCI (localhost.localdomain) 5> ADD CHECKPOINTTABLE
ERROR: Missing checkpoint table specification.

GGSCI (localhost.localdomain) 6> exit
[[email protected] ogg]$ 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 (localhost.localdomain) 1> DBLOGIN USERID system, PASSWORD oracle
Successfully logged into database.

GGSCI (localhost.localdomain) 2> ADD CHECKPOINTTABLE

No checkpoint table specified, using GLOBALS specification (system.ggschkpt)...

Successfully created checkpoint table system.ggschkpt.

GGSCI (localhost.localdomain) 3> ADD REPLICAT RORAKK, EXTTRAIL ./dirdat/KK
REPLICAT added.

GGSCI (localhost.localdomain) 4> EDIT PARAMS RORAKK
--
-- Change Delivery parameter file to apply
-- TCUSTMER and TCUSTORD Changes
--
REPLICAT RORAKK
USERID system, PASSWORD oracle
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAKK.DSC, PURGE
MAP scott.tcustmer, TARGET scott.tcustmer;
MAP scott.tcustord, TARGET scott.tcustord;

~

~
"dirprm/rorakk.prm" [New] 12L, 290C written

GGSCI (localhost.localdomain) 5> start replicat rorakk

Sending START request to MANAGER ...
REPLICAT RORAKK starting

---成功

时间: 2024-10-03 13:38:53

GoldenGate 配置的相关文章

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 Set ZHS16GBK ZHS16GBK OR

GoldenGate配置(三)之DDL复制配置

[说明] 此篇续接上一篇:"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配置(四)之veridata配置

GoldenGate配置(四)之veridata配置 环境: 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

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 List

GoldenGate 配置extract,replicat进程自启动

在GoldenGate中主进程是manager进程,使用start mgr启动.可以在mgr进程中添加一些参数用来在启动mgr进程的同时启动extract和replicat进程 GGSCI (gg01) 130> VIEW params mgr --mgr主进程端口号 PORT 7809 --动态端口,当指定端口不可用时,会从以下列表中选择一个可用端口 DYNAMICPORTLIST 7800-7909 --启动mgr进程启动启动extract进程 AUTOSTART EXTRACT * --当

Goldengate常用命令

1.Goldengate的起停 启动goldengate a> 启动goldengate时最好先从target节点开始,然后是source节点.否则data pump进程可能会由于没有收到target端的响应而异常退出. b> manager进程是其他进程的管理程序,需要先启动.如果manager配置参数中设置了AUTOSTART参数,则可由manager进程自动启动其他进程. 例如: log in target server: cd <$GG_HOME> ggsci GGSCI&

使用 Oracle GoldenGate 在 Microsoft SQL Server 和 Oracle Database 之间复制事务

使用 Oracle GoldenGate 在 Microsoft SQL Server 和 Oracle Database 之间复制事务 作者:Nikolay Manchev 分步构建一个跨这些平台的简单事务复制示例. 2011 年 8 月发布 大多数关注数据复制的 Oracle 技术专家都熟悉 Oracle Streams.在 2009 年之前,Streams 一直是推荐使用的最流行的 Oracle 数据分发技术. 2009 年 7 月,Oracle 收购了 GoldenGate 这一数据库复

使用Goldengate同步异构数据库之Kafka中间件

收到业务部门需求,要求将Oracle数据库某表同步至Mysql数据库中,异构环境我们用kafka来实现,下面是具体的一些配置: 由于业务需要,现申请使用架构组数据同步服务同步以下数据到管家MySQL数据库 代理商用户数据:a. 数据源:SSP库 AAA.system_userb. 数据目标:MySQL DLS库 DLS_SYSTEM_USERc. 同步逻辑: 无d. 同步数据及对应关系:参见附件e. 是否涉及敏感信息:否 准备工作:由于目标库Mysql库该表已经存在,我们将该表备份并且获取建表语

OGG安装配置详细步骤--介绍

1.安装GoldenGate 每个GoldenGate实例可支持5000个Extract和Replicat进程 每个Extract和Replicat需要25-50M或更多的内存,这取决于系统的事物量和事物大小 GoldenGate实际使用的物理内存由操作系统控制和管理,GoladenGate 缓存管理器利用操作系统内存管理功能的优势,确保GoladenGate进程持续和有效的工作 1.1Manager Manager进程必须在源端和目标端运行,并且在Extract和Replicat进程之前启动,