昨天看了两篇blog
http://www.pythian.com/blog/disabling-triggers-in-oracle-11-2-0-4/
http://www.pythian.com/blog/disabling-triggers-per-session/
我现在的测试环境是11.2.0.3,无法测试第1篇帖子的内容,不过第2篇的内容倒是可以测试.
重复blog的测试看看:
1.建立测试环境:
SCOTT@test> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
create table trigger_test as select * from dual;
create or replace trigger trigger_test_aiu
after insert or update on trigger_test
begin
dbms_output.put_line('Trigger body');
end;
/
2.测试:
SCOTT@test> set serveroutput on
SCOTT@test> insert into trigger_test select * from dual;
Trigger body
1 row created.
--可以发现触发器有效.
--如果执行如下呢?
SCOTT@test> exec sys.dbms_xstream_gg.set_foo_trigger_session_contxt(fire=>true);
PL/SQL procedure successfully completed.
SCOTT@test> insert into trigger_test select * from dual;
1 row created.
--可以发现没有输出Trigger body,使用这个功能可以在会话端禁用触发器,也许在一些维护工作中有用.
3.看goldengate:
--如果仔细看这些就是goldengate的东西.
SCOTT@test> select owner,view_name from dba_views where view_name like '%GOLDENGATE%';
OWNER VIEW_NAME
------ ------------------------------
SYS GV_$GOLDENGATE_CAPTURE
SYS GV_$GOLDENGATE_MESSAGETRACKING
SYS GV_$GOLDENGATE_TABLE_STATS
SYS GV_$GOLDENGATE_TRANSACTION
SYS V_$GOLDENGATE_CAPTURE
SYS V_$GOLDENGATE_MESSAGE_TRACKING
SYS V_$GOLDENGATE_TABLE_STATS
SYS V_$GOLDENGATE_TRANSACTION
SYS DBA_GOLDENGATE_PRIVILEGES
SYS USER_GOLDENGATE_PRIVILEGES
SYS ALL_GOLDENGATE_PRIVILEGES
11 rows selected.
--在11.2.0.3的视图里面已经含有这些有关goldengate的视图,说明oracle对goldengate的重视程度.
--也许oracle 把流会放在次要的位置,而提升goldengate的战略地位.当然goldengate也不便宜.
--看来自己要开始学习一些goldengate的知识.