如何实现过滤DDL不同步到目标端
如何实现过滤DDL不同步到目标端DML的过滤,可以在源端配置 tableexclude user01.table01;在目标端配置 mapexclude user01.table01 加入后实现
如果希望DDL的改变,不会同步到目标端,改如何在两端配置呢?
DDL配置
1、过滤
pl/sql过滤,修改ddl_filer.sql文件,添加if/then语法。 .example
if ora_owner='SYS' then
retVal:='EXCLUDE';
end if;
if ora_objtype='USER' and ora_optype ='DROP' then retVal:='EXCLUDE';
end if;
if ora_owner='JOE' and ora_name like 'TEMP%' then retVal:='EXCLUDE';
end if;
使用角色过滤DDLAUX.addRule
The following example excludes all tables with name 'GGS%'
DECLARE sno NUMBER; BEGIN sno := DDLAUX.ADDRULE(obj_name => 'GGS%' , obj_type =>
TYPE_TABLE); END
The following example excludes all temporary tables.
DDLAUX.ADDRULE(base_obj_property => TB_TEMP, obj_type => TYPE_TABLE);
The following example excludes all indexes on TEMP tables. DDLAUX.ADDRULE(base_obj_property => TB_TEMP, obj_type => TYPE_INDEX);
The following example excludes all objects in schema TKGGADMIN. DDLAUX.ADDRULE(owner_name => 'TKGGADMIN');
The following example excludes all objects in TRUNCATE operations made to TEMP tables.
DDLAUX.ADDRULE(base_obj_property => TB_TEMP, obj_type => TYPE_TABLE, command => CMD_TRUNCATE)
ddl 参数控制
exclude objtype 'PROCEDURE' &
exclude objtype 'FUNCTION' &
exclude objtype 'TYPE' &
exclude objtype 'TRIGGER' &
exclude objtype 'GRANT' &
exclude instr 'GRANT' &
exclude objtype 'DATABASE LINK' &
exclude objtype 'CONSTRAINT' &
exclude objtype 'JOB' &
exclude instr 'ALTER SESSION' &
exclude INSTR 'AS SELECT' &
exclude INSTR 'REPLACE SYNONYM'
页:
[1]