【问题标题】:Access URL from Oracle 11g从 Oracle 11g 访问 URL
【发布时间】:2018-03-13 22:57:55
【问题描述】:

我有一个通过 URL 接受参数的 .NET Webform,我需要从我们的 Oracle 11g 数据库上的触发器中调用它。 基本上,每当产品库存发生变化时,触发器都应该使用表中的信息调用 URL,如下所示:

'http://localhost:9999/Webform.aspx?ID=' || ID || '&quantity=' || quantity

无需获得响应,因为 .NET 网络表单将处理其余部分。

我尝试过这样做:

begin
  dbms_network_acl_admin.create_acl (
  acl          => 'utl_http.xml',
  description  => 'my acl',
  principal    => 'user',
  is_grant     => TRUE,
  privilege    => 'connect',
  start_date   => null,  
  end_date     => null);
 commit;
 end;

begin
  dbms_network_acl_admin.add_privilege (
  acl         => 'utl_http.xml',
  principal   => 'user',
  is_grant    => false,
  privilege   => 'connect',
  position    => null,
  start_date  => null,
  end_date    => null);
 commit;
end;

declare
  req UTL_HTTP.REQ;
begin
  req := UTL_HTTP.BEGIN_REQUEST('http://localhost:9999/Webform.aspx');
END;

但我是从前两个得到的:

anonymous block completed

这是从第三个开始的:

ORA-29273: HTTP request failed 
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-12541: TNS:no listener 
ORA-06512: at line 7
29273. 00000 -  "HTTP request failed"
*Cause:    The UTL_HTTP package failed to execute the HTTP request.
*Action:   Use get_detailed_sqlerrm to check the detailed error message.
           Fix the error and retry the HTTP request.

【问题讨论】:

    标签: c# asp.net oracle11g


    【解决方案1】:

    ORA-12541: TNS:no listener 在该错误消息中突然出现在我面前。假设您从 .NET IDE 获得反馈,那么您的开发数据库侦听器可能已关闭,而数据库本身(例如,如果您在数据库服务器上使用 SQL*Plus)仍在运行。

    在数据库服务器上,检查以下命令: lsnrctl 状态

    【讨论】:

      猜你喜欢
      • 2016-12-05
      • 1970-01-01
      • 2020-02-19
      • 1970-01-01
      • 2019-05-17
      • 1970-01-01
      • 2010-11-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多