建设Oracle分区表实例,以及建立本地索引

来源:互联网 发布:asp音乐网站源码 编辑:程序博客网 时间:2024/06/17 15:57

create table T_Net_List
(
Net_Id  Number(38)  ,
Batch_Id  Number(38)  ,
Ip_Address  Varchar2(15)  ,
Area_Code  Varchar(4)  ,
Product_Kind  Number(1)  ,
Product_No  Varchar2(21)  ,
Candidate_Code  Varchar2(5)  ,
Vote_Money  Number(6)  ,
Vote_Time  Date  ,
Vote_Status  Number(1)  ,
Area_Status  Number(1)  ,
Activity_Id  Number(10)  ,
Candidate_Id  Number(38)  ,
Create_Time  Date  ,
Partition_Id  Char(2) 
)
partition by list (PARTITION_ID)
(
  partition SMDELIVERY01 values ('01')
    tablespace TBS_VOTE_01
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY02 values ('02')
    tablespace TBS_VOTE_02
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY03 values ('03')
    tablespace TBS_VOTE_03
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY04 values ('04')
    tablespace TBS_VOTE_04
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY05 values ('05')
    tablespace TBS_VOTE_05
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY06 values ('06')
    tablespace TBS_VOTE_06
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY07 values ('07')
    tablespace TBS_VOTE_07
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY08 values ('08')
    tablespace TBS_VOTE_08
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY09 values ('09')
    tablespace TBS_VOTE_09
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY10 values ('10')
    tablespace TBS_VOTE_10
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY11 values ('11')
    tablespace TBS_VOTE_11
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    ),
  partition SMDELIVERY12 values ('12')
    tablespace TBS_VOTE_12
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      next 1M
      minextents 1
      maxextents unlimited
    )
)


drop index  IDX_T_NET_LIST_1;
drop index  IDX_T_NET_LIST_2;
drop index  IDX_T_NET_LIST_3;

create index IDX_T_NET_LIST_1 on T_NET_LIST (NET_ID) local;
create index IDX_T_NET_LIST_2 on T_NET_LIST (ACTIVITY_ID) local ;
create index IDX_T_NET_LIST_3 on T_NET_LIST (CANDIDATE_ID) local ;

原创粉丝点击