Oracle数据库中触发器包含dblink
1、
基本概念
a)
触发器trigger:触发器在数据库里以独立的对象存储,它与存储过程和函数不同的是,存储过程与函数需要用户显示调用才执行,而触发器是由一个事件来启动运行。即触发器是当某个事件发生时自动地隐式运行。
b)
Dblink:
2、
测试准备
a)
准备数据库test1,test2
b)
两边都创建scott用户,都创建表test1
Alter user scott account unlock identified by “123123”;
Create table test1(id int);
c)
创建dblink,我用的是网络标识符
create public database link test1_test2 connect to scott identified by "123123" using 'test2';
d)
创建触发器
create or replace trigger tri_test1
after insert on scott.test1
for each row
BEGI