设为首页 收藏本站
查看: 746|回复: 0

[经验分享] Oracle GoldenGate系统之----相关参数说明

[复制链接]

尚未签到

发表于 2018-9-10 10:41:28 | 显示全部楼层 |阅读模式
  转载 http://blog.itpub.net/429786/viewspace-1061095/
  一、配置文件存放位置
  [oracle@dg ~]$ cd /u01/app/ogg/dirprm/
  [oracle@dg dirprm]$ ls
  dgrac.prm  extb.prm  extdg.prm  jagent.prm  mgr.prm  rep1.prm
  二、 管理进程mgr配置文件
  [oracle@dg dirprm]$ more mgr.prm
  PORT 7801                                --  监听端口PORT
  DYNAMICPORTLIST 7802-7820    -- 开启其他进程使用端口(数量决定最大进程数)
  AUTOSTART ER *                       -- 开启管理进程后,自动启动所有的EXTRACT及REPLICAT进程
  AUTORESTART ER *,RETRIES 3,WAITMINUTES 2,RESETMINUTES 60  -- 自动重启异常中止的进程,重试3次,每次等2分钟,一小时后重试
  STARTUPVALIDATIONDELAY 5    -- 启动时延迟5秒校验
  PURGEOLDEXTRACTS ./dirdat/*,USECHECKPOINTS,MINKEEPDAYS 7    -- 自动清理EXTRACT目录文件,保留7天
  三、 抽取进程,进程名不超过8个字符
  [oracle@dg dirprm]$ more extdg.prm
  #定义extract ,参数名和组名一致
  extract extdg
  #进程环境设置
  setenv(NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
  setenv(ORACLE_SID="wailon")
  #用户登录信息,userid username@dbname,password userpwd
  userid scott,password tiger
  #排除以下用户的相关信息
  --tranlogoptions excludeuser scott
  #生成EXTRACT TRAIL文件位置,2个字符开头,其他自动生成
  exttrail /u01/app/ogg/dirdat/dg
  #动态分析表结构
  dynamicresolution
  #捕捉TRUNCATE操作
  gettruncates
  #定义需要同步的表,可使用通配符*
  table scott.*;
  四、 PUMP发送进程,extract进程的一种,把生成的EXTRACT TRAIL文件传送到远端服务器
  [oracle@dg dirprm]$ more dgrac.prm
  extract dgrac
  setenv(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
  userid scott@wailon,password tiger
  #远端服务器配置信息
  rmthost 192.168.56.131,mgrport 7801
  #远端服务器生成的TRAIL文件
  rmttrail /u01/app/ogg/dirdat/dg
  #直通模式或普通模式,两边表名及列名一样用直通,否则用普通配置自定义映射
  --NOPASSTHRU
  PASSTHRU
  gettruncates
  table scott.*;
  五、 应用进程replicat,进程名不超过8个字符
  [oracle@dg dirprm]$ more rep1.prm
  #定义replicat组名
  replicat rep1
  setenv(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
  userid scott@wailon, password tiger
  #两边数据库类型及结构一致时用ASSUMETARGETDEFS;否则使用SOURCEDEFS数据结构定义文件,实现不同数据库间同步
  --assumetargetdefs
  sourcedefs /u01/app/ogg/dirdef/emp.def
  #应用数据出错,默认丢弃
  reperror default,discard
  #丢弃的数据保存文件
  discardfile /u01/app/ogg/dirout/rep1.dsc,append,megabytes 100
  gettruncates
  batchsql
  #源对象和目标对象映射关系,列名不一样时用colmap,列名用双引号引用,列名与“=”之间有空格
  map scott.b, target scott.b, &
  colmap(usedefaults, "OWNER" = "USERNAME");
  #表映射关系,注意target前有一个空格
  map scott.emp, target scott.emp;
  map scott.dept, target scott.dept;
  六、 初始化加载
  1、源端
  [oracle@dg dirprm]$ more extb.prm
  extract extb
  setenv(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
  userid scott@wailon, password tiger
  rmthost 192.168.56.131, mgrport 7801
  rmttask replicat, group repb
  table scott.b;
  2、目标端
  [oracle@dgrac dirprm]$ more repb.prm
  replicat repb
  assumetargetdefs
  userid scott@ogg, password tiger
  reperror default,discard
  discardfile /u01/app/ogg/dirtmp/repb.dsc,append,megabytes 100
  #INSERTAPPEND 直接路径加载,提高加载速度
  --INSERTAPPEND
  #当目标端存在相同数据时,忽略重复数据错误
  HANDLECOLLISIONS
  map scott.b, target scott.b;
  [oracle@dgrac dirprm]$ -- 数据定义文件参数文件
  [oracle@dgrac dirprm]$ more defgen.prm
  defsfile /u01/app/ogg/dirdef/emp.def
  userid scott@wailon,password tiger
  table scott.emp;
  table scott.dept;
  table scott.b;
  [oracle@dgrac dirprm]$ cd ..
  [oracle@dgrac ogg]$ -- 根据参数文件生成数据定义文件
  [oracle@dgrac ogg]$ ./defgen paramfile dirprm/defgen.prm
  [oracle@dg ogg]$ cd dirdef/
  [oracle@dg dirdef]$ -- 数据定义文件目录
  [oracle@dg dirdef]$ ls
  emp.def
  [oracle@dg dirdef]$ -- 数据定义文件格式
  [oracle@dg dirdef]$ more emp.def
  *+- Defgen version 2.0, Encoding US-ASCII
  *
  * Definitions created/modified  2013-09-25 23:16
  *
  *  Field descriptions for each column entry:
  *
  *     1    Name
  *     2    Data Type
  *     3    External Length
  *     4    Fetch Offset
  *     5    Scale
  *     6    Level
  *     7    Null
  *     8    Bump if Odd
  *     9    Internal Length
  *    10    Binary Length
  *    11    Table Length
  *    12    Most Significant DT
  *    13    Least Significant DT
  *    14    High Precision
  *    15    Low Precision
  *    16    Elementary Item
  *    17    Occurs
  *    18    Key Column
  *    19    Sub Data Type
  *
  Database type: ORACLE

  Character set>
  National character set>  Locale: neutral
  Case sensitivity: 14 14 14 14 14 14 14 14 14 14 14 14 11 14 14 14
  *
  Definition for table SCOTT.EMP
  Record length: 112
  Syskey: 0
  Columns: 8
  EMPNO     134      8        0  0  0 1 0      8      8      8 0 0 0 0 1    0 1 3
  ENAME      64     10       12  0  0 1 0     10     10      0 0 0 0 0 1    0 0 0
  JOB        64      9       28  0  0 1 0      9      9      0 0 0 0 0 1    0 0 0
  MGR       134      8       42  0  0 1 0      8      8      8 0 0 0 0 1    0 0 3
  HIREDATE  192     19       54  0  0 1 0     19     19     19 0 5 0 0 1    0 0 0
  SAL       134      9       76  2  0 1 0      8      8      8 0 0 0 0 1    0 0 3
  COMM      134      9       88  2  0 1 0      8      8      8 0 0 0 0 1    0 0 3
  DEPTNO    134      8      100  0  0 1 0      8      8      8 0 0 0 0 1    0 0 3
  End of definition
  *
  Definition for table SCOTT.DEPT
  Record length: 50
  Syskey: 0
  Columns: 3
  DEPTNO  134      8        0  0  0 1 0      8      8      8 0 0 0 0 1    0 1 3
  DNAME    64     14       12  0  0 1 0     14     14      0 0 0 0 0 1    0 0 0
  LOC      64     13       32  0  0 1 0     13     13      0 0 0 0 0 1    0 0 0
  End of definition
  *
  Definition for table SCOTT.B
  Record length: 532
  Syskey: 0
  Columns: 15
  USERNAME         64     30        0  0  0 1 0     30     30      0 0 0 0 0 1    0 0 0
  OBJECT_NAME      64    128       36  0  0 1 0    128    128      0 0 0 0 0 1    0 0 0
  SUBOBJECT_NAME   64     30      170  0  0 1 0     30     30      0 0 0 0 0 1    0 0 0
  OBJECT_ID        64     50      206  0  0 1 0     50     50     50 0 0 0 0 1    0 1 2
  DATA_OBJECT_ID   64     50      262  0  0 1 0     50     50     50 0 0 0 0 1    0 0 2
  OBJECT_TYPE      64     19      318  0  0 1 0     19     19      0 0 0 0 0 1    0 0 0
  CREATED         192     19      342  0  0 1 0     19     19     19 0 5 0 0 1    0 0 0
  LAST_DDL_TIME   192     19      364  0  0 1 0     19     19     19 0 5 0 0 1    0 0 0
  TIMESTAMP        64     19      386  0  0 1 0     19     19      0 0 0 0 0 1    0 0 0
  STATUS           64      7      410  0  0 1 0      7      7      0 0 0 0 0 1    0 0 0
  TEMPORARY        64      1      422  0  0 1 0      1      1      0 0 0 0 0 1    0 0 0
  GENERATED        64      1      428  0  0 1 0      1      1      0 0 0 0 0 1    0 0 0
  SECONDARY        64      1      434  0  0 1 0      1      1      0 0 0 0 0 1    0 0 0
  NAMESPACE        64     50      440  0  0 1 0     50     50     50 0 0 0 0 1    0 0 2
  EDITION_NAME     64     30      496  0  0 1 0     30     30      0 0 0 0 0 1    0 0 0
  End of definition


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-570842-1-1.html 上篇帖子: DB Smart Flash Cache in Oracle 11g 下篇帖子: ORACLE SQL练习(七)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表