SUPPRESSTRIGGERS:该参数是suppress triggers两个单词合并而来,可以理解为抑制触发器。当我们做OracleGoldengate初始化时,灾备端的复制进程Replicat启动之前必须要做的一个步骤就是禁用触发器(为什么要这么做暂不讨论)。常用的做法是在灾备端sqlplus中执行语句来禁止触发器,例如:
SQL> declare
v_sql varchar2(2000);
CURSOR c_trigger IS SELECT 'alter trigger '||owner||'.'||trigger_name||' disable' from dba_triggers where owner in ('EPM_HA','XEPMA_HA','EPM_SEC','EPM_DE_HA','EPM_LOADC_HA','EPM_IC_HA','EPM_CP','FLOW_HA','EPM_HIS_HA','EPM_ERP_HA','EPM_BANK_HA','SYSODM','EPC_HA','EPSA_HA','EPM_RPT_HA');
BEGIN
OPEN c_trigger;
LOOP
FETCH c_trigger INTO v_sql;
EXIT WHEN c_trigger%NOTFOUND;
execute immediate v_sql;
end loop;
close c_trigger;
end;
/
如果使用SUPPRESSTRIGGERS参数就简单的多,只需要在目标端添加DBOPTIONS SUPPRESSTRIGGERS。该参数支持Oraclean10.2.0.5和11.2.0.2或更高版本,不支持11.1版本,需要注意。还有一点需要注意的时USERID,SOURCEDB参数在要写在DBOPTIONS SUPPRESSTRIGGERS之前。
GGSCI> EDIT PARAMS rt1
REPLICAT rt1
SETENV (NLS_LANG = "American_America.UTF8")
USERID oggadmin, PASSWORD AACAAAAAAAAAAAIARFBCXDACYBXIVCND, ENCRYPTKEY default
DBOPTIONS SUPPRESSTRIGGERS
GETTRUNCATES
REPORT AT 06:00
REPORTCOUNT EVERY 30 MINUTES, RATE
REPORTROLLOVER AT 02:00
REPERROR DEFAULT, ABEND
--HANDLECOLLISIONS
ALLOWNOOPUPDATES
DISCARDFILE ./dirrpt/repsa.dsc, APPEND, MEGABYTES 1024M
DISCARDROLLOVER AT 02:00
ASSUMETARGETDEFS
MAP snow.*, TARGET snow.*;
SQL> declare
v_sql varchar2(2000);
CURSOR c_trigger IS SELECT 'alter trigger '||owner||'.'||trigger_name||' disable' from dba_triggers where owner in ('EPM_HA','XEPMA_HA','EPM_SEC','EPM_DE_HA','EPM_LOADC_HA','EPM_IC_HA','EPM_CP','FLOW_HA','EPM_HIS_HA','EPM_ERP_HA','EPM_BANK_HA','SYSODM','EPC_HA','EPSA_HA','EPM_RPT_HA');
BEGIN
OPEN c_trigger;
LOOP
FETCH c_trigger INTO v_sql;
EXIT WHEN c_trigger%NOTFOUND;
execute immediate v_sql;
end loop;
close c_trigger;
end;
/
如果使用SUPPRESSTRIGGERS参数就简单的多,只需要在目标端添加DBOPTIONS SUPPRESSTRIGGERS。该参数支持Oraclean10.2.0.5和11.2.0.2或更高版本,不支持11.1版本,需要注意。还有一点需要注意的时USERID,SOURCEDB参数在要写在DBOPTIONS SUPPRESSTRIGGERS之前。
GGSCI> EDIT PARAMS rt1
REPLICAT rt1
SETENV (NLS_LANG = "American_America.UTF8")
USERID oggadmin, PASSWORD AACAAAAAAAAAAAIARFBCXDACYBXIVCND, ENCRYPTKEY default
DBOPTIONS SUPPRESSTRIGGERS
GETTRUNCATES
REPORT AT 06:00
REPORTCOUNT EVERY 30 MINUTES, RATE
REPORTROLLOVER AT 02:00
REPERROR DEFAULT, ABEND
--HANDLECOLLISIONS
ALLOWNOOPUPDATES
DISCARDFILE ./dirrpt/repsa.dsc, APPEND, MEGABYTES 1024M
DISCARDROLLOVER AT 02:00
ASSUMETARGETDEFS
MAP snow.*, TARGET snow.*;
![](http://img.blog.itpub.net/blog/attachment/201411/6/29047826_14152764613Yvv.png?x-oss-process=style/bb)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29047826/viewspace-1323380/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29047826/viewspace-1323380/