【问题标题】:Out of process memory error when writing large xmlfile using oracle xmldb使用 oracle xml db 写入大型 xml 文件时出现进程内存错误
【发布时间】:2013-12-22 20:24:24
【问题描述】:

我们在使用 oracle 9i 的 xmldb 工具编写大型 xml 文件时遇到了问题。该查询生成了大约 300 万行,oracle 响应以下错误消息:

ERROR at line 1:
ORA-04030: out of process memory when trying to allocate 4012 bytes
(qmxtgCreateBuf,kghsseg: kolaslCreateCtx)
ORA-06512: at "....", line 1154
ORA-06512: at line 1
ERROR: 
ORA-00600: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s],
[%s], [%s]

在警报日志中:

Errors in file d:/db/admin/acc1/udump/acc1_ora_8112.trc:
ORA-00600: internal error code, arguments: [729], [104], [space leak], [], [], [], [], []

我们已经尝试增加进程内存,但这几乎没有任何效果。

有没有办法让 oracle 为 xml 使用更少的内存(“惰性表现”/直写开关或类似的东西?

【问题讨论】:

标签: sql xml oracle oracle9i oracle-xml-db-repository


【解决方案1】:

您需要使用BULK 操作和LIMITED PAGED 查询来管理进程消耗的内存
例如:

DECLARE
  CURSOR c_customer IS
    SELECT CUSTOMER.id, CUSTOMER.name from CUSTOMER;
  TYPE customer_array_type IS TABLE OF c_customer%ROWTYPE INDEX BY BINARY_INTEGER;
  customer_array customer_array_type;
  fetch_size     NUMBER := 5000; -- scale the value to manage memory
BEGIN
  -- Open(create) XML file
  OPEN c_customer;
  loop
    FETCH c_customer BULK COLLECT
      INTO customer_array LIMIT fetch_size;
    FOR i IN 1 .. customer_array.COUNT LOOP
      null; -- Add XML nodes
    END LOOP;
    EXIT WHEN c_customer%NOTFOUND;
  END LOOP;
  CLOSE c_customer;
  -- Close(flush) XML file
End;

在某些情况下,当文件大小超过操作系统文件大小限制时,您必须创建多个文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-19
    • 2014-05-10
    • 2019-08-23
    • 2011-07-21
    • 1970-01-01
    • 2019-11-22
    • 2020-04-14
    相关资源
    最近更新 更多