全部博文(1144)
分类: Mysql/postgreSQL
2013-07-24 03:05:11
打算把老数据的索引给压缩下,结果做不了,报ORA-28659
SQL> DROP TABLE test_partition;
Table dropped
SQL>
SQL> CREATE TABLE test_partition
2 ( ID NUMBER,NAME VARCHAR2(200)
3 )
4 PARTITION BY RANGE (ID)
5 (PARTITION test01 VALUES LESS THAN (100),
6 PARTITION test02 VALUES LESS THAN (200),
7 PARTITION test03 VALUES LESS THAN (300),
8 PARTITION test04 VALUES LESS THAN (MAXVALUE))
9 /
Table created
SQL> CREATE INDEX idx_test_PARTITION on test_partition (ID) local;
Index created
SQL> alter index idx_test_PARTITION rebuild partition test01 compress;
alter index idx_test_PARTITION rebuild partition test01 compress
ORA-28659: COMPRESS must be specified at object level first
解决方法也很奇怪,先建立compress的local索引,在把不需要compress的分区给nocompress
SQL> drop index idx_test_PARTITION;
Index dropped
SQL> CREATE INDEX idx_test_PARTITION on test_partition (ID) LOCAL COMPRESS;
Index created
SQL>
SQL> alter index idx_test_PARTITION rebuild partition test04 nocompress;
Index altered
SQL> alter index idx_test_PARTITION rebuild partition test02 nocompress;
Index altered
SQL> alter index idx_test_PARTITION rebuild partition test03 nocompress;
Index altered
但是,这个时候,如果想把个别分区给compress是可以的:
SQL> alter index idx_test_PARTITION rebuild partition test02 compress;
Index altered
估计一个分区索引的个别分区能否compress是和对象级别的能否compress相关的
表的分区能独立的compress