ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 分区表_建分区表脚本

分区表_建分区表脚本

原创 Linux操作系统 作者:dingyu220 时间:2012-04-15 17:01:31 0 删除 编辑
--1 Create table
CREATE TABLE test_p1(
  customer_id     NUMBER(6),
  cust_first_name VARCHAR2(20),
  cust_last_name  VARCHAR2(20),
  nls_territory   VARCHAR2(30),
  cust_email      VARCHAR2(30)
)
PARTITION BY LIST (nls_territory)(
  PARTITION asia VALUES ('CHINA', 'THAILAND'),
  PARTITION europe VALUES ('GERMANY', 'ITALY', 'SWITZERLAND'),
  PARTITION west VALUES ('AMERICA'),
  PARTITION east VALUES ('INDIA'),
  PARTITION rest VALUES (DEFAULT)--注意这个DEFAULT
);

--2 Create table
create table test_p2
(
  ctime      DATE,
  mmdd       VARCHAR2(4),
  f001       VARCHAR2(100),
  f002       VARCHAR2(100),
  f003       VARCHAR2(100)
)
partition by range (mmdd)
(
  partition P0131 values less than ('0131')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P0229 values less than ('0229')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P0331 values less than ('0331')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P0430 values less than ('0430')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P0531 values less than ('0531')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P0630 values less than ('0630')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P0731 values less than ('0731')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P0830 values less than ('0831')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P0930 values less than ('0930')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P1031 values less than ('1031')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P1130 values less than ('1130')
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    ),
  partition P1231 values less than (MAXVALUE)
    tablespace DY_P
    pctfree 15
    pctused 75
    initrans 4
    maxtrans 255
    storage
    (
      initial 10M
      next 4M
      minextents 1
      maxextents unlimited
      pctincrease 0
    )
)
;
-- Create/Recreate indexes
create index IX_F001 on test_p2 (ACCEPTERNO, ACCEPTBEGINTIME) LOCAL;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24805255/viewspace-721224/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 表空间_建表空间
下一篇: 删除相同数据
请登录后发表评论 登录
全部评论

注册时间:2011-05-15

  • 博文量
    67
  • 访问量
    60752