日期:2014-05-16  浏览次数:20582 次

Oracle表分区与索引的创建
-- Create table
create table TT_BAR_RECORD
(
  BAR_RECORD_ID        NUMBER(20) not null,
  OP_CODE              VARCHAR2(4),
  ZONE_CODE            VARCHAR2(30),
  WAYBILL_NO           VARCHAR2(30),
  CONTNR_CODE          VARCHAR2(30),
  OP_ATTACH_INFO       VARCHAR2(100),
  STAY_WHY_CODE        VARCHAR2(30),
  BAR_SCAN_TM          DATE not null,
  BAR_OPR_CODE         VARCHAR2(30),
  COURIER_CODE         VARCHAR2(30),
  PHONE_ZONE           VARCHAR2(20),
  PHONE                VARCHAR2(20),
  SUBBILL_PIECE_QTY    NUMBER(5),
  BAR_UPLOAD_TYPE_CODE NUMBER(4),
  WEIGHT_QTY           NUMBER(16,2),
  OTHER_INFO           VARCHAR2(100),
  AUTOLOADING          VARCHAR2(20),
  OBJ_TYPE_CODE        NUMBER(4),
  CREATE_TM            DATE default SYSDATE not null,
  ASURA_ROWID          VARCHAR2(30),
  DEST_ZONE_CODE       VARCHAR2(30)
)
partition by range (CREATE_TM)
(
  partition TT_BAR_RECORD_P20130818 values less than (TO_DATE(' 2013-08-19 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    tablespace OMP_LOAD_DATA
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      minextents 1
      maxextents unlimited
    ),
  partition TT_BAR_RECORD_P20130819 values less than (TO_DATE(' 2013-08-20 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    tablespace OMP_LOAD_DATA
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      minextents 1
      maxextents unlimited
    ),
  partition TT_BAR_RECORD_P20130820 values less than (TO_DATE(' 2013-08-21 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    tablespace OMP_LOAD_DATA
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
      initial 64K
      minextents 1
      maxextents unlimited
    ),
  partition TT_BAR_RECORD_P20130821 values less than (TO_DATE(' 2013-08-22 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    tablespace OMP_LOAD_DATA
    pctfree 10
    initrans 1
    maxtrans 255
    storage
&nb