网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 oracle建分区表
内容
    1、按月创建分区
    create table t_mhdp
    (
    id varchar2(50) not null,
    flt_aircode varchar2(4),
    flt_number number(7),
    flt_date date
    ) partition by range (flt_date)
    (
    partition part201105 values less than (to_date(' 2011-06-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian'))
    tablespace ts_mhdp_1105
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
    initial 64k
    next 1m
    minextents 1
    maxextents unlimited
    ),
    partition part201106 values less than (to_date(' 2011-07-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian'))
    tablespace ts_mhdp_1106
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
    initial 64k
    next 1m
    minextents 1
    maxextents unlimited
    ),
    partition part201107 values less than (to_date(' 2011-08-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian'))
    tablespace ts_mhdp_1107
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
    initial 64k
    next 1m
    minextents 1
    maxextents unlimited
    ),
    partition partdefault values less than (to_date(' 9999-12-30 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian'))
    tablespace ts_mhdp
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
    initial 64k
    next 1m
    minextents 1
    maxextents unlimited
    )
    );
    2、创建全局索引
    create index index_mhdp_pk on t_mhdp(id)
    tablespace ts_index_mhdp
    pctfree 10
    initrans 2
    maxtrans 255
    storage
    (
    initial 64k
    next 1m
    minextents 1
    maxextents unlimited
    );
    3、创建本地索引
    create index index_mhdp_pk on t_mhdp(id) local (
    partition part201105 tablespace ts_mhdp_index_1105,
    partition part201106 tablespace ts_mhdp_index_1106,
    partition part201107 tablespace ts_mhdp_index_1107,
    partition partdefault tablespace ts_mhdp_index
    );
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/21 15:15:49