分区表例子备份


create table test(
  code varchar2(32)  not null,
  edCode varchar2(32) not null,
  deptCode varchar2(32) not null,
  empCode varchar2(32) ,
  cabinetNo varchar2(16),
  electValue number(2,0) default 0,
  sendTime timestamp  default current_timestamp not null,
  edType varchar2(8),
  op_type number(2,0) default 0 not null,
  op_status number(2,0) default 0,
  expressNo varchar2(32),
  op_desc varchar2(128),
  description varchar2(512),  
  eventTime timestamp  default current_timestamp not null,  
  receiveTime timestamp  default current_timestamp not null,
  year number(4,0) default 2014 not null  
)
partition by range(year) 
(partition p_operationlog_2014 values less than (2015),
 partition p_operationlog_2015 values less than (2016),
 partition p_operationlog_2016 values less than (2017),
 partition p_operationlog_2017 values less than (2018),
 partition p_operationlog_2018 values less than (2019),
 partition p_operationlog_2019 values less than (2020),
 partition p_operationlog_2020 values less than (2021),
 partition p_operationlog_2021 values less than (2022),
 partition p_operationlog_2022 values less than (2023),
 partition p_operationlog_2023 values less than (2024),
 partition p_operationlog_max values less than (maxvalue) 
)  
enable row movement;  
alter table test enable row movement;

/*
 Index: idx_operationLog_edCode;
 DROP INDEX idx_operationLog_edCode;
***/
CREATE INDEX idx_operationLog_edCode ON test (edCode) local;

/*
 Index: idx_operationLog_opType;
 DROP INDEX idx_operationLog_opType;
***/
CREATE INDEX idx_operationLog_opType ON test (op_type) local;

/*
 Index: idx_operationLog_deptCode;
 DROP INDEX idx_operationLog_deptCode;
***/
CREATE INDEX idx_operationLog_deptCode ON test (deptCode) local;

/*
 Index: idx_operationLog_receiveTime;
 DROP INDEX idx_operationLog_receiveTime;
***/
CREATE INDEX idx_operationLog_receiveTime ON test (receiveTime) local;


COMMENT ON TABLE test IS '表描述';
COMMENT ON COLUMN test .code IS '字段描述';


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值