oracle分割槽partition及分割槽索引partition index(一)

wisdomone1發表於2012-12-22

SQL> create table t_partition(partion_id int,a int)
  2  partition by range(partition_id)
  3  (
  4   partition p1 values less than (10) tablespace users
  5   partition p2 values less than (20) tablespace users
  6   partition p3 values less than (maxvalue) tablespace users
  7  )
  8  /
 partition p2 values less than (20) tablespace users
 *
第 5 行出現錯誤:
ORA-14020: 不能指定表分割槽的此物理屬性
 
SQL> c/partition_id/partion_id/
  2* partition by range(partion_id)
SQL> r
  1  create table t_partition(partion_id int,a int)
  2  partition by range(partion_id)
  3  (
  4   partition p1 values less than (10) tablespace users,
  5   partition p2 values less than (20) tablespace users,
  6   partition p3 values less than (maxvalue) tablespace users
  7* )
表已建立。
SQL>
 
SQL> r
  1  create index idx_t_partition on t_partition(partion_id)
  2  local
  3  (partition p1_idx1 tablespace users,
  4   partition p1_idx2 tablespace user2
  5* )
create index idx_t_partition on t_partition(partion_id)
                                *
第 1 行出現錯誤:
ORA-14024: LOCAL 索引的分割槽數必須等於基礎表的分割槽數

SQL> create index idx_t_partition on t_partition(partion_id)
  2  local
  3  (partition p1_idx1 tablespace users,
  4   partition p1_idx2 tablespace users,
  5   partition p1_idx3 tablespace users
  6  )
  7  /
索引已建立。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-751528/,如需轉載,請註明出處,否則將追究法律責任。

相關文章