UTL_HTTP的Oracle数据库DNS解析需要时间

时间:2016-08-26 09:06:51

标签: oracle oracle11g

我在从Oracle DB调用UTL_HTTP时遇到问题。当我使用基于IP的URL时,结果很快就会出现,但是当使用基于DNS的URL时,10个请求中的1个用于调用URL需要额外的5秒。

以下是示例代码

declare 
l_url   VARCHAR2(500) := 'SOMEURL';
l_http_request   UTL_HTTP.req;
l_http_response  UTL_HTTP.resp;
BEGIN
DBMS_output.put_line(systimestamp);
FOR i IN 1..100 LOOP 
     -- Make a HTTP request and get the response.
     l_http_request  := UTL_HTTP.begin_request(l_url);
     l_http_response := UTL_HTTP.get_response(l_http_request);
     UTL_HTTP.end_response(l_http_response);
     --DBMS_output.put_line (l_http_response.status_code);
  END LOOP;
DBMS_output.put_line(systimestamp);
END;
/

0 个答案:

没有答案