使用XMLTYPE列和存储在不同表空间中的lob创建分区表

时间:2018-11-08 11:57:45

标签: oracle oracle12c partitioning xmltype lob

我需要创建一个分区表,其中XMLTYPE列存储为SECUREFILE BINARY XML,每个分区的lob存储在不同的表空间中,但是我在创建该表的语法方面遇到了麻烦。当我尝试使用下面的代码创建表时,oracle在分区中的lob定义中启动错误- ORA-14020 。我尝试使用CLOB创建表,并且语法有效,但是当我不使用XMLTYPE列时。那么,使用存储在不同表空间中的XMLTYPE列和lob创建此表的正确语法是什么?

谢谢。

注意: ORA-14020 :可能未为表分区指定此物理属性。

创建表代码:

-- Create table
create table APL_X.TAB_X
(
  tnf_chave         CHAR(44) not null,
  tnf_arquivo       VARCHAR2(10),
  tnf_data_proc     DATE default SYSDATE,
  tnf_sitran        VARCHAR2(1),
  tnf_nfe           SYS.XMLTYPE,
  tnf_cpf_cnpj_emit NUMBER(14),
  tnf_cpf_cnpj_dest NUMBER(14),
  tnf_emissao       DATE,
  tnf_numnf         NUMBER(16),
  tnf_uf_emit       VARCHAR2(2),
  tnf_uf_dest       VARCHAR2(2),
  tnf_tiponf        NUMBER(2),
  tnf_serie         VARCHAR2(3),
  tnf_id_nfe        NUMBER(20),
  tnf_nsu           NUMBER(20),
  tnf_origem        NUMBER(3)
)
tablespace TS_DVNFE_PROD
COMPRESS FOR OLTP XMLTYPE COLUMN TNF_NFE STORE AS SECUREFILE BINARY XML (COMPRESS HIGH DEDUPLICATE)
partition by range (TNF_EMISSAO)
subpartition by hash(tnf_id_nfe)
subpartitions 4
(
partition P1_EMISSAO values less than (TO_DATE('01/01/2009', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_HIST LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_HIST DEDUPLICATE),
partition P2_EMISSAO_2009 values less than (TO_DATE('01/01/2010', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_HIST LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_HIST DEDUPLICATE),
partition P3_EMISSAO_2010 values less than (TO_DATE('01/01/2011', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_HIST LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_HIST DEDUPLICATE),
partition P4_EMISSAO_2011 values less than (TO_DATE('01/01/2012', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_HIST LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_HIST DEDUPLICATE),
partition P5_EMISSAO_2012 values less than (TO_DATE('01/01/2013', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_HIST LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_HIST DEDUPLICATE),
partition P6_EMISSAO_2013_01 values less than (TO_DATE('01/02/2013', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_2013 LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_2013 DEDUPLICATE)
        (
        subpartition P6_SUBP_2013_01_01 tablespace TS_DVNFE_2013,
        subpartition P6_SUBP_2013_01_02 tablespace TS_DVNFE_2013,
        subpartition P6_SUBP_2013_01_03 tablespace TS_DVNFE_2013,
        subpartition P6_SUBP_2013_01_04 tablespace TS_DVNFE_2013
        ),
partition P7_EMISSAO_2013_02 values less than (TO_DATE('01/03/2013', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_2013 LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_2013 DEDUPLICATE)
        (
        subpartition P7_SUBP_2013_02_01 tablespace TS_DVNFE_2013,
        subpartition P7_SUBP_2013_02_02 tablespace TS_DVNFE_2013,
        subpartition P7_SUBP_2013_02_03 tablespace TS_DVNFE_2013,
        subpartition P7_SUBP_2013_02_04 tablespace TS_DVNFE_2013
        ),
partition P8_EMISSAO_2013_03 values less than (TO_DATE('01/04/2013', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_2013 LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_2013 DEDUPLICATE)
        (
        subpartition P8_SUBP_2013_03_01 tablespace TS_DVNFE_2013,
        subpartition P8_SUBP_2013_03_02 tablespace TS_DVNFE_2013,
        subpartition P8_SUBP_2013_03_03 tablespace TS_DVNFE_2013,
        subpartition P8_SUBP_2013_03_04 tablespace TS_DVNFE_2013
        ),
partition P9_EMISSAO_2013_04 values less than (TO_DATE('01/05/2013', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_2013 LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_2013 DEDUPLICATE)
        (
        subpartition P9_SUBP_2013_04_01 tablespace TS_DVNFE_2013,
        subpartition P9_SUBP_2013_04_02 tablespace TS_DVNFE_2013,
        subpartition P9_SUBP_2013_04_03 tablespace TS_DVNFE_2013,
        subpartition P9_SUBP_2013_04_04 tablespace TS_DVNFE_2013
        ),
partition P10_EMISSAO_2013_05 values less than (TO_DATE('01/06/2013', 'DD/MM/YYYY')) compress for oltp tablespace TS_DVNFE_2013 LOB (TNF_NFE) STORE AS SECUREFILE BINARY XML (COMPRESS HIGH TABLESPACE TS_LOBNFE_2013 DEDUPLICATE)
        (
        subpartition P10_SUBP_2013_05_01 tablespace TS_DVNFE_2013,
        subpartition P10_SUBP_2013_05_02 tablespace TS_DVNFE_2013,
        subpartition P10_SUBP_2013_05_03 tablespace TS_DVNFE_2013,
        subpartition P10_SUBP_2013_05_04 tablespace TS_DVNFE_2013
        )
        );

0 个答案:

没有答案