Oracle 按日分区表(数据仓库通常表形式)

来源:互联网 发布:晋中市教育网络平台 编辑:程序博客网 时间:2024/06/18 09:59
prompt --        --  H_XXX_XXX_XXX_H 按日分区的表       --  TBS_XXXX 表空间create table H_XXX_XXX_XXX_H( sno number(22) not null, sname varchar2(32) not null, etl_dt date not null)-- compress for query highpartition by range(etl_dt)interval (numtodsinterval(1,'day')) store in (TBS_XXXX)(partition p_init values less than (to_date('2000-01-01')) tablespace TBS_XXXX);alter table H_XXX_XXX_XXX_H add constraint PK_H_XXX_XXX_XXX_H primary key (etl,sno)using index local tablespace TBS_XXXX;comment on table H_XXX_XXX_XXX_H is '按日时间分区表'comment on column H_XXX_XXX_XXX_H.sno is '主键'