【Oracle】OGG单向复制配置
实验环境:
源端:
Ip:192.168.40.10
DataBase:Oracle 11.2.0.1.0 ORCL
OS:OEL5.6
OGG:fbo_ggs_Linux_x86_ora11g_32bit
目标端:
Ip:192.168.40.128
DataBase:10.2.0.1.0 ORCL
OS:OEL5.6
OGG:fbo_ggs_Linux_x86_ora11g_32bit
首先配置好两台机子上的环境变量,在当中添加下面内容并使之生效:
export GGATE=$ORACLE_BASE/ogg
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$GGATE
而且均建立该路径:
mkdir $ORACLE_BASE/ogg
源端配置:
[oracle@badly9 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 7 17:23:51 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@ORCL>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 5
Next log sequence to archive 7
Current log sequence 7
SYS@ORCL>select supplemental_log_data_min from v$database;
SUPPLEME
--------
NO
SYS@ORCL>alter database add supplemental log data;
Database altered.
SYS@ORCL>select supplemental_log_data_min from v$database;
SUPPLEME
--------
YES
SYS@ORCL>alter database force logging;
Database altered.
SYS@ORCL>create tablespace tbs_ogg
2 datafile '/u01/app/oracle/oradata/ORCL/datafile/tbs_ogg01.dbf' size 200M
3 autoextend on;
Tablespace created.
SYS@ORCL>create user ogg identified by ogg default tablespace tbs_ogg;
User created.
SYS@ORCL>grant connect,resource,dba to ogg;
Grant succeeded.
SYS@ORCL>grant execute on utl_file to ogg;
Grant succeeded.
SYS@ORCL>grant select any dictionary,select any table to ogg;
Grant succeeded.
SYS@ORCL>grant alter any table to ogg;
Grant succeeded.
SYS@ORCL>grant flashback any table to ogg;
Grant succeeded.
SYS@ORCL>grant execute on DBMS_FLASHBACK to ogg;
Grant succeeded.
目标端:
SYS@ORCL>create tablespace tbs_ogg
2 datafile '/u01/app/oracle/oradata/ORCL/tbs_ogg01.dbf' size 200M
3 autoextend on;
Tablespace created.
SYS@ORCL>create user ogg identified by ogg default tablespace tbs_ogg;
User created.
SYS@ORCL>grant connect,resource,dba to ogg;
Grant succeeded.
SYS@ORCL>grant execute on utl_file to ogg;
Grant succeeded.
SYS@ORCL>grant insert any table to ogg;
Grant succeeded.
SYS@ORCL>grant delete any table to ogg;
Grant succeeded.
SYS@ORCL>grant update any table to ogg;
Grant succeeded.
源端和目标端
[oracle@badly9 ~]$ tar -xvf fbo_ggs_Linux_x86_ora11g_32bit.tar
UserExitExamples/
UserExitExamples/ExitDemo_passthru/
UserExitExamples/ExitDemo_passthru/Makefile_passthru.AIX
。。。
略。。
。
[oracle@badly9 ~]$ ./ggsci
源端:
GGSCI (badly9) 1> create subdirs
Creating subdirectories under current directory /u01/app/oracle/ogg
Parameter files /u01/app/oracle/ogg/dirprm: already exists
Report files /u01/app/oracle/ogg/dirrpt: created
Checkpoint files /u01/app/oracle/ogg/dirchk: created
Process status files /u01/app/oracle/ogg/dirpcs: created
SQL script files /u01/app/oracle/ogg/dirsql: created
Database definitions files /u01/app/oracle/ogg/dirdef: created
Extract data files /u01/app/oracle/ogg/dirdat: created
Temporary files /u01/app/oracle/ogg/dirtmp: created
Stdout files /u01/app/oracle/ogg/dirout: created
GGSCI (badly9) 2> edit params mgr
GGSCI (badly9) 3> view params mgr
port 7809
dynamicportlist 7800-8000
autorestart extract *,waitminutes 2,resetminutes 5
GGSCI (badly9) 4> start mgr
Manager started.
GGSCI (badly9) 5> edit params eora
GGSCI (badly9) 6> view params eora
extract eora
dynamicresolution
userid ogg,password ogg
exttrail /u01/app/oracle/ogg/dirdat/et
table scott.*;
GGSCI (badly9) 7>dblogin userid ogg, password ogg
Successfully logged into database.
GGSCI (badly9) 8>add trandata scott.*
GGSCI (badly9) 9> add extract eora,tranlog,begin now
EXTRACT added.
GGSCI (badly9) 10> add exttrail /u01/app/oracle/ogg/dirdat/et,extract eora
EXTTRAIL added.
GGSCI (badly9) 11> start extract eora
Sending START request to MANAGER ...
EXTRACT EORA starting
GGSCI (badly9) 12> edit params pump_so
GGSCI (badly9) 13> view params pump_so
extract pump_so
dynamicresolution
passthru
rmthost 192.168.40.128,mgrport 7809,compress
rmttrail /u01/app/oracle/ogg/dirdat/pt
table scott.*;
GGSCI (badly9) 14> add extract pump_so,exttrailsource /u01/app/oracle/ogg/dirdat/et
EXTRACT added.
GGSCI (badly9) 15> add rmttrail /u01/app/oracle/ogg/dirdat/pt,extract pump_so
RMTTRAIL added.
GGSCI (badly9) 16> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORA 00:00:00 00:00:02
EXTRACT RUNNING PUMP_SO 00:00:00 00:00:07
配置目标端进程:
由于目标端使用的是oracle 10g,启动ggsci的时候报错:
[oracle@jp ogg]$ ggsci
ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such file or directory
添加软链接:
ln -s /u01/app/oracle/product/10.2.0/db_1/lib/libnnz10.so libnnz11.so
启动再次报错:
[oracle@jp ogg]$ ggsci
ggsci: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory
再添加一个软链接:
ln -s /u01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1 libclntsh.so.11.1
再次启动正常:
[oracle@jp 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 (jp) 1> create subdirs
Creating subdirectories under current directory /u01/app/oracle/ogg
Parameter files /u01/app/oracle/ogg/dirprm: already exists
Report files /u01/app/oracle/ogg/dirrpt: created
Checkpoint files /u01/app/oracle/ogg/dirchk: created
Process status files /u01/app/oracle/ogg/dirpcs: created
SQL script files /u01/app/oracle/ogg/dirsql: created
Database definitions files /u01/app/oracle/ogg/dirdef: created
Extract data files /u01/app/oracle/ogg/dirdat: created
Temporary files /u01/app/oracle/ogg/dirtmp: created
Stdout files /u01/app/oracle/ogg/dirout: created
GGSCI (jp) 2> edit params mgr
GGSCI (jp) 3> view params mgr
port 7809
dynamicportlist 7800-8000
autostart er *
autorestart extract *,waitminutes 2,retries 5
lagreporthours 1
laginfominutes 3
lagcriticalminutes 5
purgeoldextracts /u01/app/oracle/ogg/dirdat/rt*,usecheckpoints,minkeepdays 3
GGSCI (jp) 4> start mgr
Manager started.
GGSCI (jp) 5> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
GGSCI (jp) 12> edit params rep2
GGSCI (jp) 13> view params rep2
replicat rep2
userid ogg,password ogg
assumetargetdefs
reperror default,discard
discardfile ./dirrpt/rep1.dsc,append,megabytes 50
dynamicresolution
--map ogg.test,target ogg.test;
map scott.*, target scott.*;
GGSCI (jp) 9> dblogin userid ogg,password ogg;
Successfully logged into database.
GGSCI (jp) 14> add checkpointtable ogg.checkpoint
Successfully created checkpoint table ogg.checkpoint.
GGSCI (jp) 16> add replicat rep2,exttrail /u01/app/oracle/ogg/dirdat/pt,checkpointtable ogg.checkpoint
REPLICAT added.
GGSCI (jp) 17> start rep2
Sending START request to MANAGER ...
REPLICAT REP2 starting
GGSCI (jp) 18> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REP2 00:00:00 00:00:00
DML測试
源端:
SCOTT@ORCL>insert into dept values(33,'TEST','TEST1');
1 row created.
SCOTT@ORCL>commit;
Commit complete.
目标端:
SCOTT@ORCL>select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
33 TEST TEST1
測试成功。
注:实验中源端和目标端都已存在scott用户及对应表。所以没有数据初始化过程。
【Oracle】OGG单向复制配置的更多相关文章
- GoldenGate配置(一)之单向复制配置
GoldenGate配置(一)之单向复制配置 环境: Item Source System Target System Platform Red Hat Enterprise Linux Server ...
- 【OGG】OGG的单向复制配置-支持DDL(二)
[OGG]OGG的单向复制配置-支持DDL(二) 一.1 BLOG文档结构图 一.2 前言部分 一.2.1 导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的 ...
- 【OGG】OGG简单配置双向复制(三)
[OGG]OGG简单配置双向复制(三) 一.1 BLOG文档结构图 一.2 前言部分 一.2.1 导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O ...
- [转]Oracle GoldenGate安装配置
ref:http://blog.sina.com.cn/s/blog_5d29418d0101cvyx.html 1 简介 Oracle Golden Gate软件是一种基于日志的结构化数据复制备份软 ...
- Oracle GoldenGate常用配置端口
1 简介 Oracle Golden Gate软件是一种基于日志的结构化数据复制备份软件,它通过解析源数据库在线日志或归档日志获得数据的增量变化,再将这些变化应用到目标数据库,从而实现源数据库与目标数 ...
- oracle ogg 单实例双向复制搭建(oracle-oracle)--Oracle GoldenGate
oracle ogg 单实例双向复制搭建(oracle-oracle)--Oracle GoldenGate --继昨天的测试,这一篇实施单实例双向复制(完全重新搭建) --环境不变 db1,db2( ...
- oracle ogg 单实例单向简单搭建测试(oracle-oracle)
昨天突然接到消息说有一个线上的ogg出现了问题,看是否能修复,由于ogg以前玩的少,所以就加急搞了个测试环境,练习了一把 环境 db1,db2(单实例)ip: 1*,1*sid: orcl,ogg1o ...
- Oracle 11g DG配置简明版
环境: 主库A机:在线生产环境,RHEL 6.4 + Oracle 11.2.0.3 备库B机:新增备机,RHEL 6.4 需求: 对生产环境最小影响前提下配置DG备库. 目录: 一.B机安装相同版本 ...
- oracle 客户端单独配置
本文目的是在CentOS 5.3上安装Oracle 11.2 instant client来访问远端的Oracle 10.2数据库,笔者测试通过,应该也适用于Redhat Linux 5.x ...
随机推荐
- Linux常用插件
文件传输 虚拟机用xshell连接时,拖拽传输插件 yum install lrzsz setup界面化工具 yum install setuptool yum install ntsysv # ...
- Linux命令详解-touch
linux的touch命令不常用,一般在使用make的时候可能会用到,用来修改文件时间戳,或者新建一个不存在的文件. 1.命令格式: touch [选项]... 文件... 2.命令参数: -a 或- ...
- Day14 js高级部分
JS中文学习文档 http://jquery.cuishifeng.cn/ 一.函数变量的作用域: 变量的作用域是在声明时决定的而不是调用执行时决定 作用域链: 二.词法分析: 函数执行前,会进行预编 ...
- 伪基站,卒于5G——本质上是基于网络和UE辅助的伪基站检测,就是将相邻基站的CI、信号强度等信息通过测量报告上报给网络,网络结合网络拓扑、配置信息等相关数据,对所有数据进行综合分析,确认在某个区域中是否存在伪基站
伪基站,卒于5G from:https://www.huxiu.com/article/251252.html?h_s=h8 2018-07-05 21:58收藏27评论6社交通讯 本文来自微 ...
- js排序算法05——快速排序
终于到了传说中的快速排序算法了,快速排序的思想和归并排序一样,都是采用分治思想,不同之处在于归并每次将数组一分为二,最后将小的数组进行比较,合并为大数组.快排是每次找一个主元,也就是基准数,按照这个基 ...
- office套件
一.PDF模块 使用PyPDF2模块 pip install PyPDF2 1.1 从PDF读取数据 直接读取,并打印出来.但是这种打印存在一个问题,不能中文字符 import PyPDF2 impo ...
- bzoj3495
题解: 对于每一条边的两段都有,很简单 然后处理国家 容易发现前缀和为1 代码: #include<cstdio> #include<algorithm> using name ...
- HDU 5875 Function (线段树+gcd / 单调栈)
题意:给你一串数a再给你一些区间(lef,rig),求出a[lef]%a[lef+1]...%a[rig] 题解:我们可以发现数字a对数字b取模时:如果a<b,则等于原数,否则a会变小至少一半. ...
- CUDA库函数module management
http://horacio9573.no-ip.org/cuda/group__CUDA__MODULE_ga52be009b0d4045811b30c965e1cb2cf.html
- JQuery遍历CheckBox踩坑记
$("#checkbox_id").attr("checked"); //获取一个CheckBox的状态(有没有被选中,返回true/false) $(&quo ...