Goldengate DDL复制相关注意事项

Goldengate DDL复制相关注意事项

1.Goldengate DDL复制概述
a.Goldengate开启DDL复制后,不需要对原有的表和以后新加的表执行add trandata操作
这一点根据经验得出。
b.目标端默认支持DDL复制,故目标端Replicat进程参数文件中不需要添加DDL语句,当然源端Data Pump进程参数文件中也不需要加DDL相关的参数
这一点来源于《GGS_Fund_10.4_WinUX.ppt》

Source: DDL disabled by default; Extract must be configured to enable.
Target: DDL enabled by default to maintain data integrity

c.开启DDL复制后,目标端Replicat进程参数文件中必须配置忽略或者过滤DDLERROR的参数
rep_ta.prm

ddlerror default ignore retryop

这一点来源于《GGS_Fund_10.4_WinUX.ppt》
Replicat must be configured to ignore or filter DDL
并剽窃Gavin Soorma's blog中的一篇文章,摘录部分

So if we issue this DROP USER statement on the source, we will see that the replicat process on the target has abended and this is the error we will see in the report
SQL> drop user abc;
User dropped.
2010-07-10 17:20:13 GGS ERROR 2001 Fatal error executing DDL replication: error [Error code [1031], ORA-01031: insufficient privileges, SQL drop user abc /* GOLDENGATE_DDL_REPLICATION */], no error handler present.
The following DDL statements were issued on source

原文地址:http://gavinsoorma.com/2010/07/goldengate-ddl-synchronization-some-more-examples/
d.Goldengate数据库(dblogin userid xxx)用户和Oracle数据库自带的用户的DDL操作将不会被复制
关于Goldengate DDL复制支持的用户及对象,将在随后讨论,因为也不是一句两句能说清除的。
e.当开启Full DDL(可能是ALL Scope)支持时,不要在参数文件中使用GETTRUNCATES参数
这一点不是很理解,知情的朋友可以留言告知。
f.默认情况下ALTER DATABASE、ALTER SYSTEM不会被复制
这一点还是参考《GGS_Fund_10.4_WinUX.ppt》DDL部分

2.Goldengate支持DDL复制的Oracle数据库对象
clusters、functionsindexespackagesproceduresrolessequencessynonymstablestablespacestriggerstypesviewsmaterialized viewsusers

上面列出的对象在复制时,是有限的支持,详细情况会在随后的博文中探讨。

3.DDL语句包含的主要内容及语法
● scope
● object type
● operation type
● object name
● strings in the DDL command syntax or comments, or both

这里重点是scope和object name这两项内容,后面会详细讲这两个参数。

Syntax
DDL [
{INCLUDE | EXCLUDE}
[, MAPPED | UNMAPPED | OTHER | ALL]
[, OPTYPE <type>]
[, OBJTYPE ‘<type>’]
[, OBJNAME “<name>”]
[, INSTR ‘<string>’]
[, INSTRCOMMENTS ‘<comment_string>’]
]
[...]

4.DDL语句的4个Scope
对应上面DDL语法总的[, MAPPED | UNMAPPED | OTHER | ALL]
这是DDL同步中非常重要的一点,刚开始开启DDL复制的人在没看文档时,只使用MAPPED Scope或者只在主抽取进程中加那么一句ddl include all,实属不太科学的做法,下面就把官方文档中的关于这4个Scope的解释捡重点的列举出来。

MAPPED Scope支持同步的DDL操作和数据库对象
对TABLE、MAP语句指定的内容有效
DDL Operations CREATE, ALTER, DROP, RENAME, GRANT*, REVOKE*
Oracle DataBase Objects TABLE*, INDEX, TRIGGER, SEQUENCE*,  MATERIALIZED VIEW*

UNMAPPED
与上面相反,对TABLE、MAP语句指定的内容无效

OTHER
TABLE or MAP statements do not apply
DDL operations other than those listed above
Examples are CREATE USER, CREATE ROLE, ALTER TABLESPACE
这个没试过,应该没有ALL Scope的范围大

ALL
文档中没有该Scope解释的内容,Reference中只有一句对该Scope的解释
ALL applies INCLUDE or EXCLUDE to DDL operations of all scopes
不过从字面意思看来,ALL Scope要比上面3个所包含的范围广。

5.DDL语句格式及注意事项
当你需要同步除Goldengate和Oracle数据库自带的用户外所有用户的DDL操作时,可在源端主抽取进程中加入下面的内容

ddl include all

然后再在目标端Replicat进程参数文件中加入DDL错误的处理语句即可。
一个参数文件中只能包含一条DDL开头的语句,当你需要指定几个Oracle数据库用户时(还不能包括Goldengate和Oracle数据库自带的用户),或者多个INCLUDE、EXCLUDE语句时,可在使用组合的方式来书写
Only one DDL parameter can be used in a parameter file, but you can combine multiple
inclusion and exclusion options to filter the DDL to the required level.
● When combined, multiple option specifications are linked logically as AND statements.
● All criteria specified with multiple options must be satisfied for a DDL statement to be
replicated.
● When using complex DDL filtering criteria, it is recommended that you test your
configuration in a test environment before using it in production.

第一点中提到了,使用"&"符号来组合这些语句,如下示例:

ddl &
include all objname "oggsa.*" &
include all objname "oggsb.*" &
exclude "oggsc.*"

还可以使用下面的这种加","的书写方式

ddl include all objname "oggsa.*", include all objname "oggsc.*"

Reference中还有一种只用空格隔开的,应该跟"&"差不多,看着不太清爽,想用的朋友自己用吧。

ddl include objname “fin.*” exclude “fin.ss”

欢迎大家继续补充。
原创文章,转载请注明: 转载自tdy218's blog

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值