ITPub博客

首页 > 数据库 > Oracle > Oracle GoldenGate系统之----安装及使用

Oracle GoldenGate系统之----安装及使用

原创 Oracle 作者:wailon 时间:2013-11-23 21:21:55 0 删除 编辑

Oracle GoldenGate(文中简称为OGG)是目前ORACLE主推的同构或异构数据库之间的同步软件之一。
以下主要介绍OGG在LINUX系统的安装及简单使用过程。

-- 上传OGG安装文件到服务器
[root@dg ~(23:56:19)]# su - oracle
[oracle@dg ~(23:56:23)]$ ls fbo*
fbo_ggs_Linux_x64_ora11g_64bit.tar

-- 创建OGG安装目标
[oracle@dg ~(23:56:27)]$ mkdir -p /home/oracle/ogg/11.2
[oracle@dg ~(23:56:47)]$ cd ogg/11.2/

-- 解压OGG安装文件到指定目录
[oracle@dg 11.2(23:56:55)]$ tar xvf ~/fbo_ggs_Linux_x64_ora11g_64bit.tar 

点击(此处)折叠或打开

  1. UserExitExamples/
  2.  UserExitExamples/ExitDemo_more_recs/
  3.  UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.HPUX
  4.  UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.SOLARIS
  5.  UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.LINUX
  6.  UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.AIX
  7.  UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.vcproj
  8.  UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.c
  9.  UserExitExamples/ExitDemo_more_recs/readme.txt
  10.  UserExitExamples/ExitDemo_passthru/
  11.  UserExitExamples/ExitDemo_passthru/exitdemo_passthru.c
  12.  UserExitExamples/ExitDemo_passthru/exitdemopassthru.vcproj
  13.  UserExitExamples/ExitDemo_passthru/Makefile_passthru.HPUX
  14.  UserExitExamples/ExitDemo_passthru/Makefile_passthru.AIX
  15.  UserExitExamples/ExitDemo_passthru/Makefile_passthru.HP_OSS
  16.  UserExitExamples/ExitDemo_passthru/Makefile_passthru.LINUX
  17.  UserExitExamples/ExitDemo_passthru/readme.txt
  18.  UserExitExamples/ExitDemo_passthru/Makefile_passthru.SOLARIS
  19.  UserExitExamples/ExitDemo_lobs/
  20.  UserExitExamples/ExitDemo_lobs/exitdemo_lob.c
  21.  UserExitExamples/ExitDemo_lobs/Makefile_lob.HPUX
  22.  UserExitExamples/ExitDemo_lobs/Makefile_lob.SOLARIS
  23.  UserExitExamples/ExitDemo_lobs/Makefile_lob.AIX
  24.  UserExitExamples/ExitDemo_lobs/exitdemo_lob.vcproj
  25.  UserExitExamples/ExitDemo_lobs/Makefile_lob.LINUX
  26.  UserExitExamples/ExitDemo_lobs/readme.txt
  27.  UserExitExamples/ExitDemo_pk_befores/
  28.  UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.AIX
  29.  UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.LINUX
  30.  UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.c
  31.  UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.HPUX
  32.  UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.vcproj
  33.  UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.SOLARIS
  34.  UserExitExamples/ExitDemo_pk_befores/readme.txt
  35.  UserExitExamples/ExitDemo/
  36.  UserExitExamples/ExitDemo/exitdemo.vcproj
  37.  UserExitExamples/ExitDemo/Makefile_exit_demo.SOLARIS
  38.  UserExitExamples/ExitDemo/Makefile_exit_demo.HP_OSS
  39.  UserExitExamples/ExitDemo/exitdemo.c
  40.  UserExitExamples/ExitDemo/Makefile_exit_demo.LINUX
  41.  UserExitExamples/ExitDemo/exitdemo_utf16.c
  42.  UserExitExamples/ExitDemo/Makefile_exit_demo.HPUX
  43.  UserExitExamples/ExitDemo/Makefile_exit_demo.AIX
  44.  UserExitExamples/ExitDemo/readme.txt
  45.  bcpfmt.tpl
  46.  bcrypt.txt
  47.  cfg/
  48.  cfg/password.properties
  49.  cfg/MPMetadataSchema.xsd
  50.  cfg/jps-config-jse.xml
  51.  cfg/ProfileConfig.xml
  52.  cfg/mpmetadata.xml
  53.  cfg/Config.properties
  54.  chkpt_ora_create.sql
  55.  cobgen
  56.  convchk
  57.  db2cntl.tpl
  58.  ddl_cleartrace.sql
  59.  ddl_ddl2file.sql
  60.  ddl_disable.sql
  61.  ddl_enable.sql
  62.  ddl_filter.sql
  63.  ddl_nopurgeRecyclebin.sql
  64.  ddl_ora10.sql
  65.  ddl_ora10upCommon.sql
  66.  ddl_ora11.sql
  67.  ddl_ora9.sql
  68.  ddl_pin.sql
  69.  ddl_purgeRecyclebin.sql
  70.  ddl_remove.sql
  71.  ddl_session.sql
  72.  ddl_session1.sql
  73.  ddl_setup.sql
  74.  ddl_status.sql
  75.  ddl_staymetadata_off.sql
  76.  ddl_staymetadata_on.sql
  77.  ddl_trace_off.sql
  78.  ddl_trace_on.sql
  79.  ddl_tracelevel.sql
  80.  ddlcob
  81.  defgen
  82.  demo_more_ora_create.sql
  83.  demo_more_ora_insert.sql
  84.  demo_ora_create.sql
  85.  demo_ora_insert.sql
  86.  demo_ora_lob_create.sql
  87.  demo_ora_misc.sql
  88.  demo_ora_pk_befores_create.sql
  89.  demo_ora_pk_befores_insert.sql
  90.  demo_ora_pk_befores_updates.sql
  91.  dirjar/
  92.  dirjar/xmlparserv2.jar
  93.  dirjar/fmw_audit.jar
  94.  dirjar/jps-internal.jar
  95.  dirjar/org.springframework.jdbc-3.0.0.RELEASE.jar
  96.  dirjar/org.springframework.context-3.0.0.RELEASE.jar
  97.  dirjar/jps-upgrade.jar
  98.  dirjar/oraclepki.jar
  99.  dirjar/org.springframework.transaction-3.0.0.RELEASE.jar
  100.  dirjar/xstream-1.3.jar
  101.  dirjar/jsr250-api-1.0.jar
  102.  dirjar/org.springframework.beans-3.0.0.RELEASE.jar
  103.  dirjar/ldapjclnt11.jar
  104.  dirjar/spring-security-cas-client-3.0.1.RELEASE.jar
  105.  dirjar/jps-manifest.jar
  106.  dirjar/org.springframework.aspects-3.0.0.RELEASE.jar
  107.  dirjar/identityutils.jar
  108.  dirjar/org.springframework.aop-3.0.0.RELEASE.jar
  109.  dirjar/jacc-spi.jar
  110.  dirjar/jmxremote_optional-1.0-b02.jar
  111.  dirjar/slf4j-log4j12-1.4.3.jar
  112.  dirjar/jps-api.jar
  113.  dirjar/slf4j-api-1.4.3.jar
  114.  dirjar/identitystore.jar
  115.  dirjar/jps-unsupported-api.jar
  116.  dirjar/osdt_xmlsec.jar
  117.  dirjar/org.springframework.orm-3.0.0.RELEASE.jar
  118.  dirjar/jagent.jar
  119.  dirjar/commons-codec-1.3.jar
  120.  dirjar/jps-ee.jar
  121.  dirjar/spring-security-taglibs-3.0.1.RELEASE.jar
  122.  dirjar/log4j-1.2.15.jar
  123.  dirjar/osdt_core.jar
  124.  dirjar/spring-security-acl-3.0.1.RELEASE.jar
  125.  dirjar/xpp3_min-1.1.4c.jar
  126.  dirjar/spring-security-web-3.0.1.RELEASE.jar
  127.  dirjar/spring-security-core-3.0.1.RELEASE.jar
  128.  dirjar/spring-security-config-3.0.1.RELEASE.jar
  129.  dirjar/jps-mbeans.jar
  130.  dirjar/org.springframework.test-3.0.0.RELEASE.jar
  131.  dirjar/jdmkrt-1.0-b02.jar
  132.  dirjar/jps-common.jar
  133.  dirjar/org.springframework.web-3.0.0.RELEASE.jar
  134.  dirjar/jps-patching.jar
  135.  dirjar/jps-wls.jar
  136.  dirjar/commons-logging-1.0.4.jar
  137.  dirjar/org.springframework.expression-3.0.0.RELEASE.jar
  138.  dirjar/org.springframework.instrument-3.0.0.RELEASE.jar
  139.  dirjar/monitor-common.jar
  140.  dirjar/osdt_cert.jar
  141.  dirjar/org.springframework.asm-3.0.0.RELEASE.jar
  142.  dirjar/org.springframework.context.support-3.0.0.RELEASE.jar
  143.  dirjar/org.springframework.core-3.0.0.RELEASE.jar
  144.  dirprm/
  145.  dirprm/jagent.prm
  146.  emsclnt
  147.  extract
  148.  freeBSD.txt
  149.  ggMessage.dat
  150.  ggcmd
  151.  ggsci
  152.  help.txt
  153.  jagent.sh
  154.  keygen
  155.  libantlr3c.so
  156.  libdb-5.2.so
  157.  libgglog.so
  158.  libggrepo.so
  159.  libicudata.so.38
  160.  libicui18n.so.38
  161.  libicuuc.so.38
  162.  libxerces-c.so.28
  163.  libxml2.txt
  164.  logdump
  165.  marker_remove.sql
  166.  marker_setup.sql
  167.  marker_status.sql
  168.  mgr
  169.  notices.txt
  170.  oggerr
  171.  params.sql
  172.  prvtclkm.plb
  173.  pw_agent_util.sh
  174.  remove_seq.sql
  175.  replicat
  176.  retrace
  177.  reverse
  178.  role_setup.sql
  179.  sequence.sql
  180.  server
  181.  sqlldr.tpl
  182.  tcperrs
  183.  ucharset.h
  184.  ulg.sql
  185.  usrdecs.h
  186.  zlib.txt


-- 查看解压后的OGG应用文件
[oracle@dg 11.2(23:57:12)]$ ls
bcpfmt.tpl                 ddl_session1.sql                 emsclnt            marker_status.sql
bcrypt.txt                 ddl_session.sql                  extract            mgr
cfg                        ddl_setup.sql                    freeBSD.txt        notices.txt
chkpt_ora_create.sql       ddl_status.sql                   ggcmd              oggerr
cobgen                     ddl_staymetadata_off.sql         ggMessage.dat      params.sql
convchk                    ddl_staymetadata_on.sql          ggsci              prvtclkm.plb
db2cntl.tpl                ddl_tracelevel.sql               help.txt           pw_agent_util.sh
ddl_cleartrace.sql         ddl_trace_off.sql                jagent.sh          remove_seq.sql
ddlcob                     ddl_trace_on.sql                 keygen             replicat
ddl_ddl2file.sql           defgen                           libantlr3c.so      retrace
ddl_disable.sql            demo_more_ora_create.sql         libdb-5.2.so       reverse
ddl_enable.sql             demo_more_ora_insert.sql         libgglog.so        role_setup.sql
ddl_filter.sql             demo_ora_create.sql              libggrepo.so       sequence.sql
ddl_nopurgeRecyclebin.sql  demo_ora_insert.sql              libicudata.so.38   server
ddl_ora10.sql              demo_ora_lob_create.sql          libicui18n.so.38   sqlldr.tpl
ddl_ora10upCommon.sql      demo_ora_misc.sql                libicuuc.so.38     tcperrs
ddl_ora11.sql              demo_ora_pk_befores_create.sql   libxerces-c.so.28  ucharset.h
ddl_ora9.sql               demo_ora_pk_befores_insert.sql   libxml2.txt        ulg.sql
ddl_pin.sql                demo_ora_pk_befores_updates.sql  logdump            UserExitExamples
ddl_purgeRecyclebin.sql    dirjar                           marker_remove.sql  usrdecs.h
ddl_remove.sql             dirprm                           marker_setup.sql   zlib.txt

-- 修改环境变量,添加以下两行
 [oracle@dg 11.2(23:58:16)]$ vi ~/.bash_profile

OGG_HOME=/home/oracle/ogg/11.2
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:$OGG_HOME; export LD_LIBRARY_PATH

-- 执行source ~/.bash_profile使环境变量生效

[oracle@dg 11.2(23:58:16)]$ pwd
/home/oracle/ogg/11.2

-- 执行ggsci进入OGG命令行管理
[oracle@dg 11.2(23:58:25)]$ ./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.

-- 创建OGG相关目录
GGSCI (dg) 1> create subdirs

Creating subdirectories under current directory /home/oracle/ogg/11.2

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

-- 查看所有进程运行状态
GGSCI (dg) 2> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED      
                                    

-- 编辑管理进程mgr
GGSCI (dg) 3> edit params mgr
PORT 7801

"dirprm/mgr.prm" [New] 1L, 10C written

-- 查看管理进程配置
GGSCI (dg) 4> view params mgr

PORT 7801

-- 启动管理进程
GGSCI (dg) 5> start mgr

Manager started.

-- 查看管理进程状态
GGSCI (dg) 6> info mgr

Manager is running (IP port dg.7802).


GGSCI (dg) 7> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                          


[oracle@dg 11.2(23:58:47)]$ ls
bcpfmt.tpl                 ddl_setup.sql                    dirprm             marker_remove.sql
bcrypt.txt                 ddl_status.sql                   dirrpt             marker_setup.sql
cfg                        ddl_staymetadata_off.sql         dirsql             marker_status.sql
chkpt_ora_create.sql       ddl_staymetadata_on.sql          dirtmp             mgr
cobgen                     ddl_tracelevel.sql               emsclnt            notices.txt
convchk                    ddl_trace_off.sql                extract            oggerr
db2cntl.tpl                ddl_trace_on.sql                 freeBSD.txt        params.sql
ddl_cleartrace.sql         defgen                           ggcmd              prvtclkm.plb
ddlcob                     demo_more_ora_create.sql         ggMessage.dat      pw_agent_util.sh
ddl_ddl2file.sql           demo_more_ora_insert.sql         ggsci              remove_seq.sql
ddl_disable.sql            demo_ora_create.sql              help.txt           replicat
ddl_enable.sql             demo_ora_insert.sql              jagent.sh          retrace
ddl_filter.sql             demo_ora_lob_create.sql          keygen             reverse
ddl_nopurgeRecyclebin.sql  demo_ora_misc.sql                libantlr3c.so      role_setup.sql
ddl_ora10.sql              demo_ora_pk_befores_create.sql   libdb-5.2.so       sequence.sql
ddl_ora10upCommon.sql      demo_ora_pk_befores_insert.sql   libgglog.so        server
ddl_ora11.sql              demo_ora_pk_befores_updates.sql  libggrepo.so       sqlldr.tpl
ddl_ora9.sql               dirchk                           libicudata.so.38   tcperrs
ddl_pin.sql                dirdat                           libicui18n.so.38   ucharset.h
ddl_purgeRecyclebin.sql    dirdef                           libicuuc.so.38     ulg.sql
ddl_remove.sql             dirjar                           libxerces-c.so.28  UserExitExamples
ddl_session1.sql           dirout                           libxml2.txt        usrdecs.h
ddl_session.sql            dirpcs                           logdump            zlib.txt


相关目录及运行程序说明:

Parameter files                /home/oracle/ogg/11.2/dirprm -- 参数文件保存目录,如MGR管理进程
Report files                   /home/oracle/ogg/11.2/dirrpt -- 报告文件保存目录,OGG主要诊断手段之一,使用view report #GroupName查看报告
Checkpoint files               /home/oracle/ogg/11.2/dirchk -- 由Extract(抽取)或Replicat(应用)进程产生对应的CHECKPOINT文件,记录当前读写的位置
Process status files           /home/oracle/ogg/11.2/dirpcs -- 进程状态文件保存目录,记录当前运行进程的状态,进程名以大写显示
                                                                                -- 扩展名为pcm表示管理进程,pcr表示replicat进程,pce表示为extract进程
SQL script files               /home/oracle/ogg/11.2/dirsql -- SQL脚本保存目录
Database definitions files     /home/oracle/ogg/11.2/dirdef -- 由DEFGEN生成的数据库结构定义文件保存目录,主要用于异构数据库
Extract data files             /home/oracle/ogg/11.2/dirdat -- TRAIL文件和Extract(抽取)进程产生的文件默认目录
Temporary files                /home/oracle/ogg/11.2/dirtmp -- 由CACHE管理器分配,用于保存事务数据的目录
Stdout files                   /home/oracle/ogg/11.2/dirout -- 未使用,一般用于DISCARD文件保存

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/429786/viewspace-777422/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-08

  • 博文量
    51
  • 访问量
    291505