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 '字段描述';
分区表例子备份
最新推荐文章于 2024-07-27 08:00:00 发布