create or replace procedure test
as
v varchar2(20);
begin
select user into v from dual@omf1; ///omf1 是 db link
exception
when others then
dbms_output.put_line('db link error');
end;
/
as
v varchar2(20);
begin
select user into v from dual@omf1; ///omf1 是 db link
exception
when others then
dbms_output.put_line('db link error');
end;
/
sqlcmd.....
exception
when others then
RAISE_APPLICATION_ERROR( -20100,'连接错误'||SQLERRM);
end ;
我在exception前面就一条插入语句,用到db link,也用了和你一样的exception语句来处理错误,结果呢,我故意将远程服务器网线断开,结果我怎么插入都不行,死等,一直不会报错,你说是怎么回事?
在oracle\ora92\network\sqlnet.ora
文件中改 SQLNET.EXPIRE_TIME = 10 连接10分钟没有操作自动断开
或者给用户建 profile 中有类似的限制选项
重新提一下我的目的:就是为了及时的发现db link不通,使得触发器不要进行远程操作.
就这样!大家还有办法么?