--检查数据链是否有效
function is_dblink_valid(v_dblink_name in varchar2) return boolean
as
begin
execute immediate 'select count(1) from user_tables'||case when v_dblink_name is not null then '@'||v_dblink_name end;
return true;
exception
when others then
if sqlerrm='ora-12170: tns: 连接超时' then
dbms_output.put_line('数据链['||v_dblink_name||']连接超时,请检查此数据链是否有效');
end if;
return false;
end is_dblink_valid;
检查数据链是否有效
最新推荐文章于 2022-05-17 11:17:32 发布