有两个表A、B来自不同的两个数据库a、b,我想实现当对表A进行操作时,相应的实现对B的操作,哪位高手能帮忙指点下啊。

解决方案 »

  1.   

    在a数据库上创建一个指向b库的dblinkcreate or replace trigger tgname
    after insert or update or delete on A
    for each row
    begin
    if inserting then
      insert into b@dblinkname values(:new.col1,:new.col2..);
    ....
    end;
      

  2.   

    首先建立DBLink
    然后建立触发器,来实现对DBLink表的操作
    可以参考1楼
      

  3.   

    create database link linkfwq 
       connect to fzept identified by neu 
       using '(DESCRIPTION = 
       (ADDRESS_LIST = 
       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.142.202.12)(PORT = 1521)) 
       ) 
       (CONNECT_DATA = 
       (SERVICE_NAME = fjept) 
       ) 
       )