大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Oracle GoldenGate学习之--基本概念和配置(2)
成都创新互联10多年成都企业网站建设服务;为您提供网站建设,网站制作,网页设计及高端网站定制服务,成都企业网站建设及推广,对成都被动防护网等多个领域拥有多年的网站营销经验的网站建设公司。
一、Oracle OGG下载:
http://www.oracle.com/technetwork/cn/middleware/goldengate/downloads/index.html
二:OGG安装(RedHat EL6)
系统架构:
Test Environment:
Item | Source System | Target System |
Platform | RedHat EL6 | RedHat EL6 |
HostName | ogg | rh7 |
DataBase Version | Oracle 11.2.0.1.0 | Oracle 11.2.0.1.0 |
Character Set | zhs16gbk | zhs16gbk |
ORACLE_SID | prod | prod |
Listener | linstener/1521 | linstener/1521 |
GoldenGate User | ogg | ogg |
1、检测安装环境
[oracle@rh7 ogg]$ uname -a
Linux rh7.cuug.net 2.6.32-71.el6.i686 #1 SMP Wed Sep 1 01:26:34 EDT 2010 i686 i686 i386 GNU/Linux
[oracle@rh7 ogg]$ arch
i686
2、安装OGG软件
[oracle@rh7 ogg]$ mkdir -p /u01/ogg
[oracle@rh7 ogg]$ ls -l
total 85912
-rw-r----- 1 oracle oinstall 87966150 Sep 10 11:33 ogg112101_fbo_ggs_Linux_x86_ora11g_32bit.zip
注意:
下载的OGG 11g版本有32位和64位,如果在操作系统为32位,安装64位的OGG,将出现以下错误
“不可执行的二进制文件”
[oracle@rh7 ogg]$ unzip ogg112101_fbo_ggs_Linux_x86_ora11g_32bit.zip
Archive: ogg112101_fbo_ggs_Linux_x86_ora11g_32bit.zip inflating: fbo_ggs_Linux_x86_ora11g_32bit.tar inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf inflating: Oracle GoldenGate 11.2.1.0.1 README.txt inflating: Oracle GoldenGate 11.2.1.0.1 README.doc
[oracle@rh7 ogg]$ ls -l
total 290704 -rw-rw-r-- 1 oracle oinstall 209367040 Apr 23 2012 fbo_ggs_Linux_x86_ora11g_32bit.tar -rw-r----- 1 oracle oinstall 87966150 Sep 10 11:33 ogg112101_fbo_ggs_Linux_x86_ora11g_32bit.zip -rwxrwxrwx 1 oracle oinstall 220546 May 2 2012 OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf -rwxrwxrwx 1 oracle oinstall 93696 May 2 2012 Oracle GoldenGate 11.2.1.0.1 README.doc -rwxrwxrwx 1 oracle oinstall 24390 May 2 2012 Oracle GoldenGate 11.2.1.0.1 README.txt
[oracle@rh7 ogg]$ tar xvf fbo_ggs_Linux_x86_ora11g_32bit.tar
查看安装目录:
[oracle@rh7 ogg]$ ls -l
total 474820 -rw-r----- 1 oracle oinstall 426 Oct 15 2010 bcpfmt.tpl -rw-r----- 1 oracle oinstall 1725 Oct 15 2010 bcrypt.txt drwxr-x--- 2 oracle oinstall 4096 Apr 23 2012 cfg -rw-r----- 1 oracle oinstall 1285 Feb 29 2012 chkpt_ora_create.sql -rwxr-x--- 1 oracle oinstall 5307711 Apr 23 2012 cobgen -rwxr-x--- 1 oracle oinstall 5054612 Apr 23 2012 convchk -rw-r----- 1 oracle oinstall 159 Oct 15 2010 db2cntl.tpl -rw-r----- 1 oracle oinstall 1059 Oct 15 2010 ddl_cleartrace.sql -rwxr-x--- 1 oracle oinstall 5584197 Apr 23 2012 ddlcob -rw-r----- 1 oracle oinstall 4189 Oct 15 2010 ddl_ddl2file.sql -rw-r----- 1 oracle oinstall 746 Oct 15 2010 ddl_disable.sql -rw-r----- 1 oracle oinstall 692 Oct 15 2010 ddl_enable.sql -rw-r----- 1 oracle oinstall 3518 Oct 14 2011 ddl_filter.sql -rw-r----- 1 oracle oinstall 388 Oct 15 2010 ddl_nopurgeRecyclebin.sql -rw-r----- 1 oracle oinstall 13689 Dec 15 2011 ddl_ora10.sql -rw-r----- 1 oracle oinstall 3167 Aug 29 2011 ddl_ora10upCommon.sql -rw-r----- 1 oracle oinstall 14358 Dec 15 2011 ddl_ora11.sql -rw-r----- 1 oracle oinstall 14051 Dec 15 2011 ddl_ora9.sql -rw-r----- 1 oracle oinstall 1026 Oct 15 2010 ddl_pin.sql -rw-r----- 1 oracle oinstall 1227 Oct 15 2010 ddl_purgeRecyclebin.sql -rw-r----- 1 oracle oinstall 4138 Aug 9 2011 ddl_remove.sql -rw-r----- 1 oracle oinstall 425 Oct 15 2010 ddl_session1.sql -rw-r----- 1 oracle oinstall 1053 Oct 15 2010 ddl_session.sql -rw-r----- 1 oracle oinstall 296951 Apr 3 2012 ddl_setup.sql -rw-r----- 1 oracle oinstall 10506 Feb 27 2012 ddl_status.sql -rw-r----- 1 oracle oinstall 2506 Oct 15 2010 ddl_staymetadata_off.sql -rw-r----- 1 oracle oinstall 2501 Oct 15 2010 ddl_staymetadata_on.sql -rw-r----- 1 oracle oinstall 2955 Oct 15 2010 ddl_tracelevel.sql -rw-r----- 1 oracle oinstall 2721 Dec 28 2010 ddl_trace_off.sql -rw-r----- 1 oracle oinstall 2862 Oct 15 2010 ddl_trace_on.sql -rwxr-x--- 1 oracle oinstall 8317872 Apr 23 2012 defgen -rw-r----- 1 oracle oinstall 1217 Oct 15 2010 demo_more_ora_create.sql -rw-r----- 1 oracle oinstall 967 Oct 15 2010 demo_more_ora_insert.sql -rw-r----- 1 oracle oinstall 883 Oct 15 2010 demo_ora_create.sql -rw-r----- 1 oracle oinstall 821 Oct 15 2010 demo_ora_insert.sql -rw-r----- 1 oracle oinstall 4015 Oct 15 2010 demo_ora_lob_create.sql -rw-r----- 1 oracle oinstall 2275 Oct 15 2010 demo_ora_misc.sql -rw-r----- 1 oracle oinstall 1269 Oct 15 2010 demo_ora_pk_befores_create.sql -rw-r----- 1 oracle oinstall 1227 Oct 15 2010 demo_ora_pk_befores_insert.sql -rw-r----- 1 oracle oinstall 2520 Oct 15 2010 demo_ora_pk_befores_updates.sql drwxr-x--- 2 oracle oinstall 4096 Apr 23 2012 dirjar drwxr-x--- 2 oracle oinstall 4096 Apr 23 2012 dirprm -rwxr-x--- 1 oracle oinstall 5901919 Apr 23 2012 emsclnt -rwxr-x--- 1 oracle oinstall 34210648 Apr 23 2012 extract -rw-rw-r-- 1 oracle oinstall 209367040 Apr 23 2012 fbo_ggs_Linux_x86_ora11g_32bit.tar -rw-r----- 1 oracle oinstall 1968 Oct 15 2010 freeBSD.txt -rwxr-x--- 1 oracle oinstall 5825921 Apr 23 2012 ggcmd -rw-r----- 1 oracle oinstall 1257280 Apr 23 2012 ggMessage.dat -rwxr-x--- 1 oracle oinstall 12266773 Apr 23 2012 ggsci -rw-r----- 1 oracle oinstall 169753 Feb 1 2012 help.txt -rwxr-x--- 1 oracle oinstall 406 Apr 23 2012 jagent.sh -rwxr-x--- 1 oracle oinstall 316003 Apr 23 2012 keygen -rwxr-x--- 1 oracle oinstall 83229 Apr 19 2012 libantlr3c.so -rwxr-x--- 1 oracle oinstall 1740066 Apr 19 2012 libdb-5.2.so -rwxr-x--- 1 oracle oinstall 6569009 Apr 23 2012 libgglog.so -rwxr-x--- 1 oracle oinstall 1893448 Apr 23 2012 libggrepo.so -rwxr-x--- 1 oracle oinstall 15581116 Apr 19 2012 libicudata.so.38 -rwxr-x--- 1 oracle oinstall 4508019 Apr 19 2012 libicui18n.so.38 -rwxr-x--- 1 oracle oinstall 3349821 Apr 19 2012 libicuuc.so.38 -rwxr-x--- 1 oracle oinstall 4803823 Apr 19 2012 libxerces-c.so.28 -rw-r----- 1 oracle oinstall 1668 Oct 15 2010 libxml2.txt -rwxr-x--- 1 oracle oinstall 6441773 Apr 23 2012 logdump -rw-r----- 1 oracle oinstall 2278 Aug 9 2011 marker_remove.sql -rw-r----- 1 oracle oinstall 3824 Aug 9 2011 marker_setup.sql -rw-r----- 1 oracle oinstall 1715 Oct 15 2010 marker_status.sql -rwxr-x--- 1 oracle oinstall 9250398 Apr 23 2012 mgr -rw-r----- 1 oracle oinstall 213535 Jan 19 2012 notices.txt -rw-r----- 1 oracle oinstall 87966150 Sep 10 11:33 ogg112101_fbo_ggs_Linux_x86_ora11g_32bit.zip -rwxr-x--- 1 oracle oinstall 4600385 Apr 23 2012 oggerr -rwxrwxrwx 1 oracle oinstall 220546 May 2 2012 OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf -rwxrwxrwx 1 oracle oinstall 93696 May 2 2012 Oracle GoldenGate 11.2.1.0.1 README.doc -rwxrwxrwx 1 oracle oinstall 24390 May 2 2012 Oracle GoldenGate 11.2.1.0.1 README.txt -rw-r----- 1 oracle oinstall 5364 Mar 22 2012 params.sql -rw-r----- 1 oracle oinstall 1272 Dec 28 2010 prvtclkm.plb -rwxr-x--- 1 oracle oinstall 1015 Apr 23 2012 pw_agent_util.sh -rw-r----- 1 oracle oinstall 2393 Apr 8 2011 remove_seq.sql -rwxr-x--- 1 oracle oinstall 27303957 Apr 23 2012 replicat -rwxr-x--- 1 oracle oinstall 4622859 Apr 23 2012 retrace -rwxr-x--- 1 oracle oinstall 654448 Apr 23 2012 reverse -rw-r----- 1 oracle oinstall 4375 Apr 8 2011 role_setup.sql -rw-r----- 1 oracle oinstall 34564 Nov 16 2011 sequence.sql -rwxr-x--- 1 oracle oinstall 11984721 Apr 23 2012 server -rw-r----- 1 oracle oinstall 248 Oct 15 2010 sqlldr.tpl -rw-r----- 1 oracle oinstall 759 Oct 15 2010 tcperrs -rw-r----- 1 oracle oinstall 16763 Mar 3 2012 ucharset.h -rw-r----- 1 oracle oinstall 6747 Aug 25 2011 ulg.sql drwxr-x--- 7 oracle oinstall 4096 Apr 23 2012 UserExitExamples -rw-r----- 1 oracle oinstall 28041 Dec 30 2011 usrdecs.h -rw-r----- 1 oracle oinstall 1476 Oct 15 2010 zlib.txt
3、执行ggsci脚本,建立相关目录
[oracle@rh7 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, x86, 32bit (optimized), Oracle 11g on Apr 23 2012 08:09:25 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. GGSCI (ogg) 2> help GGSCI Command Summary: Object: Command: SUBDIRS CREATE ER INFO, KILL, LAG, SEND, STATUS, START, STATS, STOP EXTRACT ADD, ALTER, CLEANUP, DELETE, INFO, KILL, LAG, REGISTER, SEND, START, STATS, STATUS, STOP UNREGISTER EXTTRAIL ADD, ALTER, DELETE, INFO GGSEVT VIEW MANAGER INFO, SEND, START, STOP, STATUS MARKER INFO PARAMS EDIT, VIEW REPLICAT ADD, ALTER, CLEANUP, DELETE, INFO, KILL, LAG, SEND, START, STATS, STATUS, STOP REPORT VIEW RMTTRAIL ADD, ALTER, DELETE, INFO TRACETABLE ADD, DELETE, INFO TRANDATA ADD, DELETE, INFO SCHEMATRANDATA ADD, DELETE, INFO CHECKPOINTTABLE ADD, DELETE, CLEANUP, INFO Commands without an object: (Database) DBLOGIN, LIST TABLES, ENCRYPT PASSWORD, FLUSH SEQUENCE MININGDBLOGIN (DDL) DUMPDDL (Miscellaneous) FC, HELP, HISTORY, INFO ALL, OBEY, SET EDITOR, SHELL, SHOW, VERSIONS, ! (note: you must type the word COMMAND after the ! to display the ! help topic.) i.e.: GGSCI (sys1)> help ! command For help on a specific command, type HELP
GGSCI>create subdirs
--不需要指定路径,默认在当前目录下(所以进入ggsci的时候,一定要在gg的当前目录)
新建出来的目录有:
name Purpose
--dirchk Checkpoint files存放检查点(Checkpoint)文件 (和Oracle的checkpoint含义不同,如oralce的一个实例失败,从最近一次的checkpoint开始recorver, oracle的一次checkpoint是让dbwrt进程把被修改的数据从数据缓冲区中写入数据文件。而OGG的checkpoint是OGG捕捉了很多事务日志,哪些被传输了,哪些未被传输。每隔一段时间,执行一次checkpoint,之前的所有数据都要传送过去。如果soure or target db断电了,那下次启动的时候,就要支持断点续传,那那个断点位置就是最后一次OGG执行checkpoint的位置)
--dirdat GoldenGate trails, 存放Trail与Extract文件
--dirdef Data Definition files,过DEFGEN工具生成的源或目标的数据定义文件
--dirprm Parameter files, 存放参数文件
--dirpcs Process status files, 存放进程状态文件
--dirrpt Report files, 存放进程报告文件
--dirsql SQL script files,存放SQL脚本文件
--dirtmp Temporary files,当事务所需要的内存超过已分配内存时,缺省存储于此
@至此,OGG在linux下安装基本完成,后面将进入OGG的基本配置