Is your table empty? My test shows that if the table is empty, the index is VALID, otherwise it's UNUSABLE:
SQL> create table t (a number);
Table created.
SQL> create index t_ind on t(a);
Index created.
SQL> select tablespace_name from user_tables where table_name = 'T';
TABLESPACE_NAME
------------------------------
USERS
SQL> select tablespace_name, status from user_indexes where index_name = 'T_IND';
TABLESPACE_NAME STATUS
------------------------------ --------
USERS VALID
SQL> alter table t move tablespace tools;
Table altered.
SQL> select tablespace_name, status from user_indexes where index_name = 'T_IND';
TABLESPACE_NAME STATUS
------------------------------ --------
USERS VALID
SQL> alter table t move tablespace users;
Table altered.
SQL> select tablespace_name, status from user_indexes where index_name = 'T_IND';
TABLESPACE_NAME STATUS
------------------------------ --------
USERS VALID
SQL> insert into t values (123);
1 row created.
SQL> alter table t move tablespace tools;
Table altered.
SQL> select tablespace_name, status from user_indexes where index_name = 'T_IND';
TABLESPACE_NAME STATUS
------------------------------ --------
USERS UNUSABLE
This test is done on both 8.1.7 and 9.0.1.1.1.
Yong Huang
QUOTE:
最初由 muhaook 发布
相关索引也是valid的。
我把情况说一下:
表及其索引在表空间1上。构成这个表空间的是操作系统文件。
我新建了表空间2,建在裸磁盘上。
alter table XXX move tablespace2;
索引仍然在表空间1上。
索引是有效状态。我没有rebuild