1、当我执行如下脚本后,仅仅给表TEST2表指定表空间为NET 
create table TEST2
(
  id   VARCHAR2(20),
  code VARCHAR2(20),
  name VARCHAR2(50),
  create_date date
) tablespace NET 
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    )
--------------------------------------------------------
2、但是当我执行如下脚本后,却给表分区指定了表空间,表却没有指定表空间
create table TEST2
(
  id   VARCHAR2(20),
  code VARCHAR2(20),
  name VARCHAR2(50),
  create_date date
) tablespace NET 
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    )
partition by range(create_date) 
  interval(numtoyminterval(1,'MONTH'))  
  (
   partition p_2018 values less than(to_date('2019-01','yyyy-mm'))
  ) 
--------------------------------------------------------------------------
3、当我调整tablespace位置,执行如下脚本后,仍然只是给表分区指定了表空间,表却没有指定表空间
create table TEST2
(
  id   VARCHAR2(20),
  code VARCHAR2(20),
  name VARCHAR2(50),
  create_date date
) tablespace NET 
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    )
partition by range(create_date) 
  interval(numtoyminterval(1,'MONTH'))  
  (
   partition p_2018 values less than(to_date('2019-01','yyyy-mm'))
  ) 请问,如何才能一条脚本同时给TEST2表和表分区指定表空间?

解决方案 »

  1.   

    partition p_2018 values less than(to_date('2019-01','yyyy-mm'))  tablespace xxx
    加在分区后边
      

  2.   

    另外用store in
    参考https://blog.csdn.net/weixin_33786077/article/details/90220978
      

  3.   

    谢谢你,但是我的问题重点是“同时给表和表分区指定表空间”,而不是给预定义分区及扩展分区指定表空间!STORE IN和partition p_2018 values less than(to_date('2019-01','yyyy-mm'))  tablespace xxx都仅仅是给预定义分区及扩展分区指定表空间。
      

  4.   

    分区表表一级的表空间定义没有意义,因为segment是在分区一级的