goldengate 过滤对某张表的复制操作
在复制进程中配置下面的参数可以实现对一个用户下的某些表进行过滤,在复制的时候 不做任何操作。 MAPEXCLUDE:
Valid for Replicat
Use the MAPEXCLUDE parameter with the MAP parameter to explicitly exclude tables from a
wildcard specification. MAPEXCLUDE must precede all MAP statements that contain the table or tables being excluded. 注意:必须出现在map 的前面。 例如: DDL include mapped &
EXCLUDE OBJNAME "HAOZG.TEST15"
DDLOPTIONS report
MAPEXCLUDE HAOZG.TEST15
DDL参数语法说明
在配置DDL复制时,需要在Extract 和Replicat 进程的配置文件里添加ddl属性。下面简要减少下这个属性的常用参数,参考至《OGG Windows and UNIX Reference Guide》,英文较简单,我也就不一字一句的翻译了。
DDL语句包含的主要语法如下:
DDL [
{INCLUDE | EXCLUDE}
[, MAPPED | UNMAPPED | OTHER | ALL]
[, OPTYPE <type>]
[, OBJTYPE ‘<type>’]
[, OBJNAME “<name>”]
[, INSTR ‘<string>’]
[, INSTRCOMMENTS ‘<comment_string>’]
]
[...]
{INCLUDE | EXCLUDE}
Use INCLUDE and EXCLUDE to identify the beginning of an inclusion or exclusion clause.
(1) An inclusion clause containsfiltering criteria that identifies the DDL that this parameter will affect.
(2) An exclusion clause containsfiltering criteria that excludes specific DDL from this parameter.
The inclusion orexclusion clause must consist of the INCLUDE or EXCLUDE keyword followed by anyvalid combination of other options of the parameter that is being applied.
If you use EXCLUDE, you must create acorresponding INCLUDE clause.
--如果要使用Exclude,那么必须先指定include。
For example, the following is invalid:
DDL EXCLUDE OBJNAME “hr.*”
--这种语法是错误的。
However, you can use either of thefollowing:
DDL INCLUDE ALL,EXCLUDE OBJNAME “hr.*”
DDL INCLUDE OBJNAME “fin.*” EXCLUDE “fin.ss” --正确语法
An EXCLUDE takes priority over any INCLUDEs that contain the same criteria. You can use multipleinclusion and exclusion clauses.
[, MAPPED | UNMAPPED | OTHER | ALL]
Use MAPPED, UNMAPPED,OTHER, and ALL to apply INCLUDE or EXCLUDE based on the DDL operation scope.
1、MAPPED applies INCLUDE or EXCLUDE to DDL operations that are of MAPPED scope. MAPPED filtering is performed beforefiltering that is specified with other DDL parameter options.
2、UNMAPPED applies INCLUDE or EXCLUDE to DDL operations that are of UNMAPPED scope.
3、OTHER applies INCLUDE or EXCLUDE to DDL operations that are of OTHER scope.
4、ALL applies INCLUDE or EXCLUDE to DDL operations of all scopes. 关于这四种scope的具体范围详见官方文档《OGG Windows and UNIX Reference Guide》
OPTYPE <type>
Use OPTYPE toapply INCLUDE or EXCLUDE to a specific type of DDL operation, such as CREATE, ALTER,and RENAME. For <type>, use any DDL command that is valid for thedatabase.
For example, to include ALTER operations,the correct syntax is:
DDL INCLUDE OPTYPE ALTER
OBJTYPE‘<type>’
Use OBJTYPE to apply INCLUDE or EXCLUDE to a specific type of database object. For <type>,use any object type that is valid for the database, such as TABLE, INDEX, and TRIGGER.For an Oracle materialized view and materialized views log, the correct typesare snapshot and snapshot log, respectively. Enclose the name of the objecttype within single quotes.
For example:
DDL INCLUDE OBJTYPE ‘INDEX’
DDL INCLUDE OBJTYPE ‘SNAPSHOT’
For Oracle object type USER, do not use the OBJNAME option, because OBJNAME expects “owner.object” whereas USER only has aschema.
OBJNAME“<name>”
Use OBJNAME toapply INCLUDE or EXCLUDE to the fully qualified name of an object, for example owner.table_name.This option takes a doublequoted string as input. You can use a wildcard onlyfor the object name.
Example:
DDL INCLUDE OBJNAME “accounts.*”
Do not use OBJNAME for the Oracle USER object,because OBJNAME expects “owner.object” whereas USER only has a schema.
When using OBJNAMEwith MAPPED in a Replicat parameter file, the value for OBJNAME must refer tothe name specified with the TARGET clause of the MAP statement. For example,given the following MAP statement, the correct value is OBJNAME “fin2.*”.
MAP fin.exp_*,TARGET fin2.*;
In the following example, a CREATE TABLE statementexecutes like this on the source:
CREATE TABLE fin.exp_phone;
And like this on the target:
CREATE TABLE fin2.exp_phone;
If a target owner is not specified in the MAP statement, Replicat maps it to the database user that is specified with the USERID parameter.
For DDL that creates triggers, synonyms, and indexes, the value for OBJNAME must be the name of the base object, not the name of the trigger, synonym, or index.
For example, to include the following DDL statement, the correct value is “hr.accounts,” not “hr.insert_trig.”
CREATE TRIGGER hr.insert_trig ON hr.accounts;
For RENAME operations,the value for OBJNAME must be the new table name. For example, to include the following DDL statement, the correct value is “hr.acct.”
ALTER TABLE hr.accounts RENAME TO acct;
The following is an example of how tocombine DDL parameter options.
DDL &
INCLUDE UNMAPPED &
OPTYPE alter &
OBJTYPE ‘table’ &
OBJNAME users.tab* &
INCLUDE MAPPED OBJNAME * &
EXCLUDE MAPPED OBJNAME temporary.tab"
goldengate 过滤对某张表的复制操作的更多相关文章
- [MySQL] 同步一张表、复制过滤设置
一.缘由 据测试要求,需要把线上一张股票信息的表实时同步到测试环境,那么干吧,这次不复制库,单独复制表. 二.解决办法 可以按照同步(复制)库的方法来,在salve端设置 my.cnf,replica ...
- 夺命雷公狗---DEDECMS----31dedecms数据库创建一张表完成curl操作
首先我们创建一张测试表,格式如下所示: 然后我们还是在plus目录下创建一个test3.php进行测试,首先写一个添加的: <?php header("Content-Type:tex ...
- 记录一则FGA审计“A用户对B用户某张表的更新操作”需求
环境:Oracle 11.2.0.4 我这里测试A用户为JINGYU,要审计的表为B用户SCOTT下的EMP表.通过FGA来实现. 1.添加审计策略 2.测试审计效果 3.控制审计策略 1.添加审计策 ...
- Spring控制多张表的提交事务操作
一.Spring配置文件如下: <bean id="test" class="org.apache.commons.dbcp.BasicDataSource&quo ...
- MySQL实例多库某张表数据文件损坏导致xxx库无法访问故障恢复
一.问题发现 命令行进入数据库实例手动给某张表进行alter操作,发现如下报错. mysql> use xx_xxx; No connection. Trying to reconnect... ...
- 使用sql语句复制一张表
如何使用sql语句复制一张表? 方法一:第一步:先建一张新表,新表的结构与老表相等. create table newbiao like chengjibiao(老表名); 第二步:将老表中的值复制到 ...
- 一条sql解决.一张表的数据复制到另外一张表
如何把一个表的数组复制到一张表?也许很多人会把这个表查出来的数据再插入到另外一张表里面,这样很麻烦又要写代码逻辑去处理,其实一条sql语句就可以把一张表的数据复制到另外一张表,或者一张表的某一条数据复 ...
- MySQL将一张表的某些列数据,复制到另外一张表,并且修改某些内容
MySQL将一张表的某些列数据,复制到另外一张表 INSERT INTO t_topic_content(content,topicId) SELECT content,id FROM t_topi ...
- 如何用sql语句复制一张表
如何用sql语句复制一张表 1.复制表结构及数据到新表 CREATE TABLE 新表 SELECT * FROM 旧表 这种方法会将oldtable中所有的内容都拷贝过来,当然我们可以用delete ...
随机推荐
- ubuntu14.04_64位安装tensorflow-gpu
第一步(可直接跳到第二步):安装nvidia显卡驱动 linux用户可以通过官方ppa解决安装GPU驱动的问题.使用如下命令添加Graphic Drivers PPA: sudo add-apt-re ...
- 软件设计模式之代理模式(JAVA)
貌似停笔了近半个月了,实在不该啊,新的一年,时刻让自己归零. Back To Zero,就从这篇文章拉开今年的序幕吧. 这篇文章准备介绍下有关代理模式的基本概念和静态代理.动态代理的优缺点及使用方法( ...
- 微信小程序省市区选择器对接数据库
前言,小程序本身是带有地区选着器的(网站:https://mp.weixin.qq.com/debug/wxadoc/dev/component/picker.html),由于自己开发的程序的数据是很 ...
- Linux服务器安装svn
云安装 yum install subversion 配置 1.配置仓库 [root@localhost /]# cd /home [root@localhost home]# mkdir svn [ ...
- IT建设如何面对“短板”和“孤峰”?
在与很多企业探讨信息化建设时,很多IT负责人都提出过一个问题,企业信息化建设的资源是有限的,信息化的资源是先强化企业的“孤峰”还是先支持“短板”? 企 业虽说是一个整体,但不同的领域如研发.生产. ...
- linux环境中安装NRPE插件执行远程"本地资源"检查?NRPE安装?
需求描述: 在安装完nagios之后,需要对本地资源进行监控,比如磁盘空间的使用,进程数,swap空间,等等.这些都不是通过网络提供出来的, 所以,都是本地资源,可以通过NRPE插件实现在客户端中采集 ...
- oracle long类型转换成varchar2
CREATE OR REPLACE FUNCTION LONG_TO_CHAR( in_rowid rowid,in_owner varchar,in_table_name varchar,in_co ...
- jqgrid api
http://www.cnblogs.com/onflying/archive/2013/05/14/3077505.html
- go反射的规则
第一次知道反射的时候还是许多年前在学校里玩 C# 的时候.那时总是弄不清楚这个复杂的玩意能有什么实际用途……然后发现 Java 有这个,后来发现 PHP 也有了,再后来 Objective-C.Pyt ...
- Oauth2.0(五):Authorization Code 授权
Authorization Code 方式适用于有自己的服务器的应用.之所以叫这个名字,是因为流程中引入了一个叫做 authorization code 的东西.这个东西是一个一次性的临时凭证,用来换 ...