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

前端之家收集整理的这篇文章主要介绍了Oracle 按日分区表(数据仓库通常表形式)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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 high
partition 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 '主键'
原文链接:https://www.f2er.com/oracle/207527.html

猜你在找的Oracle相关文章