ziyoo0830 发表于 2014-1-27 10:30:29

表上有倒序索引 shrink space 报:ORA-10631

本帖最后由 ziyoo0830 于 2014-1-27 10:32 编辑

os:oracle linux 4
db:11.2.0.1(单机)

表上有降序索引,做shrink space的时候报错 ORA-10631

由于是生产环境上的数据不方便拿出来,所有模拟了一个过程,详细如下:

SYS@ora11asm>CREATE TABLESPACE lmtbsb DATAFILE '/home/oracle/oradata/lmtbsb01.dbf' size 50m
  2  extent management local
  3  segment space management auto ;

Tablespace created.


SYS@ora11asm>create user testclob default tablespace lmtbsb identified by testclob ;

User created.

SYS@ora11asm>grant connect ,resource to testclob ;

Grant succeeded.


SYS@ora11asm>create table clobtable (id number, clob_data CLOB);

TESTCLOB@ora11asm>create table t_abc (a int ,b int ) ;

Table created.

TESTCLOB@ora11asm>insert into t_abc values (1,2) ;

1 row created.

TESTCLOB@ora11asm>insert into t_abc values (11,22) ;

1 row created.

TESTCLOB@ora11asm>commit ;

Commit complete.

TESTCLOB@ora11asm>create index t_abc_idx on t_abc (a desc ) ;

Index created.

TESTCLOB@ora11asm>update t_abc set a= null ;

2 rows updated.

TESTCLOB@ora11asm>alter table t_abc shrink space ;
alter table t_abc shrink space
*
ERROR at line 1:
ORA-10636: ROW MOVEMENT is not enabled


TESTCLOB@ora11asm>alter table t_abc enable row movement ;

Table altered.

TESTCLOB@ora11asm>alter table t_abc shrink space ;
alter table t_abc shrink space
*
ERROR at line 1:
ORA-10631: SHRINK clause should not be specified for this object

TESTCLOB@ora11asm>alter table t_abc shrink space cascade ;
alter table t_abc shrink space cascade
*
ERROR at line 1:
ORA-10631: SHRINK clause should not be specified for this object

请问这个是什么原因?


ziyoo0830 发表于 2014-1-27 10:35:41

收缩lob可以用这个 alter table clobtable modify lob (lob column) (shrink space) ;

ziyoo0830 发表于 2014-1-27 11:32:47

oracle降序索引是函数索引 。好像可以解释表上有desc index 不能使用shrink space 了。

Maclean Liu(刘相兵 发表于 2014-1-31 16:06:11

shrink操作默认要维护索引,对于复杂一点的索引 的维护超出了它整个特性的设计预想了
页: [1]
查看完整版本: 表上有倒序索引 shrink space 报:ORA-10631