OGG从入门到高可用系列

0    424    1

Tags:

👉 本文共约70957个字,系统预计阅读时间或需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

OGG从入门到高可用系列

5. Results:

Select the Oracle GoldenGate Media Pack you want

Continue

OGG从入门到高可用系列

OGG从入门到高可用系列

6. View Readme

7. Download software

8. Download documentation

OGG从入门到高可用系列

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

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

OGG从入门到高可用系列

  1. 选择GoldenGate

OGG从入门到高可用系列

OGG从入门到高可用系列

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

OGG从入门到高可用系列

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

英文: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

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信db_bao,谢谢!
OGG从入门到高可用系列后续精彩内容已被小麦苗无情隐藏,请输入验证码解锁本站所有文章!
验证码:
请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“DB宝”或者“www_xmmup_com”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

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

您可能还喜欢...

发表回复

嘿,我是小麦,需要帮助随时找我哦。
  • 18509239930
  • 个人微信

  • DB宝
  • 个人邮箱
  • 点击加入QQ群
  • 个人微店

  • 回到顶部