dbms_metadata.get_ddl ... DDL产生抛出语法错误

时间:2017-10-10 14:30:50

标签: oracle ddl

我正在尝试使用oracle中的dbms_metadata.get_ddl函数从我们的某个开发数据库重新创建一个表。例如

SELECT dbms_metadata.get_ddl('TABLE','ogaPatch2892_TAB','XVIEWMGR')from dual;

它确实产生了我需要的DDL,但运行它会产生错误

  

ORA-00904 ::无效标识符

以下是DDL sytax:

CREATE TABLE "XVIEWMGR"."ogaPatch2892_TAB" OF XMLTYPE
PCTFREE 10
PCTUSED 40
INITRANS 1
MAXTRANS 255
NOCOMPRESS
LOGGING
STORAGE (INITIAL 65536
         NEXT 1048576
         MINEXTENTS 1
         MAXEXTENTS 2147483645
         PCTINCREASE 0
         FREELISTS 1
         FREELIST GROUPS 1
         BUFFER_POOL DEFAULT
         FLASH_CACHE DEFAULT
         CELL_FLASH_CACHE DEFAULT)
TABLESPACE "TBSDATA"
VARRAY "XMLEXTRA"."NAMESPACES"
   STORE AS BASICFILE LOB "NAMESPACES2895_L" (
   ENABLE STORAGE IN ROW
   CHUNK 8192
   RETENTION
   CACHE
   STORAGE (INITIAL 65536
            NEXT 1048576
            MINEXTENTS 1
            MAXEXTENTS 2147483645
            PCTINCREASE 0
            FREELISTS 1
            FREELIST GROUPS 1
            BUFFER_POOL DEFAULT
            FLASH_CACHE DEFAULT
            CELL_FLASH_CACHE DEFAULT))
VARRAY "XMLEXTRA"."EXTRADATA"
   STORE AS BASICFILE LOB "EXTRADATA2894_L" (
   ENABLE STORAGE IN ROW
   CHUNK 8192
   RETENTION
   CACHE
   STORAGE (INITIAL 65536
            NEXT 1048576
            MINEXTENTS 1
            MAXEXTENTS 2147483645
            PCTINCREASE 0
            FREELISTS 1
            FREELIST GROUPS 1
            BUFFER_POOL DEFAULT
            FLASH_CACHE DEFAULT
            CELL_FLASH_CACHE DEFAULT))
VARRAY "XMLDATA"."SYS_XDBPD$"
   STORE AS BASICFILE LOB "SYS_XDBPD$2893_L" (
   ENABLE STORAGE IN ROW
   CHUNK 8192
   RETENTION
   CACHE
   STORAGE (INITIAL 65536
            NEXT 1048576
            MINEXTENTS 1
            MAXEXTENTS 2147483645
            PCTINCREASE 0
            FREELISTS 1
            FREELIST GROUPS 1
            BUFFER_POOL DEFAULT
            FLASH_CACHE DEFAULT
            CELL_FLASH_CACHE DEFAULT))

1 个答案:

答案 0 :(得分:0)

您需要做的就像下面所做的一样。无需指定存储参数。 Oracle将自动获取DBA安装或设置数据库时设置的默认值。

CREATE TABLE XVIEWMGR.ogaPatch2892_TAB OF XMLTYPE;