暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 使用包中的外部表卸载数据-错误

ASKTOM 2020-08-20
322

问题描述

嗨,

目标是从Oracle包中使用外部表 (oracle_datapump) 卸载数据。

但是,当尝试使用execute immediate从包执行时,它会失败,并显示以下错误消息。

当以匿名pl/sql块或使用create table organization external作为select从sqlplus运行时,它工作正常...

请帮助为什么我们从包执行时会出现此错误。

create or replace package test_ext_pkg as
  procedure create_tab;
  lv_create_tab_sql varchar2(1000) :=
   'create table test_ext
                 organization external
                 (
                     type oracle_datapump
                     default directory TESTLOG
      access parameters (
      nologfile
      compression enabled medium
      ) 
                     location (''test_ext.dmp'')
                )
     as
           select * from dual
        ';

end test_ext_pkg;
/

create or replace package body test_ext_pkg as
procedure  create_tab as
     l_exec_sql varchar2(1000) := test_ext_pkg.lv_create_tab_sql;
 begin
    execute immediate l_exec_sql;
 end create_tab;
end test_ext_pkg;
/

begin
  test_ext_pkg.create_tab;
end;
/
复制

ORA-29913: 执行ODCIEXTTABLEOPEN标注时出错
ORA-29400: 数据卡带错误
KUP-04064: 初始化期间的致命错误
ORA-06512: 在 “TEST_EXT_PKG”,第5行
ORA-06512: 在2号线

Create table script works in SQLPLUS
    create table test_ext
                     organization external
                     (
                         type oracle_datapump
                         default directory TESTLOG
                                        access parameters (
                                        nologfile
                                        compression enabled medium
                                        )
                        location ('test_ext.dmp')
                   )
                 as
             select * from dual
/
复制


创建的表。

匿名pl/sql块也可以正常工作

declare
    lv_create_tab_sql varchar2(1000) :=
         'create table test_ext
                     organization external
                     (
                         type oracle_datapump
                         default directory TESTLOG
                                        access parameters (
                                        nologfile
                                       compression enabled medium
                                       )
                        location (''test_ext.dmp'')
                   )
                 as
              select * from dual
           ';
   begin
     execute immediate lv_create_tab_sql;
   end;
 /
复制


PL/SQL过程成功完成。

SQL> desc测试 _ ext
名称为空?类型
-
虚拟变量2(1)

SQL>


专家解答

抱歉,我没有看到这种行为。

初始化期间KUP-04064: 致命错误的错误消息为:

Cause: An unexpected error occurred while initializing access to an external table.
Action: Contact Oracle support.


在支持下接受这个。
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论