Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5272007
  • 博文数量: 1144
  • 博客积分: 11974
  • 博客等级: 上将
  • 技术积分: 12312
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-13 20:06
文章存档

2017年(2)

2016年(14)

2015年(10)

2014年(28)

2013年(23)

2012年(29)

2011年(53)

2010年(86)

2009年(83)

2008年(43)

2007年(153)

2006年(575)

2005年(45)

分类: 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


阅读(1823) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~