ORA-28579: 从外部过程代理回调期间出现网络错误

发布于 2024-07-11 03:29:55 字数 956 浏览 10 评论 0原文

有人在尝试从 Oracle 查询调用外部 C 函数时看到过此错误吗? 我正在使用 Oracle 10g,每次尝试调用库中的两个函数之一时都会出现此错误。 对其他函数的调用每次都会返回正常,尽管有效的函数都是独立的,不会调用任何 OCI* 函数。

以下是用于调用失败的 C 代码的存储过程:

CREATE OR REPLACE PROCEDURE index_procedure(text in clob, tokens in out nocopy clob, location_needed in boolean)
as language c
name "c_index_proc"
library lexer_lib
with context
parameters
(
  context,
  text,
  tokens,
  location_needed
);

如有任何帮助,我们将不胜感激。 我在此错误消息中发现的所有内容都表明要采取的操作是:联系 Oracle 客户支持。

编辑:我已经将范围缩小到我知道在标记 clob 上调用 OCILobTrim (将其截断为 0 长度)后 libclntsh 深处存在段错误的程度。 这是我用来调用此过程的代码。

declare text CLOB; tokens CLOB;
begin
dbms_lob.createtemporary(tokens, TRUE);
dbms_lob.append(tokens, 'token');
dbms_lob.createtemporary(text, TRUE);
dbms_lob.append(text, '<BODY>Test Document</BODY>');
index_procedure(text, tokens, FALSE);
dbms_output.put_line(tokens);
end;
/

此设置是否有问题可能导致 OCILobTrim 问题?

Has anyone seen this error when trying to call an external C function from an Oracle query? I'm using Oracle 10g and get this error every time I try to call one of the two functions in the library. A call to the other function returns fine every time, though the function that works is all self-contained, no calls to any OCI* functions.

Here's the stored procedure that is used to call the failing C code:

CREATE OR REPLACE PROCEDURE index_procedure(text in clob, tokens in out nocopy clob, location_needed in boolean)
as language c
name "c_index_proc"
library lexer_lib
with context
parameters
(
  context,
  text,
  tokens,
  location_needed
);

Any help would be appreciated. Everything I've found on this error message says that the action to take is: Contact Oracle customer support.

Edit: I've narrowed it down to the point that I know that there is a segfault deep in libclntsh after I call OCILobTrim (to truncate it down to 0 length) on the tokens clob. Here is the code I've been using to call this procedure.

declare text CLOB; tokens CLOB;
begin
dbms_lob.createtemporary(tokens, TRUE);
dbms_lob.append(tokens, 'token');
dbms_lob.createtemporary(text, TRUE);
dbms_lob.append(text, '<BODY>Test Document</BODY>');
index_procedure(text, tokens, FALSE);
dbms_output.put_line(tokens);
end;
/

Is there something wrong with this setup that might be causing OCILobTrim problems?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷路的信 2024-07-18 03:29:55

看起来这是这些错误之一,本质上意味着外部过程可能会出现很多问题。

10.2.0.3 中有一个已知错误,不知道是否相关:

尝试选择时发生 ORA-28579
来自流水线表函数的数据
使用“C”实现
ODCITable/ANYDATASET 接口。
ODCITableDescribe 工作正常,但是
ODCITableFetch 生成 ORA-28579
错误。

我建议:

  1. 查看数据库服务器
    跟踪目录和目录
    外部过程所在的位置,
    对于生成的任何日志或跟踪文件
    当错误发生时。
  2. 检测您的外部过程
    某种方式,以便你可以尝试
    自己跟踪它的执行情况。
  3. 联系 Oracle 支持

It looks like this is one of those errors that essentially means any number of things could have gone wrong with the external procedure.

There is a known bug in 10.2.0.3, no idea if it's relevant:

ORA-28579 occurs when trying to select
data from a pipelined table function
implemented in "C" using the
ODCITable/ANYDATASET interface.
ODCITableDescribe works fine but
ODCITableFetch generates an ORA-28579
error.

I would suggest:

  1. Look in the database server
    trace directories, and the directory
    where the external proc is located,
    for any log or trace files generated
    when the error occurs.
  2. Instrument your external proc in
    some way so that you can try to
    trace its execution yourself.
  3. Contact Oracle support
满地尘埃落定 2024-07-18 03:29:55

好吧,升级到 10.2.0.4(使用 10.2.0.1)至少给了我一个可以理解的错误,而不是一个相当无用的核心文件和 ORA-28579。

事实证明,我正在调试的代码假设调用 OCILobRead 将一次性返回所有数据。 对于任何使用固定宽度字符集的客户端来说都是这种情况。

对于使用可变宽度字符集的客户端,情况并非如此,OCILobRead 实际上正在读取部分数据并返回 OCI_NEED_DATA,并且未来对 OCILobTrim 和 OCILobWrite 的调用会失败,因为对 OCILobRead 的调用仍然挂起。 解决方案是循环 OCILobRead 调用,直到不再返回 OCI_NEED_DATA 并且我们的缓冲区中有所有需要的数据。

对 OCIBreak 的调用也将允许 OCILobTrim 和 OCILobWrite 函数继续,但我们不会获得所有需要的输入数据。

Well, an upgrade to 10.2.0.4 (was using 10.2.0.1) at least gave me an understandable error instead of a fairly useless core file and the ORA-28579.

It turns out that the code I was debugging was assuming that calling OCILobRead would return all of the data in one pass. This is the case for any client using a fixed width character set.

For clients using a variable width character set, this isn't the case, OCILobRead was actually reading part of the data and returning OCI_NEED_DATA and future calls to OCILobTrim and OCILobWrite were failing because of the still pending call to OCILobRead. The solution was to loop OCILobRead calls until OCI_NEED_DATA was no longer returned and we had all of the needed data in our buffer.

A call to OCIBreak also would have allowed the OCILobTrim and OCILobWrite functions to continue, though we wouldn't have had all of the needed input data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文