码迷,mamicode.com
首页 > Web开发 > 详细

转 使用utl_http获取某个http页面内容

时间:2018-12-01 00:09:27      阅读:326      评论:0      收藏:0      [点我收藏+]

标签:failed   smt   www   work   cli   查看   script   assign   har   

 

使用utl_http获取某个http页面内容

首先确认浏览器可以访问IE ,如果不能访问,
vmware 查看 虚拟机 网络适配器 网络连接模式 为NAT
vmware 查看 编辑 虚拟网络编辑器 VMNET0 桥接模式 自动


SQL> select utl_http.request(‘http://www.SINA.com‘) from dual;
select utl_http.request(‘http://www.SINA.com‘) from dual
*
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1720
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at line 1

 

sys:
BEGIN
dbms_network_acl_admin.create_acl(acl => ‘db2.xml‘,
DESCRIPTION => ‘Normal Access‘,
principal => ‘CONNECT‘,
is_grant => TRUE,
PRIVILEGE => ‘connect‘,
start_date => NULL,
end_date => NULL);
END;
/
commit;

SELECT any_path
FROM resource_view
WHERE any_path like ‘/sys/acls/%.xml‘;

 


begin
dbms_network_acl_admin.add_privilege(acl => ‘db2.xml‘,
principal => ‘PENG‘,
is_grant => TRUE,
privilege => ‘connect‘,
start_date => null,
end_date => null);
END;
/

commit;

 

begin
dbms_network_acl_admin.assign_acl(acl => ‘db2.xml‘,
host => ‘www.sina.com‘,
lower_port => 80,
upper_port => NULL);
end;
/

begin
dbms_network_acl_admin.assign_acl(acl => ‘db2.xml‘,
host => ‘www.sina.com‘,
lower_port => NULL,
upper_port => NULL);
end;
/

begin
dbms_network_acl_admin.assign_acl(acl => ‘db2.xml‘,
host => ‘www.sina.com‘
);
end;
/
commit;

select utl_http.request(‘http://www.sina.com‘) from dual;

select utl_http.request(‘http://www.SINA.com‘) from dual;

 

#######sample
sys:

BEGIN
dbms_network_acl_admin.create_acl(acl => ‘SMTP.xml‘,
DESCRIPTION => ‘Normal Access‘,
principal => ‘CONNECT‘,
is_grant => TRUE,
PRIVILEGE => ‘connect‘,
start_date => NULL,
end_date => NULL);
END;
/

commit;

BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => ‘SMTP.xml‘,
principal => ‘PENG‘,
is_grant => true,
privilege => ‘resolve‘);
END;
/
commit;

BEGIN
dbms_network_acl_admin.assign_acl (acl => ‘SMTP.xml‘,
host => ‘*‘,
lower_port => 1,
upper_port => 9999);
END;
/
commit;

commit;


select utl_http.request(‘http://www.SINA.com‘) from dual;

SELECT acl,
principal,
privilege,
is_grant,
TO_CHAR(start_date, ‘DD-MON-YYYY‘) AS start_date,
TO_CHAR(end_date, ‘DD-MON-YYYY‘) AS end_date
FROM dba_network_acl_privileges;


select host, lower_port, upper_port, acl, aclid from dba_network_acls;

select utl_http.request(‘http://www.5ienet.com‘) from dual;
select utl_http.request(‘http://www.sina.com‘) from dual;

select utl_http.request(‘http://bsy.sz.bendibao.com‘) from dual;

 


###########new error
SQL> select utl_http.request(‘http://www.sina.com‘) from dual;
select utl_http.request(‘http://www.sina.com‘) from dual
*
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1720
ORA-29024: Certificate validation failure
ORA-06512: at line 1

 

 

###############
https://blog.csdn.net/indexman/article/details/17048573
https://blog.csdn.net/indexman/article/details/17048677

https://blog.csdn.net/x6_9x/article/details/79240581

转 使用utl_http获取某个http页面内容

标签:failed   smt   www   work   cli   查看   script   assign   har   

原文地址:https://www.cnblogs.com/feiyun8616/p/10047054.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!