OGG从入门到高可用系列

0    557    1

Tags:

👉 本文共约70987个字,系统预计阅读时间或需267分钟。

【OGG】OGG的下载和安装篇

实验环境介绍

11.2.0.3 RHEL6.5

本文简介

有个同事喊我解决OGG不能同步的问题,汗颜啊,我也就之前学过安装和简单的配置,当时是成功的,结果帮同事搭建的时候数据死活不能同步。于是下决心这几天好好再研究一下OGG的内容。

OGG安装

在Linux上安装OGG很简单,总体分为以下几个部分:

  1. Downloading Oracle GoldenGate software.
  2. Setting ORACLE_HOME and ORACLE_SID
  3. Setting library paths for dynamic builds
  4. Installing the Oracle GoldenGate software

Downloading Oracle GoldenGate software.

第一步,下载gg软件,可以有2种途径直接下载

第一种: http://edelivery.oracle.com

1. On a browser, go to http://edelivery.oracle.com

2. Welcome page:

  • Select language
  • Continue

3. Export Validation:

  • Enter your name, company, email, country
    • Accept Trial License (even if you have permanent license)
    • Accept Export Restrictions
    • Continue

4. Media Pack Search:

Select a Product Pack: Oracle Fusion Middleware

Select a platform from the drop-down list

Go

5. Results:

Select the Oracle GoldenGate Media Pack you want

Continue

SelecttOGGgeneric.JPG

6. View Readme

7. Download software

8. Download documentation

Download.JPG

第二种:http://www.oracle.com

  1. 登录www.oracle.com ,选择Middleware下的See All

  1. 选择GoldenGate

注意选择好对应的版本及平台:

不用详细说明了吧,所以最终的下载地址:

英文:http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html

中文:http://www.oracle.com/technetwork/cn/middleware/goldengate/downloads/index.html

Setting ORACLE_HOME and ORACLE_SID

Set the environment variables in your .bash_profile (Bash)

ORACLE_BASE=/u01

ORACLE_HOME=$ORACLE_BASE/oracle

ORACLE_SID=ggsource

PATH=$ORACLE_BASE/gg11:$ORACLE_HOME/bin:$PATH

LD_LIBRARY_PATH=$ORACLE_BASE/gg11:$ORACLE_HOME/lib:$LD_LIBRARYPATH

export ORACLE_BASE ORACLE_HOME ORACLE_SID

export PATH LD_LIBRARY_PATH

自己:

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export OGG_HOME=/u01/gg11

export PATH=$OGG_HOME:$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$OGG_HOME:$ORACLE_HOME/lib:$LD_LIBRARYPATH

stty erase \^h

alias ggsci='rlwrap ggsci'

Setting library paths for dynamic builds

PlatformEnvironment variables
IBM AIXLIBPATH
IBM z/OS
HP-UXSHLIB_PATH
SolarisLD_LIBRARY_PATH
HP Tru64
Linux

Installing the Oracle GoldenGate software

Use the gzip and tar options appropriate for your system. If you are installing GoldenGate into a cluster environment, make certain that the GoldenGate binaries and files are installed on a file system that is available to all cluster nodes. After installing GoldenGate, make certain to configure the GoldenGate Manager process within the cluster application, as directed by the vendor’s documentation, so that GoldenGate will fail over properly with the other applications. The Manager process is the master control program for all GoldenGate operations.

A GoldenGate instance is a single installation of GoldenGate.

  • Unzip the Oracle GoldenGate media pack .zip file on a Windows system. This produces a .tar file.
  • FTP the .tar file in binary mode to the system and directory where you want GoldenGate to be installed.
  • Extract the .tar file into the current directory:

tar -xvof \<filename>.tar

  • Run the command shell and change directories to the new GoldenGate directory.

GGSCI> CREATE SUBDIRS

GoldenGate Directories

DirectoryContents
dirchkGoldenGate checkpoint files
dirdatGoldenGate trail and extract files
dirdefData definitions produced by DEFGEN and used to translate heterogeneous data
dirpcsProcess status files
dirprmParameter files
dirrptProcess report files
dirsqlSQL scripts
dirtmpTemporary storage for transactions that exceed allocated memory

a.dirchk:存放检查点文件

b.dirdat:存放Trail文件

c.dirdef:存放通过DEFGEN工具生成的源或目标端数据定义文件

d.dirpcs:存放进程状态文件

e.dirprm:存放配置参数文件

f.dirrpt:存放进程报告文件

g.dirsql:存放sql脚本文件

h.dirtmp:当食物所需要的内存超过已分配内存时,默认存储在这个目录。

系统要求

  1. 一个 OGG 实例最多支持 300 个并发 extract 和 replicat 进程,每个进程需要 25-55M 内存。
  2. GGSCI,view report,找到 PROCESS VM AVAIL FROM OS,大约就是系统所需 要的 swap space 大小
    3. 磁盘空间每个实例 50-150M,外加 trail 等等,至少给 1G。trail 所需空间 的预估方法是:[log volume in one hour] x [number of hours downtime] * 0.4
    4. /tmp 空间,默认是 dirtmp 目录,可以通过 CACHEMGR 参数的 CACHEDIRECTORY 选项指定
    5. 安装 OGG 的用户必须属于 ORACLE 数据库实例的组,通常就是 dba。
    6. 要想支持RAC里的RMAN log retention特性, 得在add extract之前安装patch BUGFIX 11879974

自己的安装例子

source和target端的安装过程是一样的。

配置环境变量

[oracle@rhel6_lhr ~]$ vi gg_env.sh

[oracle@rhel6_lhr ~]$ . gg_env.sh

[oracle@rhel6_lhr ~]$ more gg_env.sh

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export PATH=/u01/gg11:$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=/u01/gg11:$ORACLE_HOME/lib:$LD_LIBRARYPATH

stty erase \^h

alias ggsci='rlwrap ggsci'

[oracle@rhel6_lhr ~]$ mkdir /u01/gg11

[oracle@rhel6_lhr ~]$ env | grep LD

LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib:/usr/lib

[oracle@rhel6_lhr ~]$ unzip /mnt/hgfs/share/V28941-01.zip -d /tmp/gg/

Archive: /mnt/hgfs/share/V28941-01.zip

inflating: /tmp/gg/fbo_ggs_Linux_x64_ora11g_64bit.tar

inflating: /tmp/gg/OGG_WinUnix_Rel_Notes_11.1.1.1.2.pdf

inflating: /tmp/gg/Oracle_GoldenGate_11.1.1.1_README.txt

[oracle@rhel6_lhr ~]$ ll /tmp/gg

total 268088

-rw-r--r--. 1 oracle oinstall 274247680 Oct 7 2011 fbo_ggs_Linux_x64_ora11g_64bit.tar

-rw-r--r--. 1 oracle oinstall 245329 Oct 29 2011 OGG_WinUnix_Rel_Notes_11.1.1.1.2.pdf

-rw-r--r--. 1 oracle oinstall 25065 Oct 29 2011 Oracle_GoldenGate_11.1.1.1_README.txt

解压

[oracle@rhel6_lhr ~]$ tar xvf /tmp/gg/fbo_ggs_Linux_x64_ora11g_64bit.tar -C /u01/gg11/

bcpfmt.tpl

bcrypt.txt

cfg/

cfg/MPMetadataSchema.xsd

cfg/Config.properties

cfg/ProfileConfig.xml

cfg/password.properties

cfg/mpmetadata.xml

cfg/jps-config-jse.xml

chkpt_ora_create.sql

cobgen

convchk

db2cntl.tpl

ddl_access.tpl

ddl_cleartrace.sql

ddlcob

ddl_db2_os390.tpl

ddl_db2.tpl

ddl_ddl2file.sql

ddl_disable.sql

ddl_enable.sql

ddl_filter.sql

ddlgen

ddl_informix.tpl

ddl_mss.tpl

ddl_mysql.tpl

ddl_nopurgeRecyclebin.sql

ddl_nssql.tpl

ddl_ora10.sql

ddl_ora10upCommon.sql

ddl_ora11.sql

ddl_ora9.sql

ddl_oracle.tpl

ddl_pin.sql

ddl_purgeRecyclebin.sql

ddl_remove.sql

ddl_session1.sql

ddl_session.sql

ddl_setup.sql

ddl_sqlmx.tpl

ddl_status.sql

ddl_staymetadata_off.sql

ddl_staymetadata_on.sql

ddl_sybase.tpl

ddl_tandem.tpl

ddl_tracelevel.sql

ddl_trace_off.sql

ddl_trace_on.sql

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/oraclepki.jar

dirjar/jps-unsupported-api.jar

dirjar/fmw_audit.jar

dirjar/spring-security-cas-client-3.0.1.RELEASE.jar

dirjar/jps-manifest.jar

dirjar/xstream-1.3.jar

dirjar/monitor-common.jar

dirjar/commons-logging-1.0.4.jar

dirjar/org.springframework.jdbc-3.0.0.RELEASE.jar

dirjar/jps-upgrade.jar

dirjar/org.springframework.core-3.0.0.RELEASE.jar

dirjar/org.springframework.aop-3.0.0.RELEASE.jar

dirjar/org.springframework.web-3.0.0.RELEASE.jar

dirjar/ldapjclnt11.jar

dirjar/jmxremote_optional-1.0-b02.jar

dirjar/spring-security-acl-3.0.1.RELEASE.jar

dirjar/jps-wls.jar

dirjar/identityutils.jar

dirjar/identitystore.jar

dirjar/org.springframework.context-3.0.0.RELEASE.jar

dirjar/jsr250-api-1.0.jar

dirjar/jacc-spi.jar

dirjar/jagent.jar

dirjar/org.springframework.expression-3.0.0.RELEASE.jar

dirjar/org.springframework.context.support-3.0.0.RELEASE.jar

dirjar/spring-security-core-3.0.1.RELEASE.jar

dirjar/jps-api.jar

dirjar/org.springframework.test-3.0.0.RELEASE.jar

dirjar/osdt_core.jar

dirjar/jps-ee.jar

dirjar/osdt_cert.jar

dirjar/log4j-1.2.15.jar

dirjar/org.springframework.aspects-3.0.0.RELEASE.jar

dirjar/org.springframework.instrument-3.0.0.RELEASE.jar

dirjar/jps-common.jar

dirjar/spring-security-config-3.0.1.RELEASE.jar

dirjar/jps-mbeans.jar

dirjar/xmlparserv2.jar

dirjar/commons-codec-1.3.jar

dirjar/xpp3_min-1.1.4c.jar

dirjar/spring-security-web-3.0.1.RELEASE.jar

dirjar/jps-patching.jar

dirjar/spring-security-taglibs-3.0.1.RELEASE.jar

dirjar/org.springframework.orm-3.0.0.RELEASE.jar

dirjar/slf4j-log4j12-1.4.3.jar

dirjar/org.springframework.beans-3.0.0.RELEASE.jar

dirjar/jdmkrt-1.0-b02.jar

dirjar/jps-internal.jar

dirjar/slf4j-api-1.4.3.jar

dirjar/org.springframework.asm-3.0.0.RELEASE.jar

dirjar/org.springframework.transaction-3.0.0.RELEASE.jar

dirjar/osdt_xmlsec.jar

emsclnt

extract

freeBSD.txt

ggMessage.dat

ggsci

help.txt

jagent.sh

keygen

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

params.sql

prvtclkm.plb

pw_agent_util.sh

remove_seq.sql

replicat

retrace

reverse

role_setup.sql

sequence.sql

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信dbaup66,谢谢!
AiDBA后续精彩内容已被站长无情隐藏,请输入验证码解锁本文!
验证码:
获取验证码: 请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“AiDBA”或者“dbaup6”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复