oracle 触发器中使用dblink问题
fire_ww
2011-02-23
oracle中使用dblink单独查询没问题,但是放触发器中就出现问题了
代码如下,有省略 CREATE OR REPLACE TRIGGER tr_for_user AFTER INSERT OR DELETE ON masa_user DECLARE user_sum NUMBER; BEGIN SELECT COUNT(t.USERNAME) INTO USER_SUM FROM (SELECT T.F_USERID USERNAME FROM MASA_USER T MINUS SELECT USERNAME USERNAME FROM tUserinfo@ABC) t; //ABC为一个dblink名称 END; 报错信息: Error: PL/SQL: ORA-04052: error occurred when looking up remote object ICD.TUSERINFO@ICD.US.ORACLE.COM ORA-00604: error occurred at recursive SQL level 1 ORA-03106: fatal two-task communication protocol error ORA-02063: preceding line from ICD Line: 14 Text: SELECT COUNT(t.USERNAME) Error: PL/SQL: SQL Statement ignored Line: 14 Text: SELECT COUNT(t.USERNAME) 将其中select语句单独执行没问题,放到触发器中就不能通过报错了,抛出的三个oracle错误不知道如何解决 |
|
fycghy0803
2011-03-18
这种情况应该是没有对dblink进行关闭,造成了在dblink连接的那台服务器上有了许多的连接未释放,从而造成连接数满了,你用的是什么版本的oracle?
|