修改分区
如下是已经建好的分区表,如何修改为分区:PARTITION BY RANGE (COLLECTDATE) subpartition by hash(EQUIP_ID,IFINDEX)(
....
TABLE NETWORK_FLOWTABLE_TEST
(
EQUIP_ID NUMBER(20) NOT NULL,
IFINDEX NUMBER(10),
COLLECTDATE DATE,
RXUTIL NUMBER(20,4),
TXUTIL NUMBER(20,4),
RXBPS NUMBER(20,4),
TXBPS NUMBER(20,4),
CLEANID1NUMBER(20),
CLEANID2NUMBER(20),
CLEANID3NUMBER(20),
PERIOD NUMBER(4) DEFAULT '0'
)PARTITION BY RANGE (COLLECTDATE) subpartition by hash(EQUIP_ID)(
PARTITION VALUES LESS THAN (TO_DATE('2012-01-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-02-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-03-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-04-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-05-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-06-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-07-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-08-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-09-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-10-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-11-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2012-12-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-01-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-02-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-03-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-04-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-05-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-06-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-07-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-08-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-09-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-10-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-11-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2013-12-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-01-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-02-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-03-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-04-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-05-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-06-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-07-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-08-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-09-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-10-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-11-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2014-12-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-01-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-02-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-03-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-04-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-05-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-06-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-07-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-08-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-09-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-10-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-11-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2015-12-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-01-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-02-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-03-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-04-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-05-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-06-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-07-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-08-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-09-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-10-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-11-01','YYYY-MM-DD')),
PARTITION VALUES LESS THAN (TO_DATE('2016-12-01','YYYY-MM-DD'))
);
[解决办法]
1、重建分区表;
2、分区表重定义(可在线);
[解决办法]
重建分区表,插入数据
[解决办法]
9I以后可以在线重定义,但似乎问题比较多,不建议用。
还是用比较笨的办法,重建分区表,然后将数据库导过去吧,这个办法虽然笨,但保险。
[解决办法]
4种方法
1.重建一张表,export/import
2.交换分区,重建一张分区表和普通表
3.在线重定义